"..." on the session title should provide a menu of quick actions on sessions #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
required actions:
Implemented in
3508758.All six actions are reachable from a
...button, which now exists on every session row in the sidebar and next to the title in the chat header. The menu opens as a sheet listing only the moves that apply to the session's current state.Lifecycle is one enum, not two flags.
SessionState { Normal, Pinned, Archived }lives in a singlestate TEXTcolumn with aCHECKconstraint (migration20260725120000_add_session_state), following the existingreasoning_modepattern. TheSession.statefield is private, so the typed accessor is the only way to read it and a pinned-and-archived session cannot be constructed or observed. This replaced an earlier two-boolean draft that needed an "archiving clears the pin" fixup in the DB layer — the fixup was the tell that these are states, not flags.Per action:
Database::rename_session.Sidebar ordering is pinned → normal → archived, sorted by
SessionState::rank()with a stable sort so creation order is preserved within each group. The› Archived sessions (n)row renders only when a project actually has archived sessions, and expansion is tracked per project. Pinned sessions carry a small pin glyph so the group boundary is visible.The one-shot mechanism (reused by #4).
App::request_titleloads the session's stored messages, appends a short title instruction, and runs the turn withreasoning_mode = Directand a 48-token cap. It goes through a newCheckpointTarget::OneShot, which shares the transient content-addressed KV cache with the HTTP endpoint: no session row, no per-session checkpoint, nothing left behind but cache entries that were already shared infrastructure.OneShotis a new variant rather than a reuse ofTransientfor one reason worth recording:Transientreports asWorkSource::Httpin metrics, so reusing it would have logged every AI retitle as endpoint traffic in the Stats tab.OneShothandles KV identically but reportsLocalChat. That distinction matters more once #4 lands and every new session triggers a title request.The reply is reduced to a sidebar-sized line by
session_title: first non-empty line, surrounding quotes and markdown stripped, truncated at 60 characters with an ellipsis. A reply that yields nothing usable surfaces an error instead of writing a blank title.Tests — state exclusivity and rank ordering, title sanitizing including the truncation and empty-reply paths, and a database round-trip covering state ordering, rename validation, and the archive-a-pinned-session transition. 44 passing.
cargo fmt --check,cargo clippy --all-targets --all-features -D warnings,make bundleandcargo test --all-featuresall clean.Not verified visually. The app was not launched, so the sheet's proportions and the two new icons (
pin.svg,archive.svg) have not been looked at on screen — worth a glance, particularly the pin glyph at 12px in the sidebar row.