Fix the in-chat Brain popup's model picker on touch viewports: pointerdown outside-close was treating the portaled CustomModelDropdown menu as outside the popup, dismissing it before the tap could register a model selection, and the mobile popover was mis-anchored off-screen.
- ChatThinkingLevelControl: treat pointerdown targets inside the portaled `.model-combobox-dropdown--portal` menu as inside the popup so touch taps select the model instead of closing the popup first
- ChatView.css: clamp the popover to the viewport width via max-width/max-inline-size, and on mobile anchor it to the chat input area with tokenized left/right gutters instead of a collapsing left:0 width
- Add a portal-aware regression test covering pointerdown-inside-portal selection, genuine outside-pointerdown close, and the mobile CSS anchoring contract
- Add changeset (patch) and update dashboard guide docs to describe mobile/tablet behavior
Files changed:
.changeset/fn-7916-chat-mobile-model-selector.md | 7 ++
docs/dashboard-guide.md | 3 +-
.../app/components/ChatThinkingLevelControl.tsx | 10 ++-
packages/dashboard/app/components/ChatView.css | 17 +++-
.../ChatThinkingLevelControl.portal.test.tsx | 97 ++++++++++++++++++++++
5 files changed, 130 insertions(+), 4 deletions(-)
Fusion-Task-Id: FN-7916
Fusion-Task-Lineage: bcc2d9ad-0be6-4e23-b643-eebf93aae3c6
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Extend the chat brain-icon popup and its backing session PATCH route so an
active Direct chat's model or agent can be switched mid-conversation instead
of only being set at creation time.
- Add a Model/Agent section to ChatThinkingLevelControl (the brain-icon
popup) for picking a model provider/model or retargeting to a real agent
without leaving the chat.
- Extend PATCH /api/chat/sessions/:id to accept modelProvider/modelId (as a
validated pair via the existing validateModelPair helper) and agentId,
forwarding only the keys present in the body so omitted fields leave the
session's stored target untouched.
- Add chat-store updateSession support for the agentId clause alongside the
existing model/thinkingLevel fields, and a useChat.setSessionModel hook
for the dashboard to call the new PATCH capability.
- Update i18n locale strings (en/es/fr/ko/zh-CN/zh-TW) and dashboard-guide.md
docs for the new switcher UI.
- Add unit/integration test coverage across chat-store, chat-manager,
chat-routes, useChat, ChatThinkingLevelControl, and ChatView for the new
model/agent switch behavior.
- Add changeset fn-7908-chat-model-agent-switcher.md (minor,
@runfusion/fusion).
Files changed:
.changeset/fn-7908-chat-model-agent-switcher.md | 7 +
docs/dashboard-guide.md | 3 +-
packages/core/src/__tests__/chat-store.test.ts | 21 ++
packages/core/src/chat-store.ts | 8 +
packages/core/src/chat-types.ts | 2 +
packages/dashboard/app/api/legacy.ts | 11 +-
.../app/components/ChatThinkingLevelControl.tsx | 219 ++++++++++++++++++---
packages/dashboard/app/components/ChatView.css | 135 ++++++++++++-
packages/dashboard/app/components/ChatView.tsx | 23 ++-
.../__tests__/ChatThinkingLevelControl.test.tsx | 109 +++++++++-
.../__tests__/ChatView.thinking-level.test.tsx | 67 ++++++-
.../dashboard/app/hooks/__tests__/useChat.test.ts | 166 +++++++++++++++-
packages/dashboard/app/hooks/useChat.ts | 56 ++++++
.../dashboard/src/__tests__/chat-manager.test.ts | 38 ++++
.../dashboard/src/__tests__/chat-routes.test.ts | 117 ++++++++++-
.../dashboard/src/routes/register-chat-routes.ts | 48 ++++-
packages/i18n/locales/en/app.json | 8 +-
packages/i18n/locales/es/app.json | 8 +-
packages/i18n/locales/fr/app.json | 8 +-
packages/i18n/locales/ko/app.json | 8 +-
packages/i18n/locales/zh-CN/app.json | 8 +-
packages/i18n/locales/zh-TW/app.json | 8 +-
22 files changed, 1007 insertions(+), 71 deletions(-)
Fusion-Task-Id: FN-7908
Fusion-Task-Lineage: b1104865-9b0c-4d77-973e-89152fe245e0
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Chat thinking-level Default entries hardcoded "off" instead of showing the project/global resolved default, misleading operators about which level would actually apply.
- ChatView now fetches Settings via fetchSettings on mount and derives resolvedDefaultThinkingLevel from settings.defaultThinkingLevel (falling back to "off")
- Threads resolvedDefaultThinkingLevel into NewChatDialog and the in-chat ChatThinkingLevelControl (Brain popup) so both surfaces show e.g. "Default (medium)" instead of always "Default (off)"
- ChatThinkingLevelControl accepts a new optional defaultThinkingLevel prop (defaults to "off" for backward compatibility) used only for the Default/clear option label
- Updates dashboard-guide.md to document the resolved-default label behavior in both the New Chat dialog and the in-chat Brain popup
- Adds/updates tests: new ChatThinkingLevelControl coverage for the label prop, new ChatView.thinking-level test coverage for the resolved default, and mocks fetchSettings in the other ChatView test suites that render ChatView
- Adds a patch changeset for @runfusion/fusion
Files changed:
.changeset/fn-7905-chat-thinking-default.md | 7 ++++
docs/dashboard-guide.md | 5 +--
.../app/components/ChatThinkingLevelControl.tsx | 9 +++--
packages/dashboard/app/components/ChatView.tsx | 36 ++++++++++++++++---
.../__tests__/ChatThinkingLevelControl.test.tsx | 16 +++++++++
.../__tests__/ChatView.chat-commands.test.tsx | 1 +
.../__tests__/ChatView.content-search.test.tsx | 1 +
.../__tests__/ChatView.context-window.test.tsx | 1 +
.../__tests__/ChatView.copy-response.test.tsx | 1 +
.../__tests__/ChatView.core-contracts.test.tsx | 1 +
.../__tests__/ChatView.core-interactions.test.tsx | 1 +
.../components/__tests__/ChatView.core.test.tsx | 1 +
.../__tests__/ChatView.default-model-icon.test.tsx | 1 +
.../__tests__/ChatView.hash-mention.test.tsx | 1 +
.../components/__tests__/ChatView.mobile.test.tsx | 1 +
.../__tests__/ChatView.sessions-rooms.test.tsx | 1 +
.../__tests__/ChatView.streaming-thread.test.tsx | 1 +
.../__tests__/ChatView.thinking-level.test.tsx | 42 ++++++++++++++++++++++
18 files changed, 119 insertions(+), 8 deletions(-)
Fusion-Task-Id: FN-7905
Fusion-Task-Lineage: 7290aa8a-f812-43c3-8ba5-fc31a3f4579e
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>