Commit Graph

87 Commits

Author SHA1 Message Date
gsxdsm
4ea43c0c87 FN-5801: add markdown preview toggle for planning description
Add a markdown/plain toggle to the planning summary description so users can preview formatted content before creating a task.

- add a Description header toggle that switches between editable plain textarea and rendered markdown preview
- render description preview with react-markdown and remark-gfm while preserving expand/collapse layout behavior
- add preview container styles and spacing adjustments for summary form
- add UI interaction test coverage for markdown toggle behavior and rendered heading/bold content
- document the new markdown/plain description toggle in dashboard guide

Files changed:
 docs/dashboard-guide.md                            |  1 +
 packages/dashboard/app/components/PlanningModeModal.css | 18 +++++++-
 packages/dashboard/app/components/PlanningModeModal.tsx | 32 ++++++++++---
 packages/dashboard/app/components/__tests__/PlanningModeModal.ui-interactions.test.tsx | 54 ++++++++++++++++++++++
 4 files changed, 98 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-5801

Fusion-Task-Lineage: 34972830-7d51-4fcd-bf00-3de8f5aff028
2026-05-31 21:59:06 -07:00
gsxdsm
0a16fc690a FN-5799: preserve first-turn planning thinking output
Ensure first-question planning UI reliably shows streamed reasoning before question transitions.

- Keep streamingOutputRef synchronized during onThinking updates so back-to-back thinking/question events preserve full reasoning text.
- Expand PlanningModeModal question-flow tests to cover same-tick buffered replay and loading-view visibility for first-turn and follow-up thinking output.
- Update assertions to verify reasoning content remains visible in conversation history after question handoff.

Files changed:
 .../dashboard/app/components/PlanningModeModal.tsx |  9 +++-
 .../__tests__/PlanningModeModal.questions.test.tsx | 62 ++++++++++++++++++++--
 2 files changed, 66 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-5799
Fusion-Task-Lineage: 41677c47-4380-4145-a3d2-0e928fc40042
2026-05-31 21:43:23 -07:00
gsxdsm
0605d13ab5 FN-5675: add mission branch strategy and planning breakdown controls
Add mission-level branch strategy support and expose planning breakdown controls across mission flows.

- Extend mission/core data models and store logic to track and persist base-branch strategy metadata.
- Update mission API routes and legacy adapters to read/write new mission branch strategy fields.
- Enhance MissionManager and PlanningModeModal UX to configure branch strategy and planning breakdown behavior.
- Add/adjust coverage across core, dashboard, and roadmap plugin tests for mission branch and planning flow behavior.
- Add a changeset and mission docs updates for the new mission branch strategy behavior.

Files changed:
 .changeset/fn-5675-mission-branch-strategy.md      |   9 +
 docs/missions.md                                   |  13 ++
 packages/core/src/__tests__/db-migrate.test.ts     |  12 +-
 .../src/__tests__/db-mission-base-branch.test.ts   |  14 +-
 packages/core/src/__tests__/db.test.ts             |  34 ++--
 packages/core/src/__tests__/goals-schema.test.ts   |   2 +-
 packages/core/src/__tests__/insight-store.test.ts  |  10 +-
 packages/core/src/__tests__/mission-store.test.ts  | 148 +++++++++++++-
 packages/core/src/__tests__/run-audit.test.ts      |   2 +-
 packages/core/src/__tests__/secrets-schema.test.ts |   6 +-
 .../core/src/__tests__/store-merge-queue.test.ts   |   2 +-
 packages/core/src/__tests__/task-documents.test.ts |   2 +-
 packages/core/src/db.ts                            |   9 +-
 packages/core/src/index.ts                         |   1 +
 packages/core/src/mission-store.ts                 |  64 ++++--
 packages/core/src/mission-types.ts                 |   9 +
 packages/dashboard/app/api/legacy.ts               |  23 ++-
 .../dashboard/app/components/MissionManager.tsx    | 226 +++++++++++++++++++--
 .../dashboard/app/components/PlanningModeModal.tsx |   9 +-
 .../components/__tests__/MissionManager.test.tsx   | 100 +++++++++
 .../PlanningModeModal.planning-flow.test.tsx       |  91 +++++++++
 packages/dashboard/app/components/mission-types.ts |   4 +
 .../dashboard/src/__tests__/mission-e2e.test.ts    |  49 ++++-
 packages/dashboard/src/mission-routes.ts           |  41 +++-
 .../src/store/__tests__/roadmap-store.test.ts      |   4 +-
 25 files changed, 808 insertions(+), 76 deletions(-)

