Skip to content

Rename a session with e - #16

Merged
tdwd merged 2 commits into
mainfrom
session-rename
Sep 23, 2026
Merged

tdwd merged 2 commits into
mainfrom
session-rename

Conversation

@tdwd

@tdwd tdwd commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

A session's title was set once on the new-session form and never again. A
session that turned into different work kept the wrong label on its card, and
told every sibling the wrong thing about itself.

e now reads the focused column the way x and c do: the sessions list
renames the session, the projects list renames the project, and a focused but
empty sessions list falls back to the project. The form carries one required
field, because the title is the only name a session has that nothing is built
on — Name and Branch are in the worktree path and in git, and editing them
here would rename neither.

The coordinator keeps its own copy of a live session, taken when the agent
started, so it is told separately. Title is the only field that can change
after Register, so Retitle closes that gap rather than patching one case of
it. A session whose agent is not running takes the new title from the store
when Register next announces it.

The first commit moves the project rename out of projects.go on its own, so
the second is only the new behaviour.

TestMain came with it

The rename tests call store.Save, and with XDG_STATE_HOME unset that writes
the real ~/.local/state/deck/state.json. go test ./internal/ui replaced a
developer's registered projects with a two-project fixture, and the suite
passed while doing it. TestMain in internal/ui and internal/store points
the state directory at a temporary one for every test in the package, which
protects the test that forgets t.Setenv rather than the one that remembers.

Checked

  • go test -count=1 ./... and make race, both green.
  • Reverted the routing and the Retitle call in turn, and confirmed the two
    tests that cover them fail without the code.

projects.go is registration: the explorer, the path resolution, and the
record that comes out of them. Renaming is the second name a row gets,
and it is about to have a session counterpart, so it moves out whole
before that lands rather than after.
A session's title was set once on the new-session form and never again,
so a session that turned into different work kept the wrong label on its
card and told every sibling the wrong thing about itself.

e now reads the focused column the way x and c do: the sessions list
renames the session, the projects list renames the project. The form
carries one required field, because the title is the only name a session
has that nothing is built on — Name and Branch are in the worktree path
and in git, and editing them here would rename neither.

The coordinator keeps its own copy of a live session, taken when the
agent started, so it is told separately. Title is the only field that
can change after Register, so Retitle closes that gap rather than
patching one case of it.

TestMain arrives with it. The rename tests call store.Save, and with
XDG_STATE_HOME unset that writes the real ~/.local/state/deck/state.json
— a passing suite replaced a developer's registered projects with a
fixture. Per-test t.Setenv protects the test that remembers; this
protects the one that does not.
@tdwd
tdwd merged commit d0992ab into main Sep 23, 2026
3 checks passed
@tdwd
tdwd deleted the session-rename branch September 23, 2026 12:23
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