From 3903d3c383299fe5c52b349e734f908cbd5578c4 Mon Sep 17 00:00:00 2001 From: Fusion Agent Date: Fri, 21 Aug 2026 00:16:26 +0000 Subject: [PATCH] FN-096: add New Chat to active conversation headers Expose the shared New Chat action wherever an active conversation is open. - Keep New Chat available in list and selected-detail headers across Chat hosts. - Reset room launches to a persisted Direct session and preserve existing navigation behavior. - Update responsive styling, documentation, regression coverage, screenshots, and release metadata. Files changed: .changeset/fn-096-chat-header-new-chat.md | 7 +++ docs/dashboard-guide.md | 6 +-- packages/dashboard/app/components/ChatView.css | 3 ++ packages/dashboard/app/components/ChatView.tsx | 23 +++++---- .../components/__tests__/ChatView.mobile.test.tsx | 15 +++++- .../__tests__/ChatView.new-chat-default.test.tsx | 53 +++++++++++++++++++-- .../__tests__/ChatView.sessions-rooms.test.tsx | 36 +++++++++++--- screenshots/fn-096-chat-header-new-desktop.png | Bin 0 -> 7476 bytes screenshots/fn-096-chat-header-new-mobile.png | Bin 0 -> 4881 bytes 9 files changed, 120 insertions(+), 23 deletions(-) Fusion-Task-Id: FN-096 Fusion-Task-Lineage: b63ddd12-87bb-470e-9cc9-a80817270257 Co-authored-by: Fusion --- .changeset/fn-096-chat-header-new-chat.md | 7 +++ docs/dashboard-guide.md | 6 +- .../dashboard/app/components/ChatView.css | 3 + .../dashboard/app/components/ChatView.tsx | 23 ++++---- .../__tests__/ChatView.mobile.test.tsx | 15 ++++- .../ChatView.new-chat-default.test.tsx | 53 +++++++++++++++++- .../ChatView.sessions-rooms.test.tsx | 36 ++++++++++-- .../fn-096-chat-header-new-desktop.png | Bin 0 -> 7476 bytes screenshots/fn-096-chat-header-new-mobile.png | Bin 0 -> 4881 bytes 9 files changed, 120 insertions(+), 23 deletions(-) create mode 100644 .changeset/fn-096-chat-header-new-chat.md create mode 100644 screenshots/fn-096-chat-header-new-desktop.png create mode 100644 screenshots/fn-096-chat-header-new-mobile.png diff --git a/.changeset/fn-096-chat-header-new-chat.md b/.changeset/fn-096-chat-header-new-chat.md new file mode 100644 index 0000000000..33aaf0fb18 --- /dev/null +++ b/.changeset/fn-096-chat-header-new-chat.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": minor +--- + +summary: Start a new chat directly from an active conversation header. +category: feature +dev: Keeps the existing project New Chat default and prompt behavior across Chat hosts. diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md index 52f3269f2e..b8a5d199a6 100644 --- a/docs/dashboard-guide.md +++ b/docs/dashboard-guide.md @@ -734,7 +734,7 @@ The full **New Task** dialog includes a compact **GitHub issue or PR** picker ne Chat view provides project-scoped conversations with agents. Every host—embedded Chat, Quick Chat, and the dock—starts at the conversation list. Select a conversation to open its thread as the full pane, then use the thread-row **< BACK** action to return to the loaded list without interrupting the thread. -The list owns **New Chat**, search and tag filters, archived/restore, and each row's rename, pin, archive, and delete actions. Detail intentionally contains the saved conversation title, secondary model metadata when available, and its one **< BACK** action: it does not include a conversation selector or duplicate management controls. The default list contains only active sessions; use **Archived conversations** to view archived sessions, restore one to the active list, or explicitly delete it. Archive is the default removal action, while delete remains a separate destructive action. +The shared Chat header owns **New Chat** in both the list and selected detail across embedded Chat, Quick Chat, mobile, and dock hosts. Search and tag filters, archived/restore, and each row's rename, pin, archive, and delete actions remain list-only. Detail intentionally contains the saved conversation title, secondary model metadata when available, and its one **< BACK** action: it does not include a conversation selector or duplicate management controls. The default list contains only active sessions; use **Archived conversations** to view archived sessions, restore one to the active list, or explicitly delete it. Archive is the default removal action, while delete remains a separate destructive action. ### Conversation layout @@ -854,9 +854,9 @@ Quick Chat is an optional fast, project-scoped assistant surface for conversatio - Uses the same model/provider infrastructure as full Chat view - On small screens, compact tool-call summaries in the floating panel intentionally stay single-line (count + tool names + status) to preserve message density - Quick Chat uses the same list-first flow as embedded and dock Chat: its conversation list shows persisted sessions (preferring `session.title`, then falling back to deterministic `Session N` labels). -- Select a session to resume it in the full panel, then use the thread-row **< BACK** action to return to the list. Rename, pin, archive, delete, and New Chat stay in that list rather than appearing in the selected thread. +- Select a session to resume it in the full panel, then use the thread-row **< BACK** action to return to the list. Rename, pin, archive, and delete stay list-only; the shared header keeps **New Chat** available from either list or selected detail. - Entering `/new` or `/clear` (exact match after trimming) in the Quick Chat composer clears the active thread target: direct/model targets use `startFreshSession(...)`, while room targets call `rooms.clearRoom(activeRoom.id)`. -- **New Chat** is available from the Quick Chat conversation list. Creating a session selects its new full-pane thread immediately; return with **Back to conversations** to browse or manage sessions. +- Creating a session through **New Chat** selects its new full-pane Direct thread immediately, including when launched from a selected Room; return with **Back to conversations** to browse or manage sessions. - On first open for a project, Quick Chat restores the last opened non-archived session from per-project local storage; if that saved session is missing, it falls back to the most recently touched non-archived session by latest activity (`max(lastMessageAt, updatedAt)`), and only falls back to the first agent / configured default model when no prior session exists. - Closing Quick Chat keeps the active conversation, panel geometry, and message-list scroll position warm in memory. Reopening is an instant visibility restore with no conversation reload, layout reflow, or "Loading conversation…" flash. diff --git a/packages/dashboard/app/components/ChatView.css b/packages/dashboard/app/components/ChatView.css index 7aeba47263..ae7f303cff 100644 --- a/packages/dashboard/app/components/ChatView.css +++ b/packages/dashboard/app/components/ChatView.css @@ -510,6 +510,9 @@ The Direct-chat context budget indicator is a secondary desktop/tablet header af /* FNXC:ChatNavigation 2026-08-20-05:25: FN-068 puts the only Back action beside the selected conversation title. Do not override ViewHeader actions for detail mode: floating Open in Chat view and Close must retain ViewHeader's canonical right alignment. + +FNXC:ChatNavigation 2026-08-20-23:57: +FN-096 keeps the shared-header New Chat action visible in selected detail as well as list mode. Its shrinkable token-based sizing preserves the floating Close and the thread-row Back action on narrow embedded, floating, and dock hosts. */ .chat-thread-header-back { flex: 0 0 auto; diff --git a/packages/dashboard/app/components/ChatView.tsx b/packages/dashboard/app/components/ChatView.tsx index 0c7f5d7aaf..a4d1909319 100644 --- a/packages/dashboard/app/components/ChatView.tsx +++ b/packages/dashboard/app/components/ChatView.tsx @@ -1700,6 +1700,8 @@ export function ChatView({ projectId, addToast, floating = false, compactLayout async (input: { agentId: string; modelProvider?: string; modelId?: string; thinkingLevel?: string }) => { try { await createSession(input); + // FNXC:ChatNavigation 2026-08-20-23:57: New Chat always creates a Direct session, so switch scopes only after persistence succeeds and let useChat select the new thread. + setChatScope("direct"); setShowNewDialog(false); setDetailOpen(true); return true; @@ -3131,6 +3133,9 @@ export function ChatView({ projectId, addToast, floating = false, compactLayout /* FNXC:ChatNavigation 2026-08-20-05:25: FN-068 reserves the shared ViewHeader for view-level actions. A selected conversation owns its sole textual Back action in the thread row, preserving one list/detail state machine across desktop, floating, compact, and mobile hosts. + + FNXC:ChatNavigation 2026-08-20-23:57: + FN-096 keeps the canonical New Chat action in this shared header for both list and selected-detail states. Embedded, floating, and dock hosts must reuse this one creation entry point while the thread row retains the sole Back action. */
{!hasDetailSelection ? scopeToggle : null} - {!hasDetailSelection ? ( - - ) : null} + {!floating && onPopOut ? (