Commit graph

1004 commits

Author SHA1 Message Date
Nexus Dev
fb76b5eeef refactor(nexus): wave 3a controller integration pass
Three coordinated fixes after phases 12, 13, 14, 15 all landed in
parallel on nexus/design-system-migration:

1. TopStrip.test.tsx provider stubs for phase 14 contexts.

Phase 14 wired CmdKButton to a new CommandPaletteContext via the
useCommandPalette() hook. TopStrip renders CmdKButton internally,
so its existing tests (written in phase 8 before the context
existed) throw "useCommandPalette must be used within a
CommandPaletteProvider" on every case. Same issue on GlobalMicButton
which now reads from VoiceContext.

Fix: add module-scope vi.mock() stubs for both contexts returning
minimal shapes, matching the existing CompanyContext mock pattern
already in the file. No test semantics change - the TopStrip is
still rendered in isolation, still verified to contain the three
children (ModeBreadcrumb, CmdKButton, GlobalMicButton) and the
header landmark. All 4 TopStrip tests pass again.

Phase 15's report flagged this breakage explicitly and confirmed
via git stash that it was pre-existing on phase 14's HEAD, not
introduced by phase 15.

2. PromoteTransition mobile variant.

Phase 15 deferred the mobile variant of the promote-to-project
transition because PromoteTransition.tsx did not yet exist when
phase 15 started (phase 12 created it mid-dispatch). The defer
was correct per explicit instructions.

Fix: add a CSS media query inside the existing scoped <style>
block in PromoteTransition.tsx:

  @media (max-width: 767px) {
    .nx-promote-ribbon[data-pstate="prompting"],
    .nx-promote-ribbon[data-pstate="creating"] {
      max-height: 0;
      box-shadow: none;
      overflow: hidden;
    }
    .nx-promote-label[data-pstate="prompting"],
    .nx-promote-label[data-pstate="creating"] {
      display: none;
    }
  }

On mobile the brainstormer completely covers the chat thread
instead of sharing a 30/70 split, per spec section 9.1. The panel
itself already takes the remaining viewport height via flex, so
once the ribbon collapses to zero the brainstormer naturally
fills the whole area.

Pure CSS - no JS media query, no useMediaQuery call, no test
changes needed. Single 768px breakpoint matches the rest of the
Nexus frame.

3. Layout.tsx onSearch now calls useCommandPalette().setOpen(true)
   directly instead of dispatching a synthetic Cmd+K keydown.

Phase 14 installed a real command palette context with a provider
mounted in main.tsx, but left Layout.tsx's onSearch callback using
the old synthetic keydown shim because Layout is phase 15-owned
(parallel dispatch rules). The synthetic dispatch worked end-to-end
because the provider's global keydown listener catches it, but it's
a code smell: a Layout-level callback generating a synthetic event
for a listener the Layout also owns.

Fix: import useCommandPalette, hold a commandPalette ref in the
Layout body, and replace the synthetic keydown dispatch with
commandPalette.setOpen(true). Drop the Phase 8 shim comment; leave
a single-line Phase 14 explanation.

All 294 tests pass across 37 test files (frame, assistant, studio,
projects, settings, Voice/CommandPalette contexts, home-status and
gate-indicator and promote-to-project hooks, StudioWorkshopDetail
page). Typecheck clean across every wave 1-3A file plus App.tsx
and Layout.tsx.

Known deferrals not addressed in this commit:
  - MobileTabBar does not port MobileBottomNav's "new issue" FAB or
    inbox badge count. Spec section 9.1 says 4 destinations only;
    requires user decision on whether to restore as a separate mobile
    affordance or route through the command palette.
  - VoiceMicButton.tsx and useVadRecorder.ts are now dead code after
    phase 14's ChatInput migration. Both are in the phase 16 cleanup
    plan's deletion list.
  - Destination regexes are duplicated between IconRail and
    MobileTabBar. Phase 16 DRY target via a shared frame/destinations
    module.
  - Phase 13 left ui/src/lib/instance-settings.ts whitelisting
    /heartbeats and /experimental paths. Redirect routes catch these,
    so the whitelist is cosmetic; phase 16 cleanup target.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:32:46 +00:00
Nexus Dev
1a0d611cb1 refactor(nexus): consolidate Settings into single-column scroll page (phase 13)
Rewrites InstanceGeneralSettings.tsx into the consolidated /instance/
settings/general destination per spec §8.1 — a single-column scroll
that stacks eight section cards (Workspace, Local AI, Cloud Providers,
Skills, Routines, Telegram, About, Danger Zone).

App.tsx nested settings sub-routes collapse:
 - /instance/settings/heartbeats → redirect to /general
 - /instance/settings/experimental → redirect to /general
The /instance/settings/plugins tree is left intact: it is a
plugin-system surface with its own pages, not a settings sub-page.

Deletes InstanceSidebar.tsx (already unmounted by Phase 8),
InstanceSettings.tsx (scheduler heartbeats dashboard, folded out per
spec), and InstanceExperimentalSettings.tsx (experimental toggles are
now part of the Workspace section).