Fusion-Task-Id: FN-5675

Fusion-Task-Lineage: cfd13c13-9eff-4b82-90c3-88505d51bfb2
2026-05-29 15:25:47 -07:00
gsxdsm
1fb905afb7 feat(FN-5585): add planning branch controls to planning mode modal
Adds planning branch controls to the PlanningModeModal, extending the planning API and routes with supporting tests and documentation. The changeset bumps `@runfusion/fusion` as a minor release.

Fusion-Task-Id: FN-5585

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5585
2026-05-25 16:32:57 -07:00
Fusion (runfusion.ai)
0b7195699b feat(FN-5151): complete Step 2 — align PlanningModeModal caps
Fusion-Task-Id: FN-5151
Fusion-Task-Lineage: 17ebfc3f-6b6d-44a6-8243-7e8b8b140057
2026-05-19 10:39:56 -07:00
Fusion (runfusion.ai)
93c3975532 feat(FN-4769): show inline spinners in planning-mode modal during creation
Adds inline loading spinners to the planning mode task-creation modal, replacing any placeholder states during the creation flow, with a new planning-flow test covering the spinner behavior.

Fusion-Task-Id: FN-4769
2026-05-16 11:55:15 -07:00
Fusion (runfusion.ai)
ef5f7bbdfb feat(FN-4712): complete Step 4 — autosize planning chat textareas
Fusion-Task-Id: FN-4712
Fusion-Task-Lineage: 92ef2161-7ce2-4277-9921-7fe1dd204e98
2026-05-15 22:24:13 -07:00
Fusion
0de04afeeb feat(FN-4187): fix mobile swipe-back navigation into PlanningMode detail pa
Merged PlanningModeModal swipe-back and New Session handling: the feature commits wire key swipe-back gestures to control mobile detail-pane visibility and document the nav trigger rule, while the test commit adds coverage for New Session and mobile swipe-back regressions.

Fusion-Task-Id: FN-4187
2026-05-12 22:52:01 -07:00
Fusion
efdc6c4625 feat(FN-4139): add swipe-back navigation to chat, mission, and planning flo
Implements swipe-back gesture support for mobile navigation across ChatView, MissionManager, and PlanningModeModal, wired through a shared navigation history context and covered by a comprehensive test suite (~548 lines of swipe-back tests). A small fixup ensures swipe-back behaves correctly when la

Fusion-Task-Id: FN-4139
2026-05-12 17:04:33 -07:00
Fusion
ca0cb2b52e feat(FN-4076): tighten mobile agents header and popup, add compact planning
Merges FN-4076: tightens the mobile Agents header and aligns the controls popup on smaller screens, while also introducing compact planning breakdown task creation with preserved payload coverage — tests for scoped and empty-generated planning payloads were added alongside fixes to the legacy API an

Fusion-Task-Id: FN-4076
2026-05-12 07:47:10 -07:00
Fusion
c6d12ba5af feat(FN-3716): add planning mode priority controls for task routes and subt
Adds per-subtask priority controls to planning mode with three implementation steps (route priority support, UI controls, and design-token polish), gates research tools behind an experimental feature flag with a new core infrastructure module, and introduces a WhatsApp chat plugin with discovery and

Fusion-Task-Id: FN-3716
2026-05-07 16:03:25 -07:00
Fusion
1a79fa7110 feat(FN-3209): fix refine continuation flow in planning mode and add local
Merges fixes for the planning refine continuation flow (FN-3209) alongside a new local startup script for development environments. The changes include updates to `PlanningModeModal.tsx`, new and updated tests for the planning system, route handler improvements in `chat.ts` and `planning.ts`, and do

