feat(web): rename tasks from the banner#7
Conversation
Task titles are auto-generated from the first user message and drift out of date as long-lived tasks evolve, leaving the sidebar hard to navigate. Add a Rename button to the banner (next to the session buttons) that swaps to an input pre-filled with the current name; Enter or the Apply button commits, Escape cancels, and empty names are ignored. The input pre-selects the name so typing replaces it immediately, and its width tracks the typed string (field-sizing: content where implemented, with the size attribute as an approximate fallback, both floored at the default 20-character width). On the backend, a rename_task websocket message updates the title in memory and SQLite and rebroadcasts it via the existing title_update path, so the sidebar and all connected clients update live.
Title generation runs as an async one-shot after the first message; its completion handler applied the generated title unconditionally, so a manual rename issued while generation was still in flight would be clobbered when the one-shot landed. Capture the title at generation start and apply the result only if the title is still unchanged. Add an e2e spec covering the rename flow end to end against each agent (it surfaced this race): the input opens pre-filled with the current title, Enter and the Apply button each commit a new name to the sidebar, Escape cancels without renaming, and the renamed title survives a page reload, proving it came back from the server store.
|
Added e2e coverage in Writing the test surfaced a real race, fixed in the same commit: title generation runs as an async one-shot after the first message, and its completion handler applied the generated title unconditionally, so a manual rename issued while generation was still in flight would be clobbered when the one-shot landed. The handler now captures the title at generation start and applies the result only if the title is still unchanged. Full |
Task titles are auto-generated from the first user message, and on long-lived tasks they drift out of date as the work evolves, which makes the sidebar hard to navigate once a few tasks have outgrown their opening prompt.
This adds a Rename button to the banner (next to the session buttons). Clicking it swaps the button for an input pre-filled with the current name:
field-sizing: contentwhere implemented, with thesizeattribute as a character-approximate fallback, both floored at the default 20-character input widthOn the backend, a
rename_taskwebsocket message updates the title in memory and SQLite and rebroadcasts it through the existingtitle_updatepath, so the sidebar and all connected clients update live. The exported static viewer is unaffected (no handler is passed there, so the button does not render).Tested with the full
nix flake checksuite.