Also fixes ToastInput shape (title/tone instead of message/type) in
CloudProvidersSection and TelegramSection, and drops the unavailable
cronExpression access in RoutinesSection since the RoutineListItem
trigger Pick does not include it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:28:40 +00:00
Nexus Dev
6aeadeeb11 feat(nexus): add Telegram, About, and DangerZone settings cards (phase 13)
TelegramSection wraps /telegram/token (masked password Input) and
/telegram/status so the bot token can be set or replaced inline.
Values are never logged.

AboutSection renders app name, version, fork lineage, and MIT license
with an outbound link.

DangerZoneSection marks the reset-workspace and delete-all-
conversations actions from spec §8.1 as disabled placeholders — their
server endpoints are not yet wired, and fabricating fake ones would
break the "preserve existing functionality" rule.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:25:26 +00:00
Nexus Dev
9b772aa1bd feat(nexus): mount phase 14 providers + drain voice queue in assistant
main.tsx adds VoiceProvider and CommandPaletteProvider to the provider
stack, placed above BrowserRouter so both the route tree and the
document-level Cmd+K listener see a stable context.

PersonalAssistant gains a single-shot effect that, on mount, drains
VoiceContext.queue via drainQueue() and feeds each transcript through
the existing handleSend pipeline. This implements spec section 5.5
(voice captured on non-Assistant routes streams through on arrival).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:23:30 +00:00
Nexus Dev
2a950dedd0 refactor(nexus): ChatInput voice mic consumes VoiceContext
The inline voice button is now a thin consumer of VoiceContext: it
calls startListening({ inline: true, onTranscript }) so the transcript
is inserted into the textarea instead of being queued for the
Assistant inbox. The useVadRecorder-based VoiceMicButton import is
dropped — getUserMedia, MediaRecorder, and the /api/transcribe fetch
all live in VoiceContext now. VoiceWaveform is still rendered while
listening, driven by the shared mediaStream from the provider.

Tests wrap ChatInput in <VoiceProvider silenceErrors> so the
useVoice() hook resolves in jsdom.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:23:22 +00:00
Nexus Dev
c417ce37f9 feat(nexus): add Skills and Routines settings cards (phase 13)
SkillsSection surfaces installed skill and skill-group counts and
links out to the existing Skill Aggregator (CompanySkills page) at
/<prefix>/skills. The full browse/install/assign UI stays put; the
section is a compact summary + entry point per plan recommendation.

RoutinesSection renders the top five routines as a compact read-only
list (title, cron label, status) and links out to /<prefix>/routines
for the full interactive editor. Single responsibility per page,
matches the plan's recommendation (a) for Routines fold-in.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:23:20 +00:00
Nexus Dev
9a81f0e22b feat(nexus): extend command palette search + fix shortcut destructure
CommandPalette now consumes CommandPaletteContext (open/setOpen) and
the internal Cmd+K useEffect is gone — the provider owns the global
listener. The search index gains live groups for conversations (via
chatApi.listConversations) and studio workshops (mapped from the
phase 10 WorkshopSlugs), plus stubbed entries for 8 settings section
anchors that will resolve once phase 13 splits InstanceGeneralSettings
into cards. Recipes are stubbed as a disabled placeholder pending
v1.8's recipe API.

useKeyboardShortcuts: adds `onSearch` to the destructure (the phase
6/11 review noted it was referenced at line 25 but never destructured
at lines 12-17) and adds it to the useEffect dependency list.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:23:14 +00:00
Nexus Dev
45d2a9ff24 refactor(nexus): wire frame buttons to phase 14 contexts
GlobalMicButton drops the state and onClick scaffolding props from
phase 8 and now consumes VoiceContext directly — click calls
toggleListening(). It also reflects hasQueuedVoice via the idle dot
color and an updated aria-label so the assistant-bound queue is
observable from any route.

CmdKButton replaces the synthetic Meta+K keydown shim with a direct
setOpen(true) call on the CommandPaletteContext. The shim comment
block is gone; no more document dispatch side effects on click.

Tests updated to render inside their respective providers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:23:04 +00:00
Nexus Dev
673962fad8 feat(nexus): CommandPaletteContext replaces Cmd+K shim
Introduces a provider that owns the palette open state and installs a
single document-level Cmd+K / Ctrl+K listener. Replaces the Phase 8
pattern where CmdKButton synthesized KeyboardEvents and CommandPalette
attached its own listener inside a useEffect.

Used by CmdKButton (setOpen(true)), CommandPalette (open/setOpen), and
Layout's onSearch wiring. Tests cover direct toggle, provider-level
keyboard listener (both metaKey and ctrlKey), and the missing-provider
throw path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:22:56 +00:00
Nexus Dev
14ecbf00bb feat(nexus): VoiceContext for phase 14 voice globalization
Lifts MediaStream, recording state, transcription buffer, and queue for
non-Assistant captures out of ChatInput's internal VoiceMicButton. The
provider owns the POST /api/transcribe fetch (v1.6 pipeline, unchanged),
exposes idle/listening/speaking state to the top-strip GlobalMicButton,
and queues transcripts captured away from /assistant for PersonalAssistant
to drain on mount.

