Skip to content

feat: preserve manual rename + complete full-width chat layout#2

Merged
zhonghuaY merged 2 commits intofix/sidebar-rename-models-fullwidthfrom
feat/title-manual-override-and-fullwidth
Apr 29, 2026
Merged

feat: preserve manual rename + complete full-width chat layout#2
zhonghuaY merged 2 commits intofix/sidebar-rename-models-fullwidthfrom
feat/title-manual-override-and-fullwidth

Conversation

@zhonghuaY
Copy link
Copy Markdown
Owner

Summary

Two unrelated but ready-to-ship fixes that were sitting in a WIP stash. Split into 2 commits for clean review.

Commit 1 — feat(title): preserve manual rename against LLM auto-title overwrite

Problem

When a user manually renames a session (via /title slash command, sidebar context menu, titlebar dialog, or duplicate-with-rename), the background LLM title generator/refresher would silently overwrite their title on the next model response.

Fix

  • /api/session/rename now accepts a manual: bool parameter to distinguish explicit user renames from LLM-generated provisional/refined titles.
  • When manual=True, the server sets s.user_renamed_title = True.
  • The background title generator (_run_background_title_update) and refresher (_run_background_title_refresh) now check this flag at every commit point and short-circuit with 'skipped: manual_title'.
  • New helper _has_manual_title_override(session) uses strict is True comparison to avoid being fooled by MagicMock attribute access in tests.
  • Session.__init__ now accepts arbitrary **kwargs so the new user_renamed_title field round-trips through deserialization without requiring schema migration.

Call site semantics

Caller manual? Why
/title <name> slash command true explicit user intent
Sidebar right-click → Rename true explicit user intent
Titlebar inline edit dialog true explicit user intent
Sidebar Duplicate (writes "(copy)" suffix) true user-initiated, name should stick
First-message provisional title false placeholder, LLM may refine
Background LLM refine (writes new title) false (resets flag) LLM-owned

Files

  • api/models.py, api/routes.py, api/streaming.py (server-side)
  • static/{commands,messages,panels,sessions}.js (4 call sites)
  • tests/test_session_extra_fields.py (new), plus updates to test_rename_session.py, test_title_aux_routing.py, test_1058_adaptive_title_refresh.py

Commit 2 — fix(layout): remove leftover msg max-width caps for full-width chat

Problem

Follow-up to 6eba0c15 feat(layout): full-width chat output container. That commit removed the outer cap but several inner elements still had max-width: var(--msg-max), so message bodies, tool cards, thinking cards, error rows, and the message footer remained narrow on wide screens.

Fix

  • Drop max-width from .msg-body, .tool-card, .thinking-card, .msg-foot, .msg-row[data-error], .messages-inner (and its @media 1400/1800px overrides).
  • Update tests/test_full_width_chat.py assertions to enforce the absence of these caps so future regressions are caught.

Files

  • static/style.css, tests/test_full_width_chat.py

Testing

Both commits sanity-tested. Pre-existing 5 failures in test_rename_session.py are env-related (auth/connection refused on the in-process test server) and identical on baseline before this PR — not caused by these changes.

Co-authored-by: Copilot <[email protected]>

Copilot AI added 2 commits April 29, 2026 10:04
Adds a 'manual' bool to /api/session/rename so the server can distinguish
explicit user renames from LLM-generated provisional/refined titles.
When manual=True, sets s.user_renamed_title=True; the background title
generator and refresher then short-circuit ('skipped: manual_title') at
every check point so user intent is never silently overwritten.

- /title slash command, sidebar context menu, titlebar dialog, duplicate
  -> manual:true
- first-message provisional title (auto), background LLM refine (auto)
  -> manual:false
- new helper _has_manual_title_override() uses 'is True' to avoid being
  fooled by MagicMock attribute access in tests
- Session.__init__ now accepts arbitrary kwargs so the new field
  round-trips through deserialization

Co-authored-by: Copilot <[email protected]>
Follow-up to 6eba0c1 (feat(layout): full-width chat output container).
That commit removed the outer cap but several inner elements still
had 'max-width: var(--msg-max)', so message bodies, tool cards,
thinking cards, error rows and the message footer remained narrow.

- drop max-width from .msg-body, .tool-card, .thinking-card, .msg-foot,
  .msg-row[data-error], .messages-inner (and its 1400/1800px overrides)
- update test_full_width_chat assertions to enforce the absence of
  these caps so future regressions are caught

Co-authored-by: Copilot <[email protected]>
@zhonghuaY zhonghuaY merged commit a58e1b5 into fix/sidebar-rename-models-fullwidth Apr 29, 2026
@zhonghuaY zhonghuaY deleted the feat/title-manual-override-and-fullwidth branch April 29, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants