Skip to content

feat(inbox): archived sessions that need attention, the archive toggle and Unarchive session (opencode#66327) - #1189

Merged
Hona merged 3 commits into
devfrom
upstream-f/inbox-archived-attention
Nov 25, 2026
Merged

Hona merged 3 commits into
devfrom
upstream-f/inbox-archived-attention

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Ports opencode#66327 (acce96c36e): the Inbox sidebar's archived sessions that need attention, the archive toggle, and its session shortcuts.

What changes

  • An archived session that waits on a person joins Needs attention. A permission to decide or a question to answer puts it there until it is answered; meanwhile it is left out of Archived and its card is not dimmed (packages/app/src/shell/titlebar/inbox.tsx:142, :157, :895; inbox-model.ts:523 inboxWaiting). Ours: apps/desktop/src/session/inbox/model.rs (inbox_sections_with, Entry::waiting), apps/desktop/src/shell/view/inbox.rs (the card's dim).
  • Archive session toggles. The command and its shortcut (mod+shift+s) archive the open session, and bring it back when it is archived (packages/app/src/session/commands/use-session-commands.tsx:609-614). Ours: apps/desktop/src/session/menu.rs, App::open_root_archived in shell/commands/mod.rs.
  • A new command, Unarchive session (use-session-commands.tsx:617, en.ts:127), enabled on an archived session; no shortcut of its own. Ours: session.unarchive, its place in shell/commands/order.rs, the string in crates/opencode-i18n/locales/official/en.json.
  • The session shortcuts over the Inbox's rows (inbox.tsx:178-210, tab-strip.tsx:379). Ours already stepped through the Inbox's rows in the same order as official's navigationKeys. Three things now follow official's code:
    • Previous / Next unread session (shift+alt+up / down) stop on a row whose result waits to be read, done or failed, and no longer on one that waits on a person (inbox.tsx:199).
    • A numbered pick (mod+1..9) scrolls the row into view, just far enough; stepping does not (tab-strip.tsx:452, :392).
    • Each row is named by its key across servers. It was named by its session id alone, which is not the key of a session on a server other than the app's own, so there the open row was never found among the rows: alt+up / down started from the first or last row every time, and shift+alt+up / down did nothing. By reading.

A fault of ours, found by a run and fixed here

The Archive session shortcut (mod+shift+s) never reached its command. The command names its key (so the palette shows it), but the table that sends a pressed key to a command had no line for it (apps/desktop/src/shell/input/shortcuts.rs, TABLE); it has been so since the command was added. A run pressed the key on this PR's build and on a build of dev, and nothing happened on either. The line is added, so the key archives the open session and, with this port, brings an archived one back.

How it differs from official

  • A refused archive or unarchive. Official asks the server first and changes nothing when it refuses, with a toast (use-session-commands.tsx:359-391; the Inbox's own menu the same at inbox-model.ts:478-492). Ours moves the session at once and then writes. A refusal shows the toast in ours too (features/session-menu/src/lib.rs:500-502 for an unarchive, apps/desktop/src/session/events/incoming.rs:110-116 for an archive), but the session keeps showing as moved: nothing puts it back, and the archived list is read once per run (apps/desktop/src/session/inbox/model.rs ArchivedFetch). Ours' Archive and Unarchive worked so before this change; the toggle and the new command call the same two functions (archive_session, unarchive_session in that file). It needs nothing from Rune: a follow-up PR. By reading.
  • An archived session the window does not hold. The two commands are off for an open session that is neither among the window's sessions nor on its archived list (the newest archived sessions of its server); official reads the open session's own record (use-session-commands.tsx:347-351). By reading: such a session opens from the Inbox's Archived group, which is that list.

Run

Headless, on this PR's own Windows x64 CI builds beside a build of dev without the change, against a fixture server, in the Inbox layout; for the third case with a second server added by address. Cases 1 and 3 ran on head 9efd85cc6, one line before the final head (the shortcut's line in the key table); case 2 on the final head d8835d52b.

  1. An archived session that waits on a person. A session with a question waiting and one with a permission waiting, each then archived: both stand under Needs attention, undimmed, and not under Archived; an idle archived session stands under Archived, dimmed. After the permission was answered that session is back under Archived, dimmed. Before: no Needs attention group; both under Archived, dimmed.
  2. Archive and back. mod+shift+s on an open session archives it: it goes under Archived, its tab closes, the toast offers Undo; the same with the focus in the composer, on the session's card, after Escape and after shift+Tab. On an open archived session it brings it back among the recent rows, still open. Unarchive session from the palette does the same, and the palette lists it only for an archived session. Before: the key did nothing (the fault above).
  3. The session shortcuts on a second server. alt+down from one of its rows opens the row below; before, the first row of the list. shift+alt+down goes to the next row with a result to read and passes four rows that wait on a person; before, nothing from a second-server row, and a stop on the first waiting row from the app's own. mod+5 with the list scrolled away brings the fifth row just into view; alt+down from there opens the next row and does not scroll.

Not run: a real window; a refused archive or unarchive; the Undo in the toast; shift+alt+up and alt+up; a failed row; an archived session the window does not hold; macOS and Linux (compiled only).

Seen in the run and not part of this change: two servers that are one server list every session twice with the same times, and rows that tie stand with the active server's first, so a step to the other server's row reorders them. Official orders ties by the servers' listed order (inbox-model.ts:164-228). A follow-up PR.

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.

1 participant