Per spec sections 4.2 (mic states), 5.5 (voice from non-Assistant modes),
and 10.3 (voice as global affordance). Tests use manual createRoot + act
with a mocked getUserMedia injector to stay deterministic in jsdom.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:22:48 +00:00
Nexus Dev
4623c8aea0 feat(nexus): add mobile tab bar and sheet variants (phase 15)
Replace legacy MobileBottomNav with the new 4-destination MobileTabBar
that mirrors the desktop IconRail (Assistant, Studio, Projects,
Settings). Adds volt active states with a 2px bar above the icon,
safe-area bottom padding, and scroll-hide wiring via the existing
mobileNavVisible handler in Layout.

Adapts Phase 9 HistorySheet and MemorySheet to a full-screen variant
below 768px via useMediaQuery, and makes Phase 11 BuilderTabStrip
horizontally scrollable with scroll-snap and edge fade on mobile.
Light TopStrip polish (tighter padding, truncating breadcrumb)
completes the mobile frame.

PromoteTransition mobile variant is deferred — Phase 12 had not yet
landed when Phase 15 started; the controller can add the mobile
branch when merging.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:21:28 +00:00
Nexus Dev
f41690ff30 feat(nexus): add LocalAI and CloudProviders settings cards (phase 13)
LocalAISection surfaces the Hermes adapter tier, Whisper/Piper voice
availability, and the global voice toggle wired through nexus-settings.

CloudProvidersSection lists Anthropic and OpenAI API key slots; keys
are set via the existing /api-keys/store endpoint and rendered as a
password-type Input so values are masked on display and never logged.
Presence is derived from the workspace secret vault.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:20:14 +00:00
Nexus Dev
b277527510 feat(nexus): add promote-transition css-first animation overlay
Phase 12 — renders the 700ms compress-and-rise transition from spec
§5.6 using CSS keyframes inlined via a scoped <style> tag. Chat ribbon
compresses to 30vh with an inset shadow (0–200ms), brainstormer panel
slides up from the bottom (200–500ms), SOURCE CONVERSATION label fades
in (500–700ms). Honors prefers-reduced-motion. No motion library.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:19:32 +00:00
Nexus Dev
70698b9e58 feat(nexus): add brainstormer panel for promote-to-project flow
Phase 12 — the form that rises into the bottom 70% during the promote
animation. Collects goal (required), acceptance criteria (one per
line), default gate checklist, and engineer template picker. ESC key
cancels when not mid-create; goal field autofocuses on mount.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:19:18 +00:00
Nexus Dev
d2d41886fa feat(nexus): add promote-to-project state machine hook
Phase 12 — idle/prompting/creating/done/error state machine that drives
the 700ms compress-and-rise animation and calls projectsApi.create with
a brainstormer payload (goal, acceptance criteria, gates, engineer
template). Also exports buildCreatePayload helper for testing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:19:01 +00:00
Nexus Dev
8953fb13ab feat(nexus): add WorkspaceSection settings card (phase 13)
First of eight section cards for the consolidated Settings page. Folds
in theme toggle, re-run onboarding trigger, keyboard shortcuts, log
censoring, feedback sharing preference, and the two experimental
toggles (isolated workspaces, dev-server auto-restart) that previously
lived at /instance/settings/experimental.

Preserves all existing form validation, save handlers, and error
toasting from InstanceGeneralSettings and InstanceExperimentalSettings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:17:40 +00:00
Nexus Dev
7aa98d385f feat(nexus): add SettingsSection shell primitive (phase 13)
Shared section card shell for the Nexus Settings page per spec §8.2:
1px charcoal border, 8px radius, transparent fill, uppercase silver
title with hairline rule. Used by all 8 section cards that replace the
nested Paperclip instance-settings tree.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:16:32 +00:00
Nexus Dev
428f033690 refactor(nexus): wave 2.5 follow-ups (presentations + proj derivatives)
Three coordinated changes after reviewing the wave 2 subagent reports:

1. Restore Presentations as the 9th Studio workshop.

Phase 10's subagent dropped Presentations from the workshop grid
because the spec's eight-workshop list didn't include it. But
.planning/PROJECT.md explicitly lists "Presentations & video
generation via Remotion" as an Active v1.7 requirement and the
existing PresentationPanel.tsx is already a real working Remotion
generator. Dropping it was silent feature regression.

  - workshops.ts: add "presentations" slug + Presentation Lucide
    icon, placed between social and convert in canonical order
  - classifyIntent.ts: add pitch-deck / slide-deck / demo-video /
    keynote intent routing (before social so "pitch deck" wins)
  - StudioWorkshopDetail.tsx: import PresentationPanel and add a
    "presentation" case in WorkshopBody
  - workshops.test.ts: expected canonical order updated to 9 slugs
  - classifyIntent.test.ts: 4 new parameterized rows for presentations
  - WorkshopCard.test.tsx: index 7 is now PRESENTATIONS, 8 is CONVERT
  - WorkshopGrid.test.tsx: expected card count 9, canonical order

2. ProjectCard hero-stat derivatives instead of em-dash city.

The shared Project record has none of the fields the spec §7.1 card
depends on: milestoneProgress, nextGate, costBurned, per-project
agent count, phase/milestone array. Wave 2 shipped every card with
"—%" and blank hero numbers — visually underwhelming for a layout
whose whole point is the 72px volt performance stat.

Compute best-effort proxies on the client from data that exists:

  - progress: closed_issues / total_issues × 100, from a single
    issuesApi.list(companyId) query grouped by projectId
  - nextGateName: first pending approval whose payload.projectId
    matches, from a single approvalsApi.list(companyId, "pending")
    query
  - lastActivity: max(project.updatedAt, newest issue.updatedAt in
    the project), rendered as "8m ago"-style diff

Each proxy is annotated with // TODO(phase-11.5) for replacement
when real backend aggregates land. phase, costBurnedCents, and
per-project agent count remain hard gaps — rendered as null which
the card surfaces as em-dashes. These three are explicitly queued
for Phase 11.5.

No backend changes; everything derives from existing endpoints.
Two new useQuery calls in Projects.tsx (issues + pending approvals)
both fire per-company, not per-project, so they stay cheap for the
~dozens-of-projects scale the list targets.

3. Spec updated 8 → 9 workshops everywhere it referred to the count.

docs/specs/2026-04-11-nexus-layout-overhaul.md:
  - §2 IA table: 8 → 9 workshops
  - §6 ASCII header: Eight → Nine
  - §6.3 section title: Eight workshops → Nine workshops
  - §11 decisions log #16: amendment note explaining the 8→9 bump
  - §13 phase 10 description: 8-card → 9-card, with Presentations
    explicitly called out
  - "Folds into Studio as the 8th workshop" → "Folds into Studio
    as a workshop (the legacy /convert route is preserved for
    backwards compat)"

Verification: 75/75 studio tests passing; 52/52 projects tests
passing; tsc clean on studio/ + projects/ + Projects.tsx +
ProjectDetail.tsx + StudioWorkshopDetail.tsx.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 13:04:36 +00:00
Nexus Dev
1b7e3d44fe refactor(nexus): wire wave 2 routing and icon rail gate indicator
Controller integration pass after the three wave 2 subagents (phases
9, 10, 11) completed their phase implementations. Three changes in
one commit because they're a single coordinated post-dispatch step:

1. App.tsx routing
   - Adds 5 new per-project builder tab routes for phase 11:
       projects/:projectId/agents
       projects/:projectId/gates
       projects/:projectId/costs
       projects/:projectId/activity
       projects/:projectId/org
     plus their unprefixed UnprefixedBoardRedirect variants so
     direct nav and deep links resolve through the same fallback
     chain as /overview and /issues.
   - Adds content-studio/:workshopSlug as a sibling route for
     phase 10's workshop detail view. Without this, clicking a
     workshop card hit the * fallback NotFoundPage because the
     existing content-studio route was an exact match and the
     ContentStudio-internal pathname workaround couldn't fire.
   - Does NOT rename the legacy /convert route. ConvertPage still
     renders directly at /convert for backwards compat; Studio's
     Convert workshop reuses the ConvertPanel body inside its own
     detail shell.

2. IconRail volt-dot indicator
   - Imports useCompany from CompanyContext and useGateIndicator
     from the new phase 11 hook.
   - When selectedCompanyId resolves to a company with at least
     one pending approval (displayed as "gates" per phase 11's
     display rename), renders a 6px volt dot overlay in the
     top-right of the Assistant destination icon and updates
     the link's aria-label to "Assistant (pending gates)".
   - This is the single global notification surface specified by
     spec section 10.4 - no badge counts, no inbox icons, no toasts.

3. IconRail.test.tsx
   - Mocks useGateIndicator at module scope so tests don't need
     a QueryClientProvider for the rail's useQuery-backed data.
   - Replaces the plain function mock with a vi.fn() spy so
     per-suite overrides can flip hasPendingGates without dynamic
     imports.
   - Adds a sibling describe block that verifies the volt dot
     renders and the aria-label updates when hasPendingGates is true.
   - 7 original tests pass; 2 new tests cover dot-absent and
     dot-present cases. 9 tests total.

Verification: 211/211 tests passing across 22 files in the combined
frame + assistant + studio + projects suites; tsc clean on every
wave 1 and wave 2 file plus App.tsx.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:32:56 +00:00
Nexus Dev
1e85565765 refactor(nexus): add BuilderTabStrip to ProjectDetail (phase 11)
Integrates the Phase 11 Builder tab strip into ProjectDetail without
disturbing any existing Paperclip sub-route behavior. The approach:

1. When location.pathname resolves to a Builder tab (overview /
   issues / agents / gates / costs / activity / org), render the
   BuilderTabStrip + the matching new tab component (OverviewTab /
   ProjectIssuesList / AgentsTab / etc.) and hide the legacy
   PageTabBar + legacy overview/list handlers.
2. When the pathname resolves to a legacy tab (configuration /
   budget / workspaces / plugin:*), the existing Tabs/PageTabBar and
   dispatch render exactly as before — backwards compat preserved.

This is Option 1 from the Phase 11 plan: union the old and new tab
logic, silent pass-through for configuration/budget, no surface in
the new strip.

OverviewTab currently receives null for every data slice
(progress/milestones/originChat/activity24h) because the shared
Project type + projectsApi don't carry those fields yet; the tab
renders explicit em-dash / "No milestones defined" placeholders.
See the Phase 11 report for the backend gap list.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:24:40 +00:00
Nexus Dev
e43d5ec220 refactor(nexus): drop unused useNavigate import from PersonalAssistant (phase 9)
Phase 9's Promote action no longer navigates away from the Assistant
route (spec §5.7 says the user stays in Assistant after promotion), so
useNavigate() and its ugly data-nav placeholder span are dead code.
Drop them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:23:42 +00:00
Nexus Dev
c3689f11b1 refactor(nexus): rewrite Projects list with hero-stat cards (phase 11)
Replaces the EntityRow table with the spec §7.1 hero-stat card grid:
full-width cards on <1024px, 2-up on lg+, 16px gap. Each card uses
the new ProjectCard component (72px Inter Black volt hero, status
dot, progress bar, sub-line, footer).

Adds the spec's empty state — full-bleed 96px Inter Black volt
"NO PROJECTS YET" with a forest-green "⊕ START YOUR FIRST PROJECT"
CTA. The regular top-right "⊕ NEW PROJECT" CTA is also forest-green.
Both CTAs wire to the existing openNewProject dialog.

Data gaps: the card passes progress=null, phase=null, nextGateName=
null, costBurnedCents=null because the shared Project type doesn't
carry those fields yet. ProjectCard renders em-dash placeholders
gracefully. Status is mapped from the existing ProjectStatus enum
(paused → waiting, active/running → working, else idle).

Also fixes an unrelated test fixture that used the stale "active"
ProjectStatus literal which tsc rejects.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:23:14 +00:00
Nexus Dev
06c6317c25 refactor(nexus): rewire PersonalAssistant to use new frame pieces (phase 9)
Composes the Phase 9 assistant primitives at /assistant: full-bleed chat
canvas with a 760px centered column, AssistantHomeGreeting for the no-
conversation state, AssistantInputBar + ActionStrip anchored at the
bottom, and HistorySheet / MemorySheet slide-overs. Drops the 160px
inner conversation-list column and the custom MessageBubble, delegating
thread rendering to the shared ChatMessageList and streaming to the
shared useStreamingChat hook. Adds a ?prompt= query-param fallback for
Studio → Assistant hand-offs, preserves the existing assistantHandoff
call as the Promote action, and syncs the selected conversation id with
the shared ChatPanelContext so HistorySheet stays in lockstep.

Also fixes typecheck fallout from the rewrite: switches toast tones to
the documented info|success|warn|error set, narrows the stale-project
filter to use archivedAt (ProjectStatus never had "archived"), and
tightens the MemorySheet test render helper to JSX.Element.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:22:55 +00:00
Nexus Dev
d10c5b991e feat(nexus): add thin wrappers for per-project tabs (phase 11)
Wires the 6 Builder tab content components:

• IssuesTab — thin wrapper around IssuesList (which already accepts a
  projectId prop, so this is a full wiring).
• GatesTab / AgentsTab / CostsTab / ActivityTab / OrgTab — render a
  shared TabPlaceholder marking the Phase 11 data gap. None of the
  underlying list components accept a projectId filter today, and the
  Phase 11 plan forbids modifying them unilaterally. The placeholders
  are explicit (never fabricate per-project data) and carry the
  follow-up description the controller will turn into a ticket.

GatesTab is named "Gates" everywhere visible (display-only rename per
spec §7.2.4 / plan §5); approvalsApi / Approval type / /api/approvals
endpoints are all untouched.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:21:33 +00:00
Nexus Dev
cd6c172d48 refactor(nexus): rewire content studio to workshop grid 2026-04-11 12:21:29 +00:00
Nexus Dev
f20fd0ec8d feat(nexus): add OverviewTab with hero stat + milestones (phase 11)
Implements the default Builder tab per spec §7.2.1:
• 72px Inter Black volt hero percentage + "N AGENTS ACTIVE" counter
• Milestone checklist card with [✓]/[○]/[ ] bullets and pale yellow
  next-gate marker + "← NEXT GATE" label
• Optional origin chat card (hidden when project has no origin)
• 24h activity rollup card (commits, issues closed, gates awaiting,
  burned)

All data inputs are typed with nullable fields so callers can pass
null for any missing slice and the tab renders explicit em-dash or
"No milestones defined" placeholders without fabricating values.
The Project type doesn't currently carry milestones, origin chat, or
24h rollups — see Phase 11 report for the backend gap list.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:19:53 +00:00
Nexus Dev
a0cb132e9d feat(nexus): add MemorySheet slide-over (phase 9)
Right-side 340px slide-over that lists the facts stored in the existing
assistantMemoryApi and lets the user append new facts or clear memory.
Handles loading, error, and empty states, closes on backdrop click or
ESC, and degrades to a workspace prompt when no company is selected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:19:36 +00:00
Nexus Dev
2c3f4ff623 feat(nexus): add BuilderTabStrip component (phase 11)
Introduces the 7-tab Builder strip rendered under TopStrip on Project
Detail: OVERVIEW · ISSUES · AGENTS · GATES · COSTS · ACTIVITY · ORG.
Inter 600 14px uppercase, 0.1em tracking, silver default, volt text
+ 2px volt underline on active. ORG is hidden for single-agent
projects (spec §7.2.7).

