feat(workspace): opt-in 'start new chat when switching workspace' (#5473)

Salvage-rebuild of #5473 (@ruizanthony), reworked to OPT-IN per maintainer
decision. New default-OFF setting new_chat_on_workspace_switch: when enabled,
selecting a DIFFERENT workspace starts a fresh chat bound to that workspace
(leaving the current conversation on its original workspace, avoiding stale
cross-workspace context) instead of mutating the current session in place.
Same-workspace selection stays an in-place refresh. Default off preserves the
shipped behavior for everyone.

Wiring: config default + bool key; window._newChatOnWorkspaceSwitch set on
boot + autosave; Settings checkbox (Preferences); gated branch in
switchToWorkspace() that runs before the in-place /api/session/update; 3 i18n
keys across all 15 locales; regression tests (default-off, gated-branch-present,
flag-wiring, checkbox+i18n).

Co-authored-by: ruizanthony <ruizanthony@users.noreply.github.com>
This commit is contained in:
nesquena-hermesandruizanthony committed 2026-07-11 03:13:48 +00:00
1 parent 101421ff67
commit 54efd6078e
6 files changed
+162

No files matched your search

+2
View File
@@ -8409,6 +8409,7 @@ _SETTINGS_DEFAULTS = {
"show_conversation_outline": False, # show opt-in desktop jump-to-question outline panel
"show_busy_placeholder_hint": False, # opt-in busy composer placeholder hint
"hide_empty_state_suggestions": False, # hide the default new-chat suggestion buttons
"new_chat_on_workspace_switch": False, # #5473 opt-in: switching to a DIFFERENT workspace starts a new chat (leaving the current conversation on its original workspace) instead of mutating the current session's workspace in place. Default OFF preserves the shipped in-place-switch behavior.
"virtualize_transcript": False, # #4343: virtualize long (>80 msg) transcripts. EXPERIMENTAL, opt-IN (default OFF). Was opt-out/default-on in #4325 but caused scroll-up flicker on long sessions with tall tool-call rows (variable-height anchor oscillation) — flipped off for everyone in #4343; re-enabling requires an explicit opt-in (see virtualize_transcript_optin migration in load_settings).
"virtualize_transcript_optin": False, # #4343 migration marker: True only once the user explicitly enables virtualize_transcript AFTER the default-off flip. A stored virtualize_transcript=True WITHOUT this marker is a stale pre-flip value and is reset to False on load (force-off-for-everyone migration).
"show_tps": False, # show tokens-per-second chip in assistant message headers
@@ -8729,6 +8730,7 @@ _SETTINGS_BOOL_KEYS = {
"show_conversation_outline",
"show_busy_placeholder_hint",
"hide_empty_state_suggestions",
"new_chat_on_workspace_switch",
"virtualize_transcript",
"virtualize_transcript_optin",
"show_tps",