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 ? (