Fusion-Task-Id: FN-3209
2026-05-05 11:32:05 -07:00
gsxdsm
cee8adfb59 fix: planning modal full-screen height on mobile
Two related bugs left the Planning Mode modal stuck at partial height on
mobile. useModalResizePersist replayed desktop-saved pixel dimensions
that overrode the mobile 100dvh rule, and React reconciled removed CSS
custom properties to empty string rather than calling removeProperty(),
which on iOS Safari defeated the var() fallback after keyboard dismiss.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 07:44:56 -07:00
Fusion
cb3ab98e70 feat(FN-3447): add planning session rewind capability with modal back actio
This merge delivers four major features: a planning session rewind system (FN-3447, steps 1–4) with a new backend route for rolling back sessions, modal back-action wiring, and updated typing; workspace verification gates (FN-3385) for agent prompt editing; an agents view org chart spacing rework (F

Fusion-Task-Id: FN-3447
2026-05-04 21:21:22 -07:00
Fusion
f195245776 feat(FN-3419): remove inline lock indicator from PlanningModeModal
Removed the inline lock indicator from PlanningModeModal and added a new test file covering the planning flow behavior.

Fusion-Task-Id: FN-3419
2026-05-04 17:55:34 -07:00
Fusion
62dec8cf9d feat(FN-3237): fix mobile viewport teardown when closing planning mode
Merges FN-3237 to stabilize the mobile viewport teardown flow when closing the planning modal, ensuring the viewport state resets correctly. Adds test coverage for the mobile planning close path and includes a changeset for the patch release.

Fusion-Task-Id: FN-3237
2026-05-04 05:50:01 -07:00
gsxdsm
4bb3af220e fix(dashboard): mobile keyboard scroll lock, auto-reload hash, ChatView snap
- Add useMobileScrollLock hook using position:fixed body lock (Bootstrap/
  Headless UI/Stripe pattern) to prevent iOS Safari from shifting the
  document and visualViewport when an input inside a fixed-position modal
  is focused. Wire into 15 input-bearing modals plus ChatView, replacing
  ChatView's inline body-overflow effect.
- Widen computeBuildVersion in vite.config.ts to hash the entire app/ tree
  so the version-check poll actually notices rebuilds (FN-3333 follow-up;
  previously only main.tsx and package.json were hashed).
- ChatView: on input blur, suppress keyboard-aware sizing for 450ms while
  reserving mobile-nav-bar space, so the composer snaps to its final
  height in one move instead of crawling down with iOS's keyboard slide
  and then jumping again when the nav bar reappears.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 19:01:10 -07:00
Fusion
66b673b18f feat(FN-3337): recover chat isGenerating state on session reload and fix Pl
This merge includes three features: FN-3337 fixes mobile keyboard handling in the PlanningModeModal by wiring in `useMobileKeyboard` and adding keyboard-aware CSS sizing, with regression tests; FN-3336 recovers the `isGenerating` chat state on session reload to prevent UI flickering; and FN-3338 fix

Fusion-Task-Id: FN-3337
2026-05-03 17:10:03 -07:00
Fusion
d2e438a050 feat(FN-3274): preserve first-turn reasoning in planning modal
This merge introduces visibility of the AI's first-turn reasoning in the planning modal (FN-3274), with corresponding regression tests, and removes all PI (Prompt Intelligence) install references and documentation from the codebase (FN-3309).

Fusion-Task-Id: FN-3274
2026-05-03 13:37:03 -07:00
Fusion
fbd2ed0c5f feat(FN-3269): add mobile empty-session auto-routing to Planning Mode compo
Merges mobile Planning Mode empty-state auto-routing to the composer (Step 2 of FN-3269) alongside wired Insights create-task integration with real task creation (FN-3265), with corresponding tests and documentation updates.

Fusion-Task-Id: FN-3269
2026-05-03 10:31:21 -07:00
Fusion
4694cebf43 feat(FN-3268): add planning disclosure UX for Step 2-3 in modal
The merge completes UX updates for the planning disclosure flow (steps 2–3) in the PlanningModeModal, including CSS enhancements and test coverage for the new behavior.

Fusion-Task-Id: FN-3268
2026-05-03 08:22:27 -07:00
Fusion
05f852458d feat(FN-3120): show resolved planning model in planning modal
Adds a resolved planning model display to the planning modal by introducing a new `/api/models/resolve` endpoint, wiring it through the legacy API, and updating the modal to show the final resolved model alongside its source (FN-3120).

Fusion-Task-Id: FN-3120
2026-05-03 06:17:30 -07:00
Fusion
ae29709c95 feat(FN-3222): add advanced planning disclosure layout, styling, and contro
This merge lands v0.16.0 with several major features: an advanced planning mode modal redesign with collapsible disclosure controls (FN-3222), a durable insight lifecycle system using bounded run executors with quick recovery (FN-3243/FN-3013), and per-project SQLite connection caching for AgentStor

Fusion-Task-Id: FN-3222
2026-05-03 03:18:49 -07:00
gsxdsm
8c808ac8b5 feat(dashboard): collapse planning model + depth into advanced disclosure
Group the planning model selector and depth controls under a collapsible
"Advanced planning settings" disclosure (defaultOpen) in the Planning Mode
modal. Adds a defaultOpen prop to OnboardingDisclosure and tightens the
node.capabilities readonly typing in NodeDetailModal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 01:29:30 -07:00
gsxdsm
98d2e1d795 fix(dashboard): show summarized draft title in sidebar and dedup start-path summarize
Closes the loop on the blur/close summarize work. Previously the sidebar
always rendered `session.preview` for drafts, so the model call fired by
blur/close updated `session.title` to a value the user never saw, and
then `startExistingSession` summarized again on Start Planning even when
blur had already produced a title for the exact same text.

The sidebar now shows the summarized title once available and falls
back to the inputPayload preview only while the title is still the
placeholder. summarizeDraftTitle persists the plan text it summarized
from via a new `markDraftSummarized` store method, and updateDraft
preserves that marker only while the persisted text still matches it
(text edits invalidate it automatically). startExistingSession reads
the marker and skips its own summarize when the persisted plan equals
what was summarized last, eliminating the redundant model call.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:24:31 -07:00
gsxdsm
abe032a5a5 fix(dashboard): plumb planning draft text + model selection end-to-end
The planning modal's draft sync only updated SQLite, never the in-memory
session, so Start Planning ran the agent against whatever fragment was
typed before the first 500ms debounce and silently dropped everything
after. Drafts that survived a backend restart couldn't be started at
all (lazy rebuild was missing for the start path), reopened drafts left
the textarea empty, and the model override the user picked at create
time was forgotten on reopen — Start Planning would silently use the
project default instead.

This change rehydrates initialPlan from SQLite in startExistingSession,
flushes the latest text from the request body before reading it back,
lazy-rebuilds the in-memory session from the persisted row when needed,
and round-trips the model override through inputPayload so reopen
restores it into modal state. Sidebar drafts now render a derived
preview (from inputPayload, never persisted as title) so multiple
drafts are distinguishable while editing, and summarizeDraftTitle fires
on textarea blur and modal close — gated on status rather than title
content so blur-then-edit still refreshes rather than locking to the
first snapshot.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-03 00:05:28 -07:00
Fusion
2ff8fd1af8 feat(FN-3225): remove blocking code from PlanningModeModal to restore CI
Removed 13 lines from PlanningModeModal.tsx to restore passing lint, test, and build verification for FN-3225.

Fusion-Task-Id: FN-3225
2026-05-02 21:05:46 -07:00
Fusion
23fc5a0fc4 feat(FN-3229): add async planning draft sync to avoid blocking while typing
Merged two changes: a new feature (FN-3229) that syncs planning drafts to the server in real-time while the user types, adding a PlanningModeModal component, a new ai-session-store for managing session state, and a dashboard API route to persist drafts; plus a performance fix replacing a blocking `e

Fusion-Task-Id: FN-3229
2026-05-02 19:26:10 -07:00
gsxdsm
9fb1950e99 fix(dashboard): preserve literal types when adding draft to planning sessions
Inline object passed to setPlanningSessions widened type/status to string,
breaking AiSessionSummary's literal union. Hoist the draft into a typed
variable so the literals narrow correctly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 15:55:01 -07:00
Fusion
ffb71b7912 feat(FN-3105): add planning depth selection to planning flows
- Add planning depth controls and styling in PlanningModeModal with updated modal reentry behavior
- Thread selected depth through legacy frontend API calls and planning route handlers
- Extend planning prompt builder/runtime wiring to honor depth values for subtask planning
- Add route, planning, and modal tests covering depth selector behavior and validation

Fusion-Task-Id: FN-3105
2026-05-02 11:09:14 -07:00
Fusion
9b4ccb8812 feat(FN-3172): finalize planning CTA defaults in summary view
- Swap summary action emphasis so "Break into Tasks" is the primary CTA and "Create Single Task" is secondary
- Update loading labels and button copy to match the revised action mapping
- Adjust PlanningModeModal tests to assert new labels, button styling roles, and click targets
- Stabilize onboarding test setup by making global settings mock responses reusable across calls

Fusion-Task-Id: FN-3172
2026-05-02 01:23:54 -07:00
Fusion
d227c6416b feat(FN-3139): add planning comment input to interview modals and show in c
Merges FN-3139 planning comment infrastructure (comment inputs in mission/milestone-slice/planning modals, comment display in conversation history), FN-3119 Quick Chat FAB with slash-triggered skill menu and plugin integration, FN-3117 plugin dashboard views and chat session icons, and FN-3066 plugi

Fusion-Task-Id: FN-3139
2026-05-02 00:37:57 -07:00
Fusion
bdfbcb3039 feat(FN-3078): merge fusion/fn-3078
This merge lands four features: a `/clear` command for Chat and Quick Chat with session banner fixes (FN-3062), a todo view redesign with restructured rows and improved styling (FN-3063), deterministic peer exchange shutdown with dashboard improvements (FN-3040), and a summary Q&A disclosure feature

Fusion-Task-Id: FN-3078
2026-05-01 13:40:21 -07:00
gsxdsm
139b552036 fix: persist session banner dismissals and add hide-banner setting
- Stop overwriting AI session titles with the "Planning session" fallback
  during cross-tab broadcasts before initialPlan has hydrated on resume.
- Persist SessionNotificationBanner dismissals to localStorage keyed by
  updatedAt so they survive refresh and auto-re-show on the next event.
- Add Settings → Appearance toggle to hide the banner entirely.
- Drop the inner scrollbar on the planning question list; let the outer
  pane handle all scrolling.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 13:08:07 -07:00
Fusion
0313ddb72c fix(FN-2983): remove stale hooks lint suppression
- Remove obsolete react-hooks eslint-disable directive in PlanningModeModal
- Keep hook linting active so dependency regressions are surfaced
2026-05-01 12:16:37 -07:00
gsxdsm
7c6b8a6ad1 fix(dashboard): planning mode question display + new-session reset
- Add 8s polling fallback while view is "loading" so a missed SSE
  question/summary event self-heals instead of leaving the panel stuck
  on "thinking" until close+reopen.
- Track dismissed resumeSessionIds in a ref and drop loadSession from
  the resume effect's deps so typing into the textarea no longer
  re-fires resume and yanks the user back to the previous session.
- Guard SSE onThinking/onQuestion/onSummary against late events from a
  torn-down connection by comparing the captured sessionId against
  currentSessionIdRef.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 11:40:48 -07:00
gsxdsm
99df5504ac chore(dashboard): demote planning archive toggle to footer link
Move the show/hide archived control out of the sidebar header (where it
competed visually with the New Session button) into a small muted link
in a new sidebar footer below the list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 11:21:25 -07:00
gsxdsm
99493481f9 fix(dashboard): return authoritative archived state and cover ai-session archive
Archive/unarchive routes were returning the row-update boolean rather than
the actual archived flag, so a no-op unarchive replied with `archived: true`.
Re-read the row and report its current state instead. Also adds tests for
archive (terminal-only), unarchive event emission, and listAll filtering.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 10:57:53 -07:00
gsxdsm
50d965b206 feat(dashboard,core): show completed planning sessions and add archive
Planning sidebar's `/api/ai-sessions` listing filtered out `complete`
rows, so a session that finished while the modal was closed disappeared
on refresh even though the result was still in SQLite. Add
`?includeCompleted` / `?includeArchived` flags and a new `archived`
column (migration 57) so users can hide terminal sessions on demand
without deleting them; only `complete`/`error` rows are archivable so
live agents can't be orphaned.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 10:36:39 -07:00
Fusion
25ffd1ae84 fix(FN-2861): harden planning session recovery and retry UX
- Add planning and subtask retry routes with session-lock checks and proper API error mapping
- Improve planning session execution with timeout/abort handling, stop-generation support, and resilient stream catch-up behavior
- Update Planning Mode modal to handle reconnects, retry-from-error flow, stop action, and cross-tab session state synchronization
- Expand dashboard tests for planning routes, planning session behavior, and PlanningModeModal retry/error coverage
2026-04-28 14:25:55 -07:00
gsxdsm
8a88e23b9c feat(dashboard): UI polish pass — resizable modals, themed scrollbars, settings overhaul
Modal resize + size persistence
- Extract `useModalResizePersist` hook (ResizeObserver + localStorage),
  apply to Files, Git Manager, GitHub Import, Workflow Steps, Automations
  (ScheduledTasks), and Settings modals. Each gets `resize: both`, sane
  min/max constraints, and a unique storage key.
- Bump default heights so the modals feel less cramped (Git: 92vh,
  Workflow/Automation: 80vh, Settings: 80vh / 1100px).

Scrollbar theme
- Add a global `*::-webkit-scrollbar*` + `scrollbar-color` rule in
  styles.css so chat, document, system stats, file browser, usage
  indicator, etc. inherit the theme. Existing per-component overrides
  (.board, .column-body, .settings-sidebar, planning modal) still win.

Document view
- Collapse "Show hidden" toggle and search input onto the same row as
  the Project Files / Task Documents segmented control. Stack again
  below 768px.

Mailbox / Todos
- Match Todos header treatment to the Mailbox header (typography,
  padding, border).
- Add top spacing above Mailbox Inbox/Outbox/Agents tab bar so the
  vertical gaps balance.

Settings
- Wider, resizable, persisted Settings modal.
- Project Models description and Authentication panel get proper
  horizontal padding.
- Reorder project sidebar so "General" is first.
- Plugins page: clean margins, integrate refresh button, exclude
  bundled runtimes from the "Installed Plugins" list (they were
  appearing twice — once erroring, once in their own section).
- New "Updates" panel with auto-check toggle + "Check now" button
  (frequency control noted as needing a backend schema field).

Background sessions
- Fix stale "AI N" / planning-icon badge: `handleDeleted` in
  `useBackgroundSessions` now writes a tombstone, advances the
  timestamp guard, and broadcasts completion so the cross-tab
  sync store stops resurrecting the deleted session on the next
  merge tick. Added regression test.
- Re-fetch list on SSE reconnect so terminal events fired during a
  network blip don't get permanently lost.

System stats
- Refresh button uses correct single class (was getting both `btn`
  and `btn-icon`, which conflicted on padding/border).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 17:26:07 -07:00
gsxdsm
d73f227cc6 feat(dashboard): redesign Planning modal as two-pane session manager
- Sidebar lists all planning sessions for the project (any status) with
  inline status badges, relative timestamps, "+ New session", and an
  inline delete confirm. Mobile collapses to a single pane with a back
  chevron in the header.
- Closing the modal (X / Escape / overlay) no longer cancels the server
  session — it stays in the list, resumable. Only an explicit Delete
  cancels + removes. Removes the now-redundant minimize button.
- Add re-sync on reopen so a session whose terminal SSE event was missed
  doesn't stay stuck on a stale loading view; previously only a hard
  reload recovered.
- Persist user-chosen modal width/height across opens via localStorage,
  driven by a ResizeObserver on the modal element.
- Theme the modal scrollbars to match the rest of the app.
- Banner dismiss only hides the banner now — it must not delete the
  underlying session, since sessions are first-class in the new sidebar.
- Refresh background sessions list on SSE reconnect so the footer "AI N"
  pill never gets stuck on tombstoned sessions after a network blip.
- Drop selection + broadcast completion on Create Task / Create Tasks
  so the footer count drops in lockstep instead of waiting on SSE.
- Auto-scroll the AI thinking output as new tokens stream in (only when
  already pinned to the tail).
- Guard overlay-click dismissal with a mousedown-on-overlay check so
  releasing a resize drag outside the modal doesn't close it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 16:58:35 -07:00
Fusion
9eef425525 fix(dashboard): card timer shows total execution = timed events + workflow runtime
The task card timer chip previously fell back through several metrics
(timed duration → workflow runtime → wallclock), so cards showed only a
subset of execution time. For FN-2714 this rendered <1m on the card while
the stats tab reported >2m of workflow runtime.

The chip now reports the sum of [timing]-tagged log events and workflow
step runtime (matching the new "Total execution time" metric in the stats
panel), with live elapsed for in-progress workflow steps. When neither
metric is recorded, the chip is hidden rather than falling back to
wallclock.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 16:05:50 -07:00
gsxdsm
7cff0eb11c fix(dashboard): stop the planning textarea from reverting to the persisted description on every keystroke
The "restore description from localStorage" branch ran inside an effect
whose deps included handleStartPlanning, and that callback regenerated on
every change to initialPlan. So every keystroke would re-fire the effect,
hit the same `getPlanningDescription` value, and overwrite what the user
just typed.

Guard the restore with a one-shot ref so it only runs the first time the
modal opens, and reset the ref when the modal closes so a future re-open
still picks up an updated persisted value.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 11:01:36 -07:00
gsxdsm
30cadb1345 fix(dashboard): show planning thinking output and silently recover from stream errors
Two related planning-mode issues:

1. The streaming "thinking" panel only showed for models that emit explicit
   thinking_delta events (e.g. Anthropic Extended Thinking). For every other
   model the user saw a spinner with no streaming content because text_delta
   was being accumulated server-side without being broadcast over SSE. Now
   onText also forwards deltas through the same stream channel so any model
   surfaces its in-flight output.

2. Returning to the planning screen after the browser tab was backgrounded
   long enough for the SSE socket to time out would land the user in a
   permanent error view ("Session failed while contacting the AI") even
   though the server session was still alive. The onError handler now first
   re-fetches the AI session row; if the server still reports the session as
   generating or awaiting_input it silently reconnects without surfacing the
   transient error. Only genuine server-side failures still surface.

Tests for the obsolete manual-retry recovery path were rewritten as
auto-recovery assertions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 10:50:54 -07:00
gsxdsm
c3d1716fdd refactor(dashboard): split monolithic styles.css into per-component files
Split app/styles.css from ~40k lines down to ~4.5k. Created 56 co-located
component CSS files in app/components/, each imported by its owning .tsx.
The remainder of styles.css holds genuinely global rules (design tokens,
.btn/.card/.modal/.form-input primitives, cross-component @media overrides).

- Lazy-load 13 heavy views (AgentsView, RoadmapsView, NodesView, etc.) via
  React.lazy + Suspense; prefetch all chunks on idle so first navigation is
  instant. Initial JS bundle: 1.58 MB → 1.16 MB (-26%). Initial CSS bundle:
  635 kB → 471 kB (-26%); the rest splits into 13 per-view chunks.

- Add app/test/cssFixture.ts exposing loadAllAppCss() + loadAllAppCssBaseOnly()
  so CSS regression tests load the full per-component bundle (mirroring Vite
  source order). Migrate 30+ tests off direct readFileSync('../styles.css').

- Enable test.css: { include: [/.+/] } in vitest.config.ts so component CSS
  imports actually inject styles in jsdom (fixes getComputedStyle assertions).

- Add ESLint rule (no-restricted-syntax) banning direct styles.css reads in
  dashboard test files; points at loadAllAppCss() instead.

- Restore lost utility classes (.text-muted, .text-secondary, .text-dim,
  .form-input) and rescue dropped chat tool-call rules into QuickChatFAB.css.

- Mobile fixes along the way: scroll containment for view containers
  (min-height:0 + -webkit-overflow-scrolling), QuickChatFAB full-screen on
  mobile (with safe-area-inset for iOS home bar), AgentsView single-row
  header layout, ActivityLogModal close button on right, model-combobox
  z-index above the mobile quick-chat panel.

- Bug fix: SkillsView toggle was display:none which hid the input from the
  accessibility tree; replaced with the visually-hidden pattern so screen
  readers + getByRole still find the checkbox.

- Bug fix: standalone Delete button in TaskDetailModal for triage-column
  tasks (Actions dropdown is hidden in triage state, so previously no way
  to delete a freshly-created task without status change first).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 19:39:20 -07:00
gsxdsm
3fbb7c47cf refactor: eliminate ~400 no-explicit-any warnings across the workspace
Parallel subagent pass: four typescript-pro agents on non-overlapping scopes.

Patterns applied:
- catch (err: any) { ... err.message ... } → catch (err) { ... getErrorMessage(err) ... }
  using the new @fusion/core helper. Bare catch {} where the error was unused.
- SQLite row types: defined typed XxxRow interfaces per table and cast
  .all()/.get() results via `as unknown as XxxRow[]` (the double cast is
  required because better-sqlite3 returns Record<string, SQLOutputValue>).
- rowToX(row: any) converters: typed argument with the matching row interface.
- Dynamic settings key writes: (settings as Record<string, unknown>)[key].
- React event handlers and setState callbacks: inferred types or concrete
  React.{Mouse,Change,Form}Event<...> where needed.
- pi-claude-cli: local PiMessage / PiContext duck types to avoid re-typing
  pi-ai concrete shapes; typed Claude stream event message fields.

72 files changed, ~400 anys eliminated. Typecheck passes across the workspace.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:36 -07:00
Fusion
595b5cab5f fix(FN-2176): honor planning summary overrides for task generation
- Add optional summary payload support to planning create-task and start-breakdown API client calls
- Pass edited summary data from PlanningModeModal when creating a task or starting breakdown
- Parse and validate summary overrides in planning routes and prioritize override data when present
- Add and update dashboard tests to verify override handling and modal call expectations
2026-04-20 09:32:04 -07:00
Fusion
8cfd6abbb9 fix(FN-2151): recover modal retries after stream disconnects
- Handle retry API "not in an error state" responses by refreshing the server session instead of failing immediately
- Restore the correct view state for generating, awaiting_input, complete, and error sessions during retry recovery
- Reconnect planning/interview/subtask streams only when needed while preserving in-flight output and history
- Add regression tests for connection-loss retry recovery across PlanningModeModal, MissionInterviewModal, and SubtaskBreakdownModal
2026-04-19 20:48:13 -07:00
Fusion
f33f15a98f style(FN-1847): unify dialog overlay styling and add accessibility attributes
- Add role=dialog and aria-modal attributes to all modal dialogs for accessibility
- Standardize close button aria-labels across all modals
- Unify overlay backdrop-filter, z-index, and background styles in styles.css
- Add light theme overrides for non-standard overlay backgrounds
- Update AgentListModal tests to reflect new aria attributes
- Add changeset for @gsxdsm/fusion package
2026-04-15 20:44:40 -07:00