Commit Graph

383 Commits

Author SHA1 Message Date
gsxdsm
b6243d68fe FN-6197: suppress tab-resume fetch errors in dashboard
Keep cached dashboard data visible while reconnecting after transient tab-resume fetch failures.

- detect likely tab suspension and visibility-resume fetch errors across dashboard data hooks
- suppress transient "Failed to fetch" errors when cached project and node data already exist
- show a "Connecting…" executor status state instead of surfacing raw resume-time fetch errors
- add dashboard tests covering visibility suspension handling and executor reconnect rendering
- add a patch changeset for the published CLI package

Files changed:
 .changeset/tame-tab-resume-fetch.md                |   5 +
 packages/dashboard/app/App.tsx                     |  16 ++-
 .../dashboard/app/components/ExecutorStatusBar.css |  19 ++-
 .../dashboard/app/components/ExecutorStatusBar.tsx |  12 ++
 .../__tests__/ExecutorStatusBar.test.tsx           |  20 ++-
 .../dashboard/app/hooks/__tests__/useNodes.test.ts | 149 ++++++++++++++++++++-
 .../app/hooks/__tests__/useProjects.test.ts        |  72 +++++++++-
 .../hooks/__tests__/visibilitySuspension.test.ts   |  13 ++
 packages/dashboard/app/hooks/useExecutorStats.ts   |  15 ++-
 .../dashboard/app/hooks/useManagedDockerNodes.ts   |  25 +++-
 packages/dashboard/app/hooks/useMeshState.ts       |  25 +++-
 packages/dashboard/app/hooks/useNodes.ts           |  25 +++-
 packages/dashboard/app/hooks/useProjectHealth.ts   |  18 ++-
 packages/dashboard/app/hooks/useProjects.ts        |  27 +++-
 packages/dashboard/app/hooks/useUsageData.ts       |  24 +++-
 .../dashboard/app/hooks/visibilitySuspension.ts    |   4 +
 16 files changed, 435 insertions(+), 34 deletions(-)

Fusion-Task-Id: FN-6197

Fusion-Task-Lineage: 834f56d8-8391-414f-8cbd-7e626c5724d0
2026-06-10 09:21:48 -07:00
gsxdsm
3f6e1c6e40 FN-6169: open script commands in a new terminal tab
Open fresh tabs for follow-up script launches instead of reusing the current terminal.

- track whether an initial command arrived with modal open versus after the terminal was already active
- create a new terminal tab for later script commands, wait for that tab to become active, then send the command there
- expand TerminalModal coverage for first-open versus follow-up script execution and clarify modal-manager script handoff expectations

Files changed:
 packages/dashboard/app/components/TerminalModal.tsx     |  80 ++++++++++-
 .../components/__tests__/TerminalModal.test.tsx    | 150 ++++++++++++++++++---
 .../app/hooks/__tests__/useModalManager.test.ts    |   4 +-
 3 files changed, 207 insertions(+), 27 deletions(-)

Fusion-Task-Id: FN-6169

Fusion-Task-Lineage: a7e57a9b-dc3a-432f-bff1-195b62555852
2026-06-09 23:03:51 -07:00
gsxdsm
7960789d37 FN-6167: fix stale mobile modal navigation history
Keep modal history entries in sync so mobile swipe-back reliably closes reopened task detail views.

- add removeNav support to navigation history and ignore self-triggered popstate callbacks
- route modal and overlay programmatic close handlers through navigation-aware wrappers
- add regression coverage for close-and-reopen mobile detail flows and document the stale stack bug

Files changed:
 .../navigation-history-stale-modal-stack.md        |  85 +++++++++++++
 packages/dashboard/app/App.tsx                     |  35 ++++--
 packages/dashboard/app/components/AppModals.tsx    | 137 +++++++++++++++++----
 .../app/components/__tests__/AppModals.test.tsx    |   5 +-
 .../__tests__/navigation-history.test.tsx          | 113 ++++++++++++++++-
 .../hooks/__tests__/useNavigationHistory.test.ts   |  98 +++++++++++++++
 .../dashboard/app/hooks/useNavigationHistory.ts    |  55 ++++++++-
 7 files changed, 494 insertions(+), 34 deletions(-)

Fusion-Task-Id: FN-6167

Fusion-Task-Lineage: 086d60ba-7e3d-4e83-b9b4-37ec49b06393
2026-06-09 22:44:30 -07:00
gsxdsm
5c7b3a0e5e FN-6116: clear terminal event buffers after subscriber delivery
Prevent stale terminal connection metadata from replaying after it has already been delivered.

- only retain scrollback and connected payloads when no listeners are registered yet
- clear buffered terminal events after live subscribers receive them
- add regression coverage for scrollback and connected replay behavior

Files changed:
 .../app/hooks/__tests__/useTerminal.test.ts        | 50 ++++++++++++++++++++++
 packages/dashboard/app/hooks/useTerminal.ts        | 23 ++++++----
 2 files changed, 65 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-6116