Also exports resolveBuilderTab() and useActiveBuilderTab() for the
ProjectDetail integration. The link targets for agents/gates/costs/
activity/org route back to ProjectDetail via path matching until the
controller adds the new App.tsx routes post-Wave (see report).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:18:35 +00:00
Nexus Dev
8527beca56 feat(nexus): add HistorySheet slide-over (phase 9)
Left-side 320px slide-over butted against the icon rail. Wraps the
existing ChatConversationList so conversation grouping, search, pinning
and create/rename flows are preserved as-is. Closes on backdrop click
or ESC and includes a dismiss button in the header.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:18:31 +00:00
Nexus Dev
d432326e7a feat(nexus): add StudioWorkshopDetail page (phase 10)
Two-column workshop detail shell — params on the left (holds the
existing generator panel), preview placeholder and action bar
(Save/Export/Send to Assistant) on the right. Maps each workshop slug
to one of the legacy ContentStudio generator panels, with ConvertPanel
folded in for the convert workshop and a placeholder fallback for
unknown slugs. Reads ?prompt= from the URL and surfaces it as a chip.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:17:58 +00:00
Nexus Dev
cd75772a6a feat(nexus): add ActionStrip for assistant actions (phase 9)
Four-button row beneath the input bar — Promote (volt outline, disabled
when the conversation is not promotable), Attach, Memory, History. Pure
presentational component; the caller owns click handlers and the
promotable predicate. Phase 12 will wire the promote animation itself.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:17:46 +00:00
Nexus Dev
a2dab5b4f6 feat(nexus): add ProjectCard hero-stat component (phase 11)
New Projects list card: 72px Inter Black volt hero percentage, pale
yellow/volt/forest status dot, 8px progress bar, sub-line with phase
and next-gate counter, footer with burn + last activity. Graceful
em-dash placeholders when milestone/cost/activity fields are missing
(the shared Project type has no milestoneProgress etc. yet — see
Phase 11 data-gap report).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:17:12 +00:00
Nexus Dev
3fe4b543cf feat(nexus): add AssistantInputBar composite (phase 9)
Wraps the existing ChatInput and VoiceWaveform into the spec-canonical
input surface: voice waveform above, hairline divider, and text input
below, inside a rounded 8px near-black shell. Stateless composite —
callers pass micStream/micActive and onSend through to the underlying
primitives.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:16:51 +00:00
Nexus Dev
31d64bbb1d feat(nexus): add StudioPromptBar with intent routing (phase 10)
Freeform input rendered at the bottom of the Studio home. Uses the
classifyIntent helper to route to a workshop, or falls through to the
Assistant for unclassified prompts. The parent page wires the two
callbacks to navigate().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:16:12 +00:00
Nexus Dev
37d3919c98 feat(nexus): add AssistantHomeGreeting component (phase 9)
Renders a conversational home-state message as an assistant-turn bubble
when no chat is active, summarising active agents, pending gates,
recent completions, and stale projects via markdown bullets. Replaces
the old Dashboard grid for the Assistant landing route. Exposes a pure
`buildGreetingMarkdown` helper driving the unit tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:15:50 +00:00
Nexus Dev
6010a105fe feat(nexus): add useGateIndicator hook (phase 11)
Introduces a minimal pending-gate indicator hook for Phase 11. Reads
the existing approvals endpoint and exposes {hasPendingGates, count,
loading, error} for the IconRail Assistant dot overlay. The rename
from "Approvals" to "Gates" is display-only — approvalsApi and the
underlying /api/approvals endpoint are untouched.

Ships the hook + tests only; the IconRail wiring is deferred to the
controller post-Wave 2 (IconRail is a Phase 8 file).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:15:47 +00:00
Nexus Dev
d2dcb1c813 feat(nexus): add WorkshopCard and WorkshopGrid components (phase 10)
Presentational primitives for the Studio home. WorkshopCard renders a
single workshop with title/subtitle/volt icon and fires onSelect on
click. WorkshopGrid lays them out responsively (1/2/3 columns). No
routing concerns here — the ContentStudio page binds onSelect to
navigate().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:15:14 +00:00
Nexus Dev
397e12a8fd feat(nexus): add useAssistantHomeStatus hook (phase 9)
Aggregates active agents, pending gates, recent completions, and stale
projects from the existing agents, approvals, activity, and projects
APIs into a single shape consumed by AssistantHomeGreeting. The pure
`composeHomeStatus` helper drives the tests; the hook wires it to
react-query and degrades each slice to empty on fetch error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:14:47 +00:00
Nexus Dev
533490f1a2 feat(nexus): add WORKSHOPS data + classifyIntent helper (phase 10)
Introduce the single source-of-truth data structure for the 8 Studio
workshops (diagrams, icons, themes, wallpapers, documents, brand-kits,
social, convert) and a pure keyword-based intent classifier used by
StudioPromptBar to route freeform prompts to the right workshop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 12:14:17 +00:00
Nexus Dev
2dbf281117 refactor(nexus): apply Task 6 code-quality fixes to Layout.tsx (phase 8)
Three cleanups from the Task 6 code-quality review:

1. Delete dead instanceSettingsTarget state and supporting code.
   The useState, the readRememberedInstanceSettingsPath helper, the
   INSTANCE_SETTINGS_MEMORY_KEY constant, and the localStorage-writing
   effect were all residue from the old footer sidebar buttons that
   Task 6 deleted. Verified via grep that no other file in ui/src
   reads paperclip.lastInstanceSettingsPath.

2. Consolidate two near-identical mobile-nav-visibility effects into
   one. The standalone isMobile-reset effect was a strict subset of
   the scroll-listener effect's early-return branch.

3. Drop onToggleSidebar / onTogglePanel stub callbacks.
   useKeyboardShortcuts declares these as optional and uses optional
   chaining internally; the stubs were "type contract satisfaction"
   the contract did not actually require.

No behavioral change. 38 frame tests still pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:31:05 +00:00
Nexus Dev
d87f644cde refactor(nexus): mount new frame in Layout.tsx; kill old chrome (phase 8)
Rewrites Layout.tsx to compose the new Phase 8 frame (IconRail +
TopStrip) and remove the old chrome elements specified as killed in
docs/specs/2026-04-11-nexus-layout-overhaul.md §2:

Removed from chrome:
  - 280px collapsible Sidebar / InstanceSidebar
  - ChatPanel global slide-in right rail
  - PropertiesPanel global slide-in right rail
  - BreadcrumbBar (replaced by ModeBreadcrumb inside TopStrip)
  - Footer row with Docs link, version tooltip, instance settings button,
    chat toggle button, theme toggle button
  - Effect that closed PropertiesPanel when chat opened
  - Mobile sidebar drawer block
  - Mobile sidebar swipe gesture listener

Preserved:
  - Company-prefix URL sync and fallback redirect machinery
  - First-run onboarding trigger
  - WorktreeBanner, DevRestartBanner
  - Scroll-based mobile nav visibility tracking
  - Body overflow management
  - Instance settings path memory
  - Dialog overlays (NewIssue, NewProject, NewGoal, NewAgent)
  - ToastViewport, CommandPalette
  - MobileBottomNav (mobile only; Phase 15 replaces)

Added:
  - IconRail mount with derived companyPrefix from matchedCompany or
    selectedCompany
  - TopStrip mount above the main content area
  - hasUnknownCompanyPrefix fallback defaults to /assistant instead of
    /dashboard (Dashboard is killed in the new IA)
  - useKeyboardShortcuts.onSearch dispatches the same synthetic Meta+K
    keydown as the CmdKButton shim

The Sidebar, InstanceSidebar, BreadcrumbBar, ChatPanel, PropertiesPanel,
ThemeContext, and useChatPanel files remain in the repo; Phase 16
deletes dead files after the other Phase 8 tasks are proven stable.

Pages render unchanged in the new frame and will look visually wrong
until Phases 9-13 rebuild their internals. That is the expected
intermediate state per the spec.

Part of Phase 8 of the Nexus layout overhaul (task 6 of 7).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:21:09 +00:00
Nexus Dev
c521ae4403 feat(nexus): add TopStrip composite for layout overhaul (phase 8)
48px sticky top strip per docs/specs/2026-04-11-nexus-layout-overhaul.md
§4.2. Composes ModeBreadcrumb (left) + CmdKButton and GlobalMicButton
(right) inside a <header aria-label="Top bar"> landmark.

Completes the frame component set for Phase 8. The next task (task 6)
rewrites Layout.tsx to mount IconRail + TopStrip as the new global
chrome and delete the old sidebar/ChatPanel/PropertiesPanel/
BreadcrumbBar combination.

Part of Phase 8 of the Nexus layout overhaul (task 5 of 7).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:17:09 +00:00
Nexus Dev
bfcdf1f598 feat(nexus): add GlobalMicButton scaffold for layout overhaul (phase 8)
Visual-only mic button for the top strip per
docs/specs/2026-04-11-nexus-layout-overhaul.md §4.2. Renders three
specified states (idle / listening / speaking) but Phase 8 only
wires the idle state functionally. Phase 14 will toggle the state
prop from the voice pipeline without changing this component's
signature.

Uses text-primary/bg-primary for volt (already migrated in phases
1-3) and literal #166534 / #a0a0a0 for forest and silver, which
MIGRATION-PLAN.md §3 proposes as new semantic tokens that have not
yet shipped.

Part of Phase 8 of the Nexus layout overhaul (task 4 of 7).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:15:15 +00:00
Nexus Dev
c1647e70d7 feat(nexus): add CmdKButton shim for layout overhaul (phase 8)
Top-strip button that renders the ⌘K glyph and opens the existing
CommandPalette by dispatching a synthetic Meta+K keydown on document,
which CommandPalette.tsx already listens for at its useEffect
(lines 42-51). This is explicitly a Phase 8 shim; Phase 14 of
docs/specs/2026-04-11-nexus-layout-overhaul.md replaces it with a
proper command-palette context when globalizing the palette's
search index.

Part of Phase 8 of the Nexus layout overhaul (task 3 of 7).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:12:55 +00:00
Nexus Dev
1de78f855f fix(nexus): tighten settings-route guard in ModeBreadcrumb (phase 8)
Code-quality review for Task 2 caught a startsWith false-positive:
`/instance/settings-foo` was matching the settings branch of
deriveBreadcrumbSegments and producing nonsense output like
["SETTINGS", "-FOO"]. Tightened the guard to require an exact
match or a literal trailing slash before entering the settings
branch.

