Skip to content

feat(tui): show pinned sessions in the session list when tabs are enabled - #60237

Open
sitole wants to merge 2 commits into
anomalyco:devfrom
sitole:pinned-sessions-tabs
Open

sitole wants to merge 2 commits into
anomalyco:devfrom
sitole:pinned-sessions-tabs

Conversation

@sitole

@sitole sitole commented Oct 29, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #60236
Fixes #52794 — the same symptom, reported as a bug.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

#39396 made tabs replace pinned quick slots and hid pins from the session list. Only quick slots collide with tab keys. The Pinned category does not.

In packages/tui/src/component/dialog-session-list.tsx, the Pinned category and ctrl+f pin action now work with tabs enabled. Quick slots stay disabled under tabs, and gutter slot numbers stay hidden.

Pins outside the fetched page of 50 sessions are read from the local session store. A createEffect calls data.session.sync(sessionID) for pinned IDs missing from the store, which fetches GET /api/session/{id}. A pin that returns 404 (deleted elsewhere) is skipped.

The scope filter (current directory vs. all projects) still applies to pins. During a search, only pins in the search results appear, as before. This uses the existing session.json pins. No new state, protocol, or server changes.

How did you verify your code works?

Added a test to packages/tui/test/cli/tui/dialog-session-list.test.tsx. With tabs enabled, session.json pins ses_old, the list endpoint returns only ses_recent, and GET /api/session/ses_old returns the old session. The frame shows "Old pinned session" under "Pinned" and "Recent session". The test fails when the store fallback is removed.

In packages/tui:

  • bun check --no-script -b: clean.
  • bun test test/cli/tui/dialog-session-list.test.tsx test/config.test.tsx: 16 pass, 0 fail.
  • bun run test (whole package): 1564 pass, 2 skip, 1 fail. The failure is test/component/go-upsell-art.test.tsx and fails the same way on dev without this change.
  • The test also pins a session that the server returned from another worktree of the same project. It must stay under Pinned, not under its date. This covers the review fix in 99fef80.
  • Root bun run lint: clean.

Not tried interactively with bun run dev:live.

Screenshots / recordings

None. The change adds a list category that the test covers.

Checklist

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

Added by the opencode bot (AI-generated).

Fixes #52794

Related: #59938

…bled

Tabs replaced the pinned quick slots because <leader>1-9 collides with
ctrl+1-9. The Pinned category in the session list and the ctrl+f pin
action never collided, yet they were hidden too, and pins saved before
enabling tabs became unreachable.

Pins that fall outside the fetched page of 50 sessions are now read from
the local session store, synced on demand, so an old pinned session does
not drop out of the Pinned category.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With tabs on, the Pinned category and ctrl+f now work and quick slots stay hidden. I checked this in the TUI with opencode-drive: on the base, ctrl+f does nothing and there is no pin hint; with this change the session moves under "Pinned" (screenshots below). The dialog test passes. The type check gives the same errors as the base, none in the changed file.

Public API: unchanged. This only changes the TUI dialog, and session.json keeps its format.

One behaviour change is worth fixing (see the inline comment). The scope filter now also applies to pins the server already returned, so for users without tabs, some pins that used to show under Pinned now show under their date.

Fixes #52794
Related: #59938

Before

After

The server scopes the fetched page by project and subpath, so a pin
from another worktree of the same project was dropped from Pinned by
the directory check that only the store fallback needs.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit addresses the scope-filter point. Pins the server already returned now always stay under "Pinned", and the directory check applies only to pins taken from the local store. The updated test covers a pinned session from another worktree. The dialog test passes. The type check gives the same errors as the base, none in the changed file. A re-run in the TUI with tabs on still shows "Pinned" and pin/unpin ctrl+f.

Public API: unchanged.

No further concerns.

Before

After

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant