Skip to content

feat(tui): add session history rail - #49665

Open
14tuanluongk46 wants to merge 3 commits into
anomalyco:devfrom
14tuanluongk46:session-history-rail
Open

14tuanluongk46 wants to merge 3 commits into
anomalyco:devfrom
14tuanluongk46:session-history-rail

Conversation

@14tuanluongk46

@14tuanluongk46 14tuanluongk46 commented Sep 18, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • New feature

What does this PR do?

Adds a fixed, always-visible session history rail on the left side of the TUI, present on every route (home, session, plugin). It lists the current project's root sessions grouped by recency (Today / Yesterday / 7 days / Older), newest first, and supports both mouse (click a row to open it) and keyboard interaction: focus the rail with `j`, move with the existing dialog navigation keys, `/` to search, `ctrl+r` to rename, `ctrl+d` to delete with a two-press confirmation. Subagent and archived sessions are hidden, titles truncate on narrow terminals, and the existing right sidebar is unchanged.

The rail reuses the already-exported `createDialogSessionListQuery` / `loadDialogSessionList` helpers from `component/dialog-session-list.tsx`, so the rail and the existing session picker share one data path; the picker dialog itself is untouched. When focused, the rail pushes a `session_rail` mode onto the mode stack and blurs the editor so its keybinds can't leak into the session view. New keybind definitions live in `config/keybind.ts` (`session_rail_focus`, `session_rail_search`, `session_rail_unfocus`, `session_rail_delete`, `session_rail_rename`).

How did you verify your code works?

`bun typecheck` passes across all 30 packages in the monorepo, and the full TUI test suite passes (195 tests, 0 failures) including a new unit test for the recency grouping helper in `test/component/session-rail.test.ts`.

Screenshots / recordings

Demo recording and screenshots are attached in the comments below. Visually it is a 30-column panel with a panel background on the left edge, group headers in muted text, current session highlighted.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

The search results show that PR #49665 is the current PR being checked. The other PRs found are related to sidebar/rail features but appear to be distinct:

No duplicate PRs found

sync.session.query() is a plain function, so the rail's browse resource
never refetches on its own; sessions created after mount did not appear
until the rail was remounted. Subscribe to session.created and refetch.
@14tuanluongk46

Copy link
Copy Markdown
Author

Demo of the rail in action — animated walkthrough plus focused, search, delete confirm and after-delete states:

demo 2-focused 3-search 6-delete-confirm 7-after-delete

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.

2 participants