GeezerVison is showing github.com — feat(app): order side tabs by recent activity by juanfradb · Pull Request #60270 · anomalyco/opencode
Conversation
juanfradb
commented
Oct 29, 2026
•
edited by opencodejr
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Related: #58136 (earlier attempt, auto-closed for template compliance), #55797, #50086
Type of change
What does this PR do?
The vertical rail is the app's persistent conversation list, but it followed the order tabs were opened in: a session started today landed at the bottom, below the fold once the rail overflows, while the chat you were in last sat furthest from the top. The rail now orders tabs by their last activity.
appearance.tabOrder (recent or opened) makes this configurable, with a row in Settings → General next to the interface mode. Unset follows the layout: recent for side tabs, opened for the top strip. opened keeps today's behavior, drag reordering included; recent has no manual order for a drag to change, so the drag sensors are off there.
- The sort key is
time.idle (end of the last finished run), falling back to time.updated for sessions that never finished one, so a chat you are in does not jump to the top mid-turn. Drafts stay first, tabs whose session has not loaded yet sort last, and ties keep the stored order.
- Navigation reads the same list:
alt+arrow, mod+1..9, tab cycle and unread jump follow what is on screen.
How did you verify your code works?
bun test src/settings/model.test.ts src/shell/titlebar/tab-order.test.ts in packages/app: 27 pass.
tsc -b in packages/app: clean.
bunx playwright test e2e/regression/tabs.spec.ts: 36 pass. The two mobile-drawer legs fail the same way on dev with these changes stashed. Two tests that drag vertical tabs now seed tabOrder: "opened", since the drag belongs to the manual order, and a new test covers the default: side tabs render newest-first from seeded time.idle values, and the top strip keeps the opened order.
Screenshots / recordings
Not attached. The new regression test asserts the rendered row order in both layouts.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Added by the opencode bot (AI-generated).
Related: #50086
Public API: adds the optional appearance.tabOrder app setting ("recent" | "opened"), backwards compatible
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The vertical rail is the app's persistent conversation list, but it followed
the order tabs were opened in: a session started today landed at the bottom,
below the fold once the rail overflows, while the chat you were in last sat
furthest from the top. It now orders tabs by the last meaningful activity.
`appearance.tabOrder` (`recent` or `opened`) makes that order configurable and
follows the layout until picked: `recent` for the side tabs, `opened` for the
top strip. `opened` keeps the browser convention, drag reordering included.
The sort key is the last finished run (`time.idle`), falling back to the last
update for sessions that never finished one, so a chat you are in does not
jump to the top mid-turn. Drafts stay first, tabs whose session has not loaded
yet sort last, and ties keep the stored order. Navigation (alt+arrows,
mod+1..9, tab cycle, unread jump) reads the same order the strip shows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as described. I ran the tab end-to-end tests in headless Chromium against both branches. With three seeded sessions, the base branch shows the side rail as A, B, C and this PR shows C, B, A. The new test fails on the base branch and passes here. tabs.spec.ts gives 36 passes and 2 failures, and the 2 (mobile drawer) also fail on dev. Unit tests (28) and tsc -b pass.
Public API: the only change is a new optional client setting, appearance.tabOrder ("recent" | "opened"). It's backwards compatible: older saved settings still load, and unknown values fall back to the layout's default.
Two things worth addressing (inline):
- Closing the active tab in
recent mode still picks the next tab from the saved order, so focus can jump far away in the rail.
- Leaving
tabOrder unset means existing side-tab users switch to recent on upgrade, which re-sorts their dragged order and turns off dragging.
Smaller point: the settings row shows in every layout and also changes the top strip, though its description only mentions the side tab list.
Related: #50086


Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
return session.time.idle ?? session.time.updated
|
|
|
}
|
|
|
|
|
|
const orderedTabs = createMemo(() => (recentOrder() ? orderTabsByRecency(props.tabs, activity) : props.tabs))
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keyboard navigation now follows orderedTabs(), but closing the active tab doesn't. removeTab in shell/tabs/tabs.tsx uses nextTabAfterClose(store, index, …), which picks the neighbour in the saved order. In recent mode that can be a tab anywhere in the rail rather than the row next to the one you closed. The close path probably needs the displayed order (or a sorted neighbour lookup) when tabOrder is recent.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
export type TabOrder = "recent" | "opened"
|
|
|
|
|
|
/** An explicit order wins; otherwise the side tabs follow activity while the top strip keeps the opened order. */
|
|
|
export function resolveTabOrder(tabLayout: TabLayout, tabOrder: TabOrder | undefined): TabOrder {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When tabOrder is unset, it follows the layout. So every existing side-tab user switches to recent on upgrade: tabs they arranged by dragging get re-sorted, and dragging stops working until they find the new setting in General. That's a behaviour change for current users, not only new ones. Maintainers should confirm this default is intended. If it isn't, one option is to keep opened for people who already have a saved vertical layout.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 4, 2026
This branch has not been deployed
No deployments
Reviewers
Hona
Awaiting requested review from Hona
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|