Skip to content

Add Rename to the session menu in the Projects tab - #106

Open
vivi7 wants to merge 1 commit into
doctly:mainfrom
vivi7:feat/projects-rename-session
Open

vivi7 wants to merge 1 commit into
doctly:mainfrom
vivi7:feat/projects-rename-session

Conversation

@vivi7

@vivi7 vivi7 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Rename… to the right-click menu of a session row in the Projects tab, so a session can be renamed there the same way it can in the Sessions tab.

Why

In the Sessions tab a session is renamed from its … menu (Rename session) or by double-clicking its title. The Projects tab lists the same sessions, in the track cards, the archived sections and the session pane beside a running session, but its menu for them had fork, move, mark as unread, archive and the rest, and no rename. To rename a session you were working on from a project, you had to switch to the Sessions tab, find it again, rename it there and come back.

What it does

  • A Rename… item (pencil icon) in the session menu, right before Copy session ID. It is there for every session row the Projects tab draws, since they all share buildSessionRow and sessionMenuItems, and for terminals as well, as in the Sessions tab.
  • It opens the same name dialog the project and track renames use (showPromptDialog), titled Rename session and prefilled with the session's current title.
  • Rename or Enter saves the name and the row updates right away. Cancel, Escape or an unchanged name saves nothing.
  • Typing the session's own title back (its AI title or summary) clears the custom name, so the title follows the CLI's again. That is the rule the inline rename in the Sessions tab already applies.

Implementation notes

  • public/projects-view.js only:
    • new renameSessionFlow(session), next to renameProjectFlow and renameTrackFlow;
    • one entry in sessionMenuItems.
  • It saves through the existing window.api.renameSession / rename-session IPC, so the stored name and the search index title are updated exactly as for an inline rename. It then calls loadProjects(), which refreshes the Projects tab and the Sessions tab together.
  • No changes to the main process, the preload or the CSS.
  • A double-click on the title was left out on purpose. In the Projects tab a single click on the row already opens the session, so a double-click would open it before renaming.

Testing

  • New test/project-session-rename.test.js. It loads the real sessionMenuItems and renameSessionFlow from projects-view.js in a vm context, with stubs, and checks that:
    • the menu has Rename… before Copy session ID, for CLI and terminal sessions;
    • the dialog is prefilled with the custom name, or with the AI title when there is none;
    • a new name is saved and the projects reload;
    • typing the original title back saves null;
    • cancel or an unchanged name saves nothing.
  • Without the change in projects-view.js, all 6 tests fail.
  • npm test: 447 of 449 pass. The two failures (incremental columns upgrade a version-4/12 database… in db-schema-reconcile.test.js) fail the same way on current main on my machine and are unrelated.
  • Manual check on macOS in the running app (electron . with an isolated SWITCHBOARD_DATA_DIR), in a project with one session, from the Projects tab:
    • right-click on the row showed Rename… before Copy session ID;
    • the dialog came up prefilled with the current title, and a new name showed on the row, and in the Sessions tab, as soon as it was confirmed;
    • Escape left the name unchanged;
    • typing the original title back cleared the custom name.

The Sessions tab renames a session from its row menu or a double-click on
the title, but a session row in the Projects tab had no way to do it: its
right-click menu offered fork, move, archive and the rest, but not rename.

The menu now has Rename… next to Copy session ID, in the track cards and
the session pane alike. It opens the same name dialog the project and
track renames use, prefilled with the current title, and saves through
the existing rename-session IPC. As in the Sessions tab, typing the
session's own title back clears the custom name.
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.

1 participant