Fusion-Task-Lineage: 5876fe24-2e90-4ef1-9e8b-5abce40555b4
2026-06-09 12:57:21 -07:00
gsxdsm
c285c30c19 FN-6076: align dashboard tests with updated labels and mocks
Update dashboard tests to match current project copy and test doubles.

- rename project selector expectations from 'Select Project'/'View All Projects' to 'Projects'/'Manage Projects'
- update mailbox split-handle CSS assertion for the new color-mix background
- simplify SessionTerminal xterm addon mocks and type the mocked AbortController signal in useDocuments tests

Files changed:
 .../app/components/__tests__/Header.test.tsx        |  8 ++++----
 .../app/components/__tests__/MailboxView.test.tsx   |  2 +-
 .../components/__tests__/MultiProjectFlow.test.tsx  |  2 +-
 .../__tests__/SessionTerminal.mobile.test.tsx       | 21 ++++-----------------
 .../app/hooks/__tests__/useDocuments.test.ts        |  4 ++--
 5 files changed, 12 insertions(+), 25 deletions(-)

Fusion-Task-Id: FN-6076

Fusion-Task-Lineage: 9bd7bd36-75c0-4d88-93b4-53bfb75283fa
2026-06-09 07:24:39 -07:00
gsxdsm
9417c81498 FN-6078: fix dashboard tests to use constructable mocks
Update dashboard tests to mirror constructor-based browser APIs and xterm addons.

- rewrite SessionTerminal mobile test doubles as constructable function mocks so xterm and addon instances initialize like real classes
- replace the useDocuments AbortController stub with a class-based mock to preserve constructor semantics during fetch cancellation tests

Files changed:
 .../__tests__/SessionTerminal.mobile.test.tsx       | 21 +++++++++++++++++----
 .../app/hooks/__tests__/useDocuments.test.ts        |  8 ++++----
 2 files changed, 21 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-6078

Fusion-Task-Lineage: d8e0a9aa-6c7c-44c1-b9d4-5196924531c1
2026-06-09 07:09:17 -07:00
gsxdsm
a566f498d8 FN-6047: fix mobile-to-tablet viewport reflow
Keep dashboard mobile/tablet viewport transitions from blanking or leaving stale mobile chrome.

- update viewport-mode detection to resync on resize, orientation changes, and visualViewport resize events
- stabilize board scroll handling across mobile viewport changes without forcing tablet layouts back to the mobile scroll position
- expand dashboard regression coverage for mobile/tablet/desktop auto-merge toggles, app-shell reflow, and viewport listener wiring

Files changed:
 packages/dashboard/app/components/Board.tsx        |  33 ++++-
 .../app/components/__tests__/ChatView.test.tsx     |   4 +-
 ...-merge-toggle-blank.mobile-integration.test.tsx | 145 ++++++++++++++++++---
 .../app/hooks/__tests__/useViewportMode.test.ts    | 126 +++++++++++++++++-
 packages/dashboard/app/hooks/useViewportMode.ts    |  21 ++-
 5 files changed, 295 insertions(+), 34 deletions(-)

Fusion-Task-Id: FN-6047

Fusion-Task-Lineage: 5d5dcedf-6265-4672-b63e-414f3339e417
2026-06-09 02:00:29 -07:00
gsxdsm
53f3638b12 FN-6037: open selected workflow editor on mobile
Open the board workflow editor directly to the selected workflow, including on mobile.

- pass the selected workflow id from the board toolbar through app modal state into the workflow editor
- preselect the requested workflow when loading workflows, while preserving settings/create entry points and mobile fallback behavior
- cover the new workflow targeting behavior in board, modal manager, and workflow editor tests and document the mobile editor flow

Files changed:
 docs/dashboard-guide.md                            |  3 +-
 packages/dashboard/app/App.tsx                     |  4 +-
 packages/dashboard/app/components/AppModals.tsx    |  1 +
 packages/dashboard/app/components/Board.tsx        |  6 +-
 packages/dashboard/app/components/WorkflowNodeEditor.tsx          | 13 ++++-
 packages/dashboard/app/components/__tests__/Board.test.tsx        |  4 ++
 packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx | 68 ++++++++++++++++++++++
 packages/dashboard/app/hooks/__tests__/useModalManager.test.ts    | 42 +++++++++++++
 packages/dashboard/app/hooks/useModalManager.ts    | 16 +++--

Fusion-Task-Id: FN-6037

Fusion-Task-Lineage: e983e699-5376-434f-af03-39ce5a300029
2026-06-09 00:27:51 -07:00
gsxdsm
6c129dafce FN-6040: show loading indicators for task detail activity and agent logs
Add first-load loading states so task activity and agent log views do not flash empty states.

- show a loading status row in the task detail Activity tab while detail history is still loading
- keep agent logs in a loading state until the active task/project context has completed its initial fetch
- add accessible loading markup, regression tests, and dashboard guide documentation for the new behavior