Added three test cases to lock it in:
  - /instance/settings (exact, no trailing) -> ["SETTINGS"]
  - /instance/settings-foo -> ["HOME"]
  - /instance/settings-foo/bar -> ["HOME"]

22 tests pass. No behavior change for any previously-tested path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:11:06 +00:00
Nexus Dev
bd4e7c5c5d feat(nexus): add ModeBreadcrumb for layout overhaul (phase 8)
Uppercase slash-separated breadcrumb that derives from the current
pathname per docs/specs/2026-04-11-nexus-layout-overhaul.md §4.2.
Leaf segment in text-primary (volt), non-leaf segments in
text-muted-foreground (silver). Pure function deriveBreadcrumbSegments
is exported for unit testing and covers 16 route patterns plus the
catch-all HOME fallback.

The derivation intentionally collapses Phase 11's soon-to-be-demoted
routes (issues/agents/routines/goals/approvals/costs/activity/inbox/
execution-workspaces) under the PROJECTS umbrella segment. When
Phase 11 lands and those routes become /projects/:slug/<tab>, the
derivation will naturally produce PROJECTS / PROJECT-SLUG without
code changes.

Part of Phase 8 of the Nexus layout overhaul (task 2 of 7).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:04:31 +00:00
Nexus Dev
9c1525a0f9 refactor(nexus): apply Task 1 code-quality fixes to IconRail (phase 8)
Addresses two Important findings from the Task 1 code-quality review:

1. Swap literal #faff69 hex for the text-primary / bg-primary token
   (4 sites). The --primary CSS variable is already wired to volt via
   MIGRATION-PLAN.md phases 1-3, and 50+ existing files use the token.
   The original Task 1 commit landed on literal hex as a self-
   documenting placeholder; moving to the token aligns with the rest
   of the codebase and makes theme swaps a single-file change.

2. Add focus-visible styles to the Nexus mark link and each
   DestinationLink. Previously the component relied on browser-default
   outline, which on pure-black canvas + volt icons is both off-palette
   and visually weak. Now uses a volt ring with background offset for
   clear keyboard focus indication.

No behavior change. All 7 IconRail tests still pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 11:01:17 +00:00
Nexus Dev
efbd1e451e refactor(nexus): remove redundant MemoryRouter re-export in router wrapper
Spec compliance review for Task 1 flagged that the explicit
`export { MemoryRouter } from "react-router-dom"` added in 332ed47b
is redundant — the line immediately above already does `export *`,
which includes MemoryRouter. The explicit line was cleanup debt from
defensive "just in case" reasoning, not an actual fix.

No behavioral change. IconRail.test.tsx still resolves MemoryRouter
via the export * and all 7 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:56:22 +00:00
Nexus Dev
332ed47bc0 feat(nexus): add icon rail component for layout overhaul phase 8
Introduces the 56px left icon rail specified in
docs/specs/2026-04-11-nexus-layout-overhaul.md §4.1. Four primary
destinations (Assistant, Studio, Projects, Settings) rendered as Lucide
icons with silver default + volt active state and a 2px volt bar on the
right edge of the active item. Destinations are company-prefixed except
Settings, which points at the global /instance/settings/general route.

The Studio icon also highlights on /convert because Phase 10 folds
ConvertPage into Studio as a workshop. The Projects icon is the umbrella
for all Phase 11 per-project-tab routes (issues, agents, routines,
goals, approvals, costs, activity, inbox, execution-workspaces).

The rail is not yet mounted in Layout.tsx — that happens in task 6.

Part of the Nexus v1.7 structural overhaul (Phase 8 of MIGRATION-PLAN.md
§8b). Companion tests cover all 4 destinations, active-state derivation,
and aria-current semantics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:52:18 +00:00
Nexus Dev
137bd3d0f6 fix(nexus): unblank assistant page on piper-tts import error
The usePiperTts hook imported a non-existent 'tts' namespace from
@mintplex-labs/piper-tts-web@1.0.4. The package exports named
functions (stored, download, predict, etc.) at the top level, not
under a tts namespace. The failing named-import threw at module-link
time, which crashed the lazy chunk for PersonalAssistant.tsx and
left /NEX/assistant blank with only a React error boundary fallback.

Two fixes in one file:

1. Import as namespace:
     import * as tts from "@mintplex-labs/piper-tts-web"
   ESM namespace imports synthesize a 'tts' object whose members are
   the package's named exports, so the existing tts.stored() /
   tts.download() / tts.predict() call sites bind to real functions
   without touching the hook body.

2. Wrap predict() Blob result in URL.createObjectURL() before passing
   to new Audio(). predict() returns Promise<Blob>, not a URL string,
   and Audio() cannot accept a Blob directly. Added a shared cleanup
   callback that revokes the object URL on onended/onerror and in the
   catch path so we don't leak blob URLs on every speak invocation.

Bug 1 was the page-blanking crash at module load. Bug 2 was a latent
runtime crash behind the speak button click handler, surfaced while
the file was already being edited.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:35:01 +00:00