Skip to content

Rename threads and side chats inline instead of in a dialog - #751

Merged
wingleeio merged 2 commits into
zeronsh:mainfrom
jsgrrchg:zeron/inline-thread-rename-implementation
Oct 3, 2026
Merged

wingleeio merged 2 commits into
zeronsh:mainfrom
jsgrrchg:zeron/inline-thread-rename-implementation

Conversation

@jsgrrchg

@jsgrrchg jsgrrchg commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Renaming a thread opened a modal "Rename session" dialog, both from the left sidebar's chat menu and for side chats under the file tree. There was no way to rename a row directly where it sits.

Change

  • Double-click a session row in the left sidebar, or a side chat row in the explorer's Chats footer, to swap its title for an in-place field with the current name selected.
  • The chat menu's Rename (label drops the ellipsis, since it no longer opens a dialog) and the /rename command open the same field.
  • Enter or blur saves a changed, non-empty title. Escape cancels. Clicking inside the field places the caret instead of opening the chat or starting a drag.
  • The modal dialog is removed.

Hidden rows are revealed first

A rename started without touching the row (/rename, or Rename from a side chat's tab) could previously target a row that wasn't on screen, leaving an invisible field holding focus. Now the row is revealed before the field opens:

  • A collapsed Pinned, Sessions, custom section, or device/project group opens with its usual disclosure motion. Expanding a synced custom section goes through the normal section change.
  • The Archived shelf opens and pages forward (in "Show more" steps) to include the row.
  • A collapsed sidebar expands.
  • The sidebar scrolls the row clear of its edge fades, following the disclosure while it opens.
  • The explorer's Chats section opens, pages, and scrolls to the side chat the same way.

When the row can't be shown, no field opens and the sidebar notice says why:

  • The project filter hides it. The filter is left alone.
  • A synced section can't be edited yet. The existing "still syncing" notice is shown.
  • It's a side chat of a chat that isn't open.

Implementation notes

  • Shell owns a single ChatRename (chat id, which surface draws it, the input, commit-on-blur subscription). It replaces RenameChatDialog. The explorer receives the field through FilesSurface::set_chat_rename and emits FilesEvent::RenameChildChat on double-click.
  • Both lists render the same chat_title_editor (a single-line ComposerInput at the row title's 13/17 metrics). ComposerInput::select_all_text is now public so the field opens with the name selected.
  • Disclosure motions need the body height, which is only known at render time. A reveal queues the disclosure key, and each section starts its opening motion on the next render.
  • archived_sidebar_chats and the device/project group key helpers are extracted so the reveal and the render share one definition.
image

Testing

  • cargo test -p zeron-ui --lib: 1503/1504 passed. The one failure was markdown::render::tests::markdown_drag_crosses_cells_and_formatted_blocks_in_document_order, which passes when run alone; it only fails when the suite runs in parallel. shell::files_panel::workspace_tests::files_panel_workspace_navigation_and_external_updates also failed in an earlier full run and fails on main without this change.
  • New tests in shell/chat_rename_tests.rs and files/sections.rs cover:
    • double-click editing
    • Escape
    • an unchanged title
    • Enter and blur commits
    • menu or /rename opening
    • collapsed Pinned, Sessions, sidebar, project group, and custom section
    • Archived paging
    • scrolling a far row into view
    • the project-filter refusal
    • the explorer's collapsed, paged Chats section
  • Not yet checked by hand in the running app.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Double-clicking a session row in the left sidebar, or a side chat row
under the file tree, now swaps its title for an in-place field with the
name selected. The chat menu's Rename and the /rename command open the
same field. Enter or blur saves a changed, non-empty title; Escape
cancels. The Rename session modal is removed.

A rename started without touching the row first reveals it: the
collapsed Pinned, Sessions, custom section, or device/project group
opens with its usual motion, the Archived shelf opens and pages to the
row, a collapsed sidebar expands, and the list scrolls the row clear of
its edge fades. The explorer's Chats section opens, pages, and scrolls
the same way. When the row cannot be shown (hidden by the project
filter, or a side chat of another chat), no field opens and the sidebar
notice says why.
@katulevskiy

Copy link
Copy Markdown
Contributor

works in compact mode?

The rename tests run with the default compact rows; cover the full layout too,
and check that the field replaces the title without changing the row height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jsgrrchg

jsgrrchg commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

works in compact mode?

yes it does, i test it manually

@wingleeio wingleeio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full diff: UI-only (no new deps, unsafe, I/O, network or process code); renames still go through the same renameChat mutation with a trimmed, non-empty title, now skipped when unchanged or the chat is gone. Re the compact-mode question: compact is the default, so the sidebar tests already ran compact; added a test covering both compact and full rows (field sits in the row, row height unchanged). 1520/1520 UI tests green.

@wingleeio
wingleeio merged commit 1c83cda into zeronsh:main Oct 3, 2026
14 checks passed
hoangvu12 added a commit to hoangvu12/roboco that referenced this pull request Oct 6, 2026
Second drift-review run: 12 commits (11 non-merge). Five port-now
candidates (zeronsh#757, zeronsh#727, zeronsh#739, zeronsh#763, zeronsh#754), four wave-5 candidates
(zeronsh#751+zeronsh#737 sidebar lane, zeronsh#760 mermaid replies, zeronsh#799 git-identity
grouping with zui pin prerequisite). Mirror refreshed to 9b37730.
hoangvu12 added a commit to hoangvu12/roboco that referenced this pull request Oct 6, 2026
Window 69e64ef -> 9b37730 (.scratch/upstream-drift/2026-10-05.md):
five quick ports (zeronsh#757/zeronsh#727/zeronsh#739/zeronsh#763/zeronsh#754), sidebar lane (zeronsh#751 -> zeronsh#737),
mermaid replies (zeronsh#760), todo panel carry-over (zeronsh#707), zui pin sync + git
identity grouping (zeronsh#799 subset, Zeron Icons skipped by decision).
Verification deferred entirely to one wave-final batched pass.
hoangvu12 added a commit to hoangvu12/roboco that referenced this pull request Oct 6, 2026
Upstream c78bb1c + 46bedec (PR zeronsh#751, merge 1c83cda): double-clicking
a session row in the sidebar, or a side-chat row under the file tree,
swaps its title for an in-place field with the name selected. The chat
menu's Rename and the /rename command open the same field. Enter or
blur saves a changed, non-empty title; Escape cancels. The Rename
session modal is removed.

A rename started without touching the row first reveals it — the
collapsed Pinned/Sessions/custom section or device/project group opens
with its usual motion (queue_sidebar_reveal + begin_queued_sidebar_
reveal), the Archived shelf opens and pages to the row, a collapsed
sidebar expands, and the list scrolls the row clear of its edge fades
via a paint-time canvas child. When the row cannot be shown (project
filter, or a side chat of another chat), no field opens and the
sidebar notice says why.

Adaptations recorded in the ticket:
- custom sections are device-local UiSettings here (ADR 0004): the
  reveal expands the settings bucket instead of upstream's synced RPC;
  archived_sidebar_chats carries upstream's parent-chat top-level rule.
- render_chat_row carried by intent onto our diverged row (palette
  namespacing, jump hints, drag previews) — the palette copy never
  renames; editor ids keep the namespaced scheme.
- chat_rename_tests.rs: all 10 upstream tests adapted to the local
  engine-local shell boot (no edge/workos config).

Web parity: dialogs replaced by the inline treatment — new
state/chat-rename.ts (single active rename) and
inline-chat-title-editor.tsx (select-all, Enter/blur commit, Escape
cancel); chat-list rows (incl. archived) take the double-click and the
field; the chat menu's Rename, /rename on the chat page, and the
side-chat pane's /rename (which docks the explorer) all route to the
row; rename-chat-dialog.tsx deleted. The reveal-and-scroll machinery
stays desktop-only (recorded divergence).

Verification deferred to the wave-final batched pass.
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.

3 participants