Files changed:
 docs/dashboard-guide.md                            |   1 +
 .../dashboard/app/components/AgentLogViewer.css    |  18 +++
 .../dashboard/app/components/AgentLogViewer.tsx    |   2 +-
 .../dashboard/app/components/TaskDetailModal.css   |  17 +++
 .../dashboard/app/components/TaskDetailModal.tsx   |   7 +-
 .../components/__tests__/AgentLogViewer.test.tsx   |   3 +-
 .../components/__tests__/TaskDetailModal.test.tsx  | 144 +++++++++++++++++++++
 .../app/hooks/__tests__/useAgentLogs.test.ts       |  74 +++++++++++
 packages/dashboard/app/hooks/useAgentLogs.ts       |  14 +-
 9 files changed, 276 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-6040

Fusion-Task-Lineage: cd4b8f7f-63cd-4d75-be00-d362e915f4e8
2026-06-08 13:32:58 -07:00
gsxdsm
340b2efa39 Merge pull request #1467 from buihongduc132/upstream-pr/project-selector-enhancements
feat(dashboard): scrollable, autocomplete, bookmarkable project selector
2026-06-07 23:18:30 -07:00
gsxdsm
fa23782dbb FN-5972: fix mobile auto-merge blank dashboard
Restore mobile auto-merge dashboard stability and broaden regression coverage.

- share the mobile media query between viewport detection and board stabilization so landscape phones stay on the mobile path
- add an integration regression suite for toggling auto-merge across mobile, tablet, desktop, rollback, and task review surfaces
- expand dashboard and CLI tests, keep the new published changeset, and preserve related vitest coverage lists and safety comments

Files changed:
$(git diff --cached --stat)

Fusion-Task-Id: FN-5972

Fusion-Task-Lineage: f3a3bbae-21c2-451b-b24f-848cc12d0542
2026-06-07 18:51:46 -07:00
buihongduc132
cb455bf757 feat(dashboard): scrollable, autocomplete, bookmarkable project selector
- Fix: ProjectSelector dropdown now scrolls (max-height + overflow-y)
  when project list exceeds visible area, with scrollIntoView on
  keyboard navigation
- Feat: Always-visible search input with type-ahead filtering,
  HighlightMatch text highlighting, exact match detection + auto-select
  on Enter
- Feat: Project bookmarking via localStorage (useProjectBookmarks hook),
  star toggle on each item, bookmarked section shown at top of dropdown
- Refactor: Header.tsx now imports standalone ProjectSelector instead
  of using an inline copy that lacked these features
- Tests: 131 tests passing across ProjectSelector + useProjectBookmarks
2026-06-07 02:26:00 +07:00
gsxdsm
962b97ce84 FN-5967: add first-task GitHub star prompt
Show a one-time GitHub star prompt after a task first reaches done.

- detect task status transitions into done and trigger the prompt only in project view
- add a dismissible GitHub star prompt component plus localStorage-backed persistence hook
- cover the new prompt behavior with component, hook, and transition helper tests
- document the prompt behavior and styling guidance in the dashboard guide

Files changed:
 docs/dashboard-guide.md                            |  3 +
 packages/dashboard/app/App.tsx                     | 21 +++++-
 .../dashboard/app/components/GitHubStarPrompt.css  | 76 ++++++++++++++++++++++
 .../dashboard/app/components/GitHubStarPrompt.tsx  | 53 +++++++++++++++
 .../app/components/__tests__/App.test.tsx          | 12 +++-
 .../components/__tests__/GitHubStarPrompt.test.tsx | 40 ++++++++++++
 .../hooks/__tests__/useGitHubStarPrompt.test.ts    | 64 ++++++++++++++++++
 .../dashboard/app/hooks/useGitHubStarPrompt.ts     | 46 +++++++++++++
 8 files changed, 313 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-5967

Fusion-Task-Lineage: 5fffdf4d-61d8-4ac8-bcf4-8b453b639b28
2026-06-03 22:35:28 -07:00
gsxdsm
dfef5dadbd merge main: branch-group promote/abandon gating + compound-engineering plugin; re-applied i18n t() wrapping to main's restructured promote sections 2026-06-03 20:56:05 -07:00
gsxdsm
9239e52d4b Update packages/dashboard/app/hooks/__tests__/useChat.test.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-06-03 20:34:39 -07:00
gsxdsm
47bd46e6a3 fix: address PR review feedback (#1387)
- gate Quick Chat's session-activation auto-flush to the pre-session
  queue only, so a restored queue cannot be sent before the restore
  effect's authoritative fetchChatSession check resolves (real flaw —
  the original test passed only because the mocked fetch resolved in a
  microtask and beat the effect)
- add slow-fetch regression tests in both hooks proving the restored
  queue stays un-flushed while server validation is pending
- assert attachChatStream ran before triggering its onDone in the
  quick-chat regression test
- drop redundant Promise.resolve() wrapper around fetchChatSession in
  useQuickChat's restore effect

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 20:21:06 -07:00
gsxdsm
684baa0eb7 fix(FN-5852): confirm server generation state before flushing queued chat messages
Re-entering a chat flushed the restored queued message based on the
client's stale isGenerating flag (a route-level enrichment the
chat:session:updated SSE payload lacks), firing a send that aborted the
live generation server-side and could lose the message entirely. The
restore path in useChat and useQuickChat now asks the server first:
attach and defer the flush while generating, send immediately only when
no generation is in flight, and keep the bubble on a failed check.

Fixes Runfusion/Fusion#1279

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 19:54:02 -07:00
gsxdsm
e703bdd608 feat(i18n): add Korean locale + localized READMEs with language switcher
- ko added to SUPPORTED_LOCALES and every enumeration site (config,
  settings enum, help text, tests); Korean catalogs authored for all
  current keys; CLI bundles regenerated for 6 locales; 한국어 endonym
- README translated into zh-CN, zh-TW, fr, es, ko; every README carries
  a language-switcher line and the localized ones note that English is
  canonical

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 17:33:16 -07:00
gsxdsm
f48602500f merge main: i18n branch + auto-merge override/log-retention work; union CONCEPTS.md vocabularies and docs/solutions reference line 2026-06-03 13:32:26 -07:00
gsxdsm
419f688afb FN-5936: fix auto-merge board stabilization on mobile
Keep the dashboard board visible when auto-merge toggles across viewport changes.

- keep board stabilization subscribed to visualViewport resize events instead of removing the listener after the first resize
- add regression coverage for Android, iOS, tablet, desktop, empty-column, rollback, and error-boundary auto-merge toggle paths
- relax settings hydration assertions and expand app-settings tests for auto-merge rollback and coercion behavior

Files changed:
 .changeset/fn-5936-auto-merge-mobile-fix.md        |   7 +
 packages/dashboard/app/components/Board.tsx        |  19 +-
 packages/dashboard/app/components/__tests__/App.test.tsx          |   8 +-
 packages/dashboard/app/components/__tests__/auto-merge-toggle-blank.mobile.test.tsx        | 418 +++++++++++++++++++++
 packages/dashboard/app/hooks/__tests__/useAppSettings.test.ts     |  53 ++-
 5 files changed, 489 insertions(+), 16 deletions(-)

Fusion-Task-Id: FN-5936

Fusion-Task-Lineage: 6e937d0e-dc60-4863-a884-001228dd0cd1
2026-06-03 13:20:17 -07:00
gsxdsm
e08a5633fa feat(i18n): language reset-to-auto-detect + review nitpicks (#1352)
Resolves the remaining review threads:

- Reset to auto-detect across all three layers (Greptile): store passes
  language:null through as null-as-delete; dashboard gains an Auto option
  (clearLanguage + hasExplicitChoice in useLanguage, re-detects from
  navigator, syncs cross-tab); CLI accepts 'fn settings set language auto'.
  Catalog keys added for all five locales; tests at every layer.
- CLI i18n test singleton: afterEach locale restore so zh-CN/fr switches
  can't leak across cases (CodeRabbit nitpick)
- useLocaleFormat memoized per locale for stable formatter identities
  (CodeRabbit nitpick)
- settings-reference.md documents the auto reset path

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 13:02:23 -07:00
gsxdsm
4f6013ff3a test+refactor(i18n): close code-review residuals
- Extract a shared normalizeToSupportedLocale helper in @fusion/i18n used by
  both the CLI env detection and the dashboard navigator detection
  (convertDetectedLanguage), fixing multi-subtag navigator tags (zh-Hans-CN)
  and unifying Chinese script resolution.
- Add a cross-tab storage listener to useLanguage so a language change in one
  tab propagates to others.
- Dedup the namespace lists into packages/i18n/namespaces.json, consumed by
  config.ts and all three build scripts (no more 3-way drift risk).
- Add tests: dashboard i18n/index.ts (document.lang mirror, init non-blocking),
  useLanguage concurrent-hydration race + cross-tab adoption,
  normalizeToSupportedLocale, namespace-source consistency.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 09:03:16 -07:00
gsxdsm
3ae1fc3830 feat(dashboard): add language switcher and persistence (U4)
Add useLanguage (three-tier persistence mirroring useTheme: localStorage cache
+ server GlobalSettings write-through + hydrate-on-mount, local choice wins)
and a LanguageSelector rendered in the Settings Appearance section. Switching
applies in place via i18n.changeLanguage — no reload, so unsaved state and
in-flight agent views survive. Endonyms name each language in its own script.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 08:19:44 -07:00
gsxdsm
fab2377fd1 FN-5921: persist queued chat messages across navigation
Keep queued chat composer state when users move between sessions and only clear it when the session is truly discarded.

- stop clearing persisted pending chat messages during session switches in useChat and useQuickChat
- clear persisted queued messages only when creating a fresh session or archiving/deleting an existing session
- add regression coverage for navigation, reselection, pre-session queueing, and cleanup behavior across chat and quick chat hooks

Files changed:
 .../dashboard/app/hooks/__tests__/useChat.test.ts  | 246 ++++++++++++++++++++-
 .../app/hooks/__tests__/useQuickChat.test.ts       | 150 +++++++++++++
 packages/dashboard/app/hooks/useChat.ts            |   9 +-
 packages/dashboard/app/hooks/useQuickChat.ts       |   5 +-
 4 files changed, 396 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-5921

Fusion-Task-Lineage: 8916f862-77f5-4d5b-be9a-412e8a71a47d
2026-06-02 22:42:19 -07:00
gsxdsm
9e00a72d7d FN-5884: preserve quick chat session across reopens
Keep quick chat warm and restore the last opened conversation per project.

- persist the active quick chat session id in per-project local storage and restore it before falling back to latest activity
- retain in-memory quick chat state across close/reopen while resetting chat state correctly when the project changes
- add storage, hook, and FAB coverage for restored sessions, warm reopen behavior, and project switching; document the updated quick chat behavior

Files changed:
 docs/dashboard-guide.md                            |   3 +-
 packages/dashboard/app/components/QuickChatFAB.tsx |  29 ++++--
 .../app/components/__tests__/QuickChatFAB.test.tsx | 112 +++++++++++++++++++--
 .../__tests__/quickChatLastSessionStorage.test.ts  |  55 ++++++++++
 .../app/hooks/__tests__/useQuickChat.test.ts       |  70 +++++++++++++
 .../app/hooks/quickChatLastSessionStorage.ts       |  41 ++++++++
 packages/dashboard/app/hooks/useQuickChat.ts       |  25 +++++
 7 files changed, 319 insertions(+), 16 deletions(-)

Fusion-Task-Id: FN-5884

Fusion-Task-Lineage: 4d689611-1824-41db-8fc2-d543407316ff
2026-06-02 09:34:19 -07:00
gsxdsm
cf3b9a575e FN-5886: show empty usage state after empty fetch
Handle empty usage responses without leaving the panel in its loading skeleton.

- add a hasFetched flag to useUsageData so the UI can distinguish initial loading from an empty completed response
- update UsageIndicator to render the skeleton only before the first fetch completes and show the empty state afterward
- refresh dashboard hook and component tests to cover empty fetches, refresh behavior, and the new loading semantics

Files changed:
 .../dashboard/app/components/UsageIndicator.tsx    |  19 +-
 .../components/__tests__/UsageIndicator.test.tsx   | 395 +++++++++++----------
 .../app/hooks/__tests__/useUsageData.test.ts       |  42 ++-
 packages/dashboard/app/hooks/useUsageData.ts       |   5 +
 4 files changed, 245 insertions(+), 216 deletions(-)

Fusion-Task-Id: FN-5886

Fusion-Task-Lineage: 8fa901a9-3167-4e33-a082-e5de95f692da
2026-06-02 09:24:42 -07:00
gsxdsm
70e7a6b30a FN-5852: persist queued chat messages across navigation
Keep queued follow-up chat drafts across session switches, reloads, and view re-entry.

- persist queued pending-message text per chat session in shared localStorage helpers
- restore and flush queued follow-up messages in full Chat when returning to an active session
- restore and flush queued follow-up messages in Quick Chat and cover the recovery path with tests
- document queued-message persistence behavior in the dashboard guide

Files changed:
 docs/dashboard-guide.md                            |   2 +
 .../dashboard/app/hooks/__tests__/useChat.test.ts  | 119 +++++++++++++++++-
 .../app/hooks/__tests__/useQuickChat.test.ts       | 135 +++++++++++++++++++++
 .../app/hooks/chatPendingMessageStorage.ts         |  48 ++++++++
 packages/dashboard/app/hooks/useChat.ts            |  38 ++++++
 packages/dashboard/app/hooks/useQuickChat.ts       |  35 ++++++
 6 files changed, 376 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5852

Fusion-Task-Lineage: 1cddfb19-7e02-40e5-b373-5d593dfcfe2a
2026-06-01 22:11:30 -07:00
gsxdsm
1aef3c9899 FN-5817: prevent blank dashboard after auto-merge toggle
Ensure viewport mode updates stay in sync so toggling auto-merge no longer blanks the dashboard.

- update useViewportMode to initialize safely and react consistently to viewport/media-query changes
- add focused hook coverage for initial mode detection and transition behavior
- add dashboard/app regression tests to confirm the board remains rendered after auto-merge toggles
- add a changeset for @runfusion/fusion patch release

Files changed:
 .changeset/fn-5817-auto-merge-toggle-mobile.md     |  5 ++
 .../app/components/__tests__/App.test.tsx          | 66 ++++++++++++++++++++++
 .../__tests__/board-mobile-initial-render.test.tsx | 30 ++++++++++
 .../app/hooks/__tests__/useViewportMode.test.ts    | 34 +++++++++++
 packages/dashboard/app/hooks/useViewportMode.ts    | 28 +++++++--
 5 files changed, 159 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-5817

Fusion-Task-Lineage: 2fc044b1-5f37-44de-b70e-c60364a3d69c
2026-06-01 01:30:34 -07:00
gsxdsm
716f3964c5 FN-5790: harden room chat send handling and optimistic reconciliation
Prevent duplicate room sends and avoid restoring composer text when ambiguous failures still delivered the message.

- guard room composer sends with an in-flight ref to prevent double-dispatch
- treat ambiguous post-send refresh failures as delivered when recovery confirms the user message
- centralize optimistic/SSE user-message reconciliation to replace temp messages instead of duplicating them
- add and update chat room hook/component tests that cover double-send prevention and delivered-on-ambiguous-failure behavior
- add a patch changeset for @runfusion/fusion documenting the room chat reliability fix

Files changed:
 .changeset/few-dingos-smile.md                     |  5 ++
 packages/dashboard/app/components/ChatView.tsx     |  8 +++
 .../components/__tests__/ChatView.rooms.test.tsx   | 27 ++++++++++
 .../app/hooks/__tests__/useChatRooms.test.ts       | 48 +++++++++++++++--
 packages/dashboard/app/hooks/useChatRooms.ts       | 62 +++++++++++++++-------
 5 files changed, 126 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-5790

Fusion-Task-Lineage: a1ac5e4f-4cc2-4cf9-8bc1-42587d0d1d1b
2026-05-31 16:57:42 -07:00
gsxdsm
bb0f693d79 FN-5751: fix dashboard auto-merge toggle race
Prevent rapid auto-merge toggles from desynchronizing dashboard settings state.

- Track auto-merge state in a ref so each toggle reads and writes the latest value
- Apply optimistic updates from the ref and roll back correctly on failed setting updates
- Add regression coverage for rapid double-toggle behavior in useAppSettings
- Add a patch changeset for @runfusion/fusion describing the dashboard blank-state fix

Files changed:
 .changeset/fn-5751-auto-merge-toggle.md            |  5 ++++
 .../app/hooks/__tests__/useAppSettings.test.ts     | 27 ++++++++++++++++++++++
 packages/dashboard/app/hooks/useAppSettings.ts     | 20 +++++++++++-----
 3 files changed, 46 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-5751

Fusion-Task-Lineage: 1a0090ff-4015-46b8-a974-3accbbdce919
2026-05-30 14:18:15 -07:00
gsxdsm
1207dac52d FN-5710: flush queued first quick chat send after session init
Ensure the first Quick Chat message reliably streams even when a stale sendMessage closure sees no active session.

- trigger a microtask flush for queued pre-session sends when a session is already active and no stream is running
- preserve existing streaming guards so flush only runs when safe
- add regression coverage for stale-closure first-send flow to verify stream start and completion behavior

Files changed:
 .../app/hooks/__tests__/useQuickChat.test.ts       | 47 ++++++++++++++++++++++
 packages/dashboard/app/hooks/useQuickChat.ts       | 12 ++++++
 2 files changed, 59 insertions(+)

Fusion-Task-Id: FN-5710

Fusion-Task-Lineage: a4b32867-dedd-40f5-b6a8-3c71b9f7dee1
2026-05-29 22:36:45 -07:00
gsxdsm
b78736ce58 FN-5709: queue initial quick chat send until session is ready
Ensure a user's first quick-chat message is preserved and sent once session initialization finishes.

- queue pre-session text sends as promise-backed pending work instead of returning early
- flush queued text after session activation and wire completion/rejection to the original send promise
- clear queued completion state on stream reset paths and add regression coverage for first-send-before-init flow

Files changed:
 .../app/hooks/__tests__/useQuickChat.test.ts       | 34 ++++++++++++++++++++
 packages/dashboard/app/hooks/useQuickChat.ts       | 37 ++++++++++++++++++++--
 2 files changed, 69 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-5709

Fusion-Task-Lineage: 7598aa93-d127-4602-9571-02bc2a0cc5da
2026-05-29 21:56:53 -07:00
gsxdsm
4a60c2ac41 FN-5708: backfill files changed chip on done task cards
Ensure freshly done task cards show the "N files changed" chip once mergeDetails diff stats arrive.

- backfill TaskCard diff stat display logic so completed cards update when mergeDetails enrichment lands after initial render
- update useTaskDiffStats to derive files-changed counts from merge details with fallback-safe behavior
- add TaskCard and useTaskDiffStats test coverage for late-arriving mergeDetails and chip rendering
- add a changeset for @runfusion/fusion documenting the patch release

Files changed:
 .changeset/fn-5708-files-changed-chip.md           |  5 ++
 packages/dashboard/app/components/TaskCard.tsx     | 10 +++
 .../app/components/__tests__/TaskCard.test.tsx     | 64 +++++++++++++++
 .../app/hooks/__tests__/useTaskDiffStats.test.ts   | 92 ++++++++++++++++++++++
 packages/dashboard/app/hooks/useTaskDiffStats.ts   | 17 +++-
 5 files changed, 185 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-5708

Fusion-Task-Lineage: 3f961f3f-045b-473e-9636-ca33fd84282c
2026-05-29 21:32:09 -07:00
Josemi Liebana
6ad18663b8 fix(dashboard): address review comments on PR #1099
- fix(perf): use messagesRef.current in loadMoreMessages to avoid
  recreating callback on every streamed token; messagesRef is already
  kept in sync on every render so no useEffect needed — removes
  `messages` from useCallback deps
- fix(api): reject invalid order query param with 400 instead of
  silently ignoring; valid values are 'asc' and 'desc'

Tests:
- useChat: loadMoreMessages identity is stable when messages array changes
- chat-routes: GET /messages?order=invalid returns 400
2026-05-27 17:38:04 +02:00
Josemi Liebana
d7e4cf7f94 fix(test): update useChat tests for order=desc and before-cursor pagination 2026-05-27 15:24:31 +02:00
Josemi Liebana
6e9ab0e989 feat(dashboard): load latest messages first with order=desc pagination
- Add order?: 'asc' | 'desc' to ChatMessagesFilter (core)
- Route handler passes order param from query string
- Initial load requests order=desc and reverses for display
- loadMoreMessages uses before cursor instead of offset
- hasMoreMessages starts false (prevents IntersectionObserver race)
- ChatView IntersectionObserver guards against messagesLoading
2026-05-27 11:57:21 +02:00
gsxdsm
6a6c6fdbfd perf(dashboard): speed up startup and eliminate API request storms
Multiple coordinated fixes for the perceived "dashboard takes forever to
load" complaint. Per-page-load HTTP requests drop from ~177 to ~101 and
duplicate per-project InProcessRuntime creation is eliminated.

- engine: shouldUseHybridExecutor no longer auto-enables for local-only
  multi-project setups (set FUSION_HYBRID_EXECUTOR=1 to force). The
  duplicate-runtime path was running self-healing twice per project and
  contending on the same SQLite file. ProjectEngineManager already
  handles N local projects with one InProcessRuntime each.
- dashboard cli: parallelized independent store inits, started
  CentralCore.init early in background, ran plugin loading concurrently
  with extension resolution. Sequenced SQLite store inits to avoid a
  TOCTOU race in addColumnIfMissing migrations across TaskStore /
  AutomationStore / PluginStore / AgentStore (all open the same
  .fusion/fusion.db). Restored try/catch around HybridExecutor.initialize
  and engineManager.ensureEngine so a paused or broken cwd project no
  longer aborts dashboard startup.
- dashboard client: added in-flight request dedupe wrapped around the
  top API offenders. /api/plugins/ui-slots drops from 17x to 1x per load.
  dedupe.forceFresh redirects ALL in-flight waiters to receive the fresh
  post-mutation response, not just the forcing caller. Generation
  counters in useAgents and AgentListModal protect against slow polls
  overwriting fresh state.
- dashboard SSE: agent event handler now debounces 250ms with a
  trailing-edge guard so multi-agent activity bursts coalesce to at
  most 2 refetches per burst.
- dashboard route: PATCH /api/projects/:id with isolationMode change
  returns 503 with actionable guidance when HybridExecutor is
  unavailable, instead of silently persisting a config the live runtime
  won't honor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 21:57:31 -07:00
gsxdsm
0a6da9f4ce feat(FN-5583): handle notification deep links in useDeepLink hook
Adds support for project-only notification deep links in the dashboard hook, with comprehensive test coverage across all deep-link URL shapes and a changeset for release.

Fusion-Task-Id: FN-5583

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5583
2026-05-24 00:11:08 -07:00
gsxdsm
6aa1ff0fb5 feat(FN-5475): add allow-resurrection control to task delete flow
Implements the allow-resurrection toggle for task deletion, letting users prevent deleted tasks from being automatically restored. Changes span the `ConfirmDialog` component, `TaskDetailModal`, and the `useConfirm` hook, with comprehensive test coverage across the dashboard API and UI layers.

Fusion-Task-Id: FN-5475

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5475
2026-05-23 20:44:01 -07:00
gsxdsm
6e7f1e570e fix(dashboard): useMergeAdvanceNotice tests should waitFor toBeDefined
`notice` is `events.find(...)` which returns `undefined` (not `null`)
when no match. `waitFor(() => expect(...).not.toBeNull())` exited
immediately because `undefined !== null` — the test never actually
waited for the api mock to resolve. Sometimes the followup assertions
happened to land after the events fetched (test passed by luck);
sometimes they ran while notice was still undefined and the assertions
failed.

Switched all five waitFor sites to `.toBeDefined()` so they actually
block on the events-fetch resolution.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 18:39:36 -07:00
gsxdsm
99359b6536 fix(dashboard): unbreak banner dismiss + suppress when auto-sync handled it
Two bugs were keeping the Merge Advance Notice banner stuck on screen
even when there was nothing for the user to do:

  - Dismiss was dead: the `notice` memo never applied dismissedShas, so
    clicking close (or a successful Pull, which calls dismiss()) updated
    localStorage but the filter immediately re-matched the same event.
  - Auto-sync success was ignored: with mergeAdvanceAutoSync defaulting
    to "stash-and-ff", the merger snaps the project-root checkout
    forward as part of the merge — nothing left to pull — but the banner
    kept appearing. Clicking Pull then hit /api/git/pull which fetched
    origin (no change, the merger only advanced the local ref) and
    returned pull-clean with no real work done.

The notice memo now (a) filters dismissedShas, and (b) suppresses any
advance event whose autoSync entry for the current user's worktreePath
reports clean-sync or synced-with-edits-restored. Conflict + skipped
outcomes still surface so the user can recover.

Tests: dismiss removes the banner; clean-sync suppresses; pop-conflict
still surfaces; sibling-worktree success doesn't suppress this user.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 15:57:48 -07:00
gsxdsm
14bc63e813 feat(FN-5419): add stash conflict modal gating and smart pull routing for m
Implements a pull-based merge workflow by wiring the merger pull helpers from the engine, extending the git pull and stash routes, and aligning the `MergeAdvanceNotice` and `StashConflictModal` components to gate dismissal on stash drop. The `run-audit` module is updated with pull mutation documenta

Fusion-Task-Id: FN-5419

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5419
2026-05-23 13:06:48 -07:00
gsxdsm
63ec709811 feat(FN-5552): narrow push outcome union in useMergeAdvanceNotice
Narrowed the push outcome union type in `useMergeAdvanceNotice` and added regression test coverage for the outcome narrowing behavior, including alignment of root script contract expectations in the package config tests.

Fusion-Task-Id: FN-5552

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5552
2026-05-23 09:00:02 -07:00
gsxdsm
e5357a4afd feat(FN-5359): add push-to-origin button and hook to merge advance notice
Adds a push-to-origin workflow to the merge notice system, introducing a new `useMergeAdvanceNotice` hook, a `merge-advance-push-origin` route handler, and corresponding UI affordance in the `MergeAdvanceNotice` banner component. The engine gains TOCTOU and refusal audit assertions, and coverage exp

Fusion-Task-Id: FN-5359

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5359
2026-05-23 06:06:51 -07:00
gsxdsm
b22112af89 feat(FN-5482): suppress touch-synthesized mouse events on overlay dismiss
Adds a `useOverlayDismiss` hook that suppresses touch-synthesized mouse events on modal/dropdown overlays to prevent unintended close behavior on touch devices, with tests covering TaskCard dismissal and overlay interaction edge cases. Documentation updates in AGENTS.md and docs/architecture.md capt

Fusion-Task-Id: FN-5482

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5482
2026-05-23 02:06:11 -07:00
gsxdsm
60a0012697 fix(dashboard): gate mobile scroll-lock to iOS so Android keyboard stays open
The body scroll-lock applied while the keyboard is up in main chat was an
iOS-specific workaround for visualViewport drift. On Android Chrome the same
mutation does the opposite of what we want — applying position:fixed to body
while the soft keyboard is opening causes Chrome to treat it as a focus-
target relayout and dismiss the keyboard instantly, making the main chat
composer unusable on Android.

useMobileScrollLock now early-returns on non-iOS user agents. Android Chrome
doesn't need it: with interactive-widget=resizes-content the layout viewport
shrinks with the keyboard, so there's no drift to compensate for.

Adds an Android-UA test case that asserts the lock is a no-op there.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 14:01:09 -07:00
Fusion (runfusion.ai)
9c2b61eec6 feat(FN-5204): add test mode activation across settings, engine, and dashboard
- Add core settings schema/types support for testMode with model-resolution override handling
- Enforce engine session lane overrides in test mode with targeted helper coverage
- Add dashboard settings toggle plus persistent test-mode banner and related component tests
- Update settings documentation and parity/roundtrip tests for the new test mode behavior
2026-05-22 00:15:14 -07:00
Fusion (runfusion.ai)
4cbdd157c5 feat(FN-5469): add useAgentLogs resume instrumentation and test coverage
Added resume instrumentation to the `useAgentLogs` hook (`packages/dashboard/app/hooks/useAgentLogs.ts`) with test coverage and diagnostics documentation. The new test file is included in the dashboard test gate via `vitest.config.ts`.

Fusion-Task-Id: FN-5469
2026-05-21 20:06:48 -07:00
Fusion (runfusion.ai)
854045f430 feat(FN-5416): instrument SSE stream resume events across PR checks, dev-se
Adds structured stream-resume instrumentation to the dashboard across four SSE hooks (PR checks, dev-server logs, research, background sessions), wiring `[wake-trigger-diagnostics]` log markers and view-resume route guards so the engine can distinguish cold starts from resume paths; includes tests f

Fusion-Task-Id: FN-5416
2026-05-21 18:15:26 -07:00
Fusion (runfusion.ai)
c04442f6ea feat(FN-5415): wire visibility resume emissions in board hooks and add test
Adds visibility resume emissions to the four managed state hooks (`useMeshState`, `useNodes`, `useProjects`, `useManagedDockerNodes`) and establishes corresponding instrumentation test coverage, with a documentation update to the diagnostics reference covering board hook telemetry.

Fusion-Task-Id: FN-5415
2026-05-21 16:09:53 -07:00