Skip to content

feat(search): Search sessions finds archived sessions, dimmed (opencode#66356) - #1232

Merged
Hona merged 3 commits into
devfrom
upstream-f/search-archived
Nov 26, 2026
Merged

Hona merged 3 commits into
devfrom
upstream-f/search-archived

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Ports opencode#66356 (45277af6cf, UP-238): Search sessions finds archived sessions, dimmed.

What changes

  • A typed search also finds archived sessions. Their rows are dimmed, title and description at 70% (packages/app/src/shell/commands/dialog.tsx:261, :267), and open the session like any other row (session-search.tsx:76-86): nothing is restored.
  • With nothing typed the recent rows never list an archived session (packages/app/src/shell/commands/palette.ts:386, :435-441).
  • Each server is asked for two pages of 50, its sessions that are not archived and its archived ones. Archiving moves a session's time, so one list would let sessions archived lately crowd the others out. A failed archived page drops only those rows (session-search.tsx:34-42).

The same holds for the session rows of Quick Open, which is this app's session search with projects ahead of it.

How

  • features/switcher/src/entries.rs: a row knows whether its session is archived (Entry::archived); Listed says which sessions a search lists and which a server is asked for.
  • features/switcher/src/servers.rs: found is the one place a server is asked (the window's own server and the others used two copies of it). Both pages and a pasted id go out at once, as official's Promise.all; in the browser build one after another.
  • features/switcher/src/search_index.rs, session_index.rs: the loaded sessions' index answers a typed session search with archived ones among them (Scope::Sessions); one typed letter still takes the prepared rows.
  • features/switcher/src/view.rs: a row dims by its own session, not by the dialog's mode.

Verification

  • All 6/6 cases passed on Windows x64 PR build (39af4528d, run 45646053572) beside a before build (cc991c6505, run 45629508899):
    • Case 1 (nothing typed): 10 recent rows, archived session omitted on both builds.
    • Case 2 (typed query matching archived title): dimmed row shown with title and description at 70% (#fafafab3 / #808080b3), time and badge undimmed; before: no row.
    • Case 3 (press dimmed row): closes dialog and opens the session in a tab while keeping it archived.
    • Case 4 (live server, single server search): sent 2 concurrent requests (GET /api/session?parentID=null&archived=false&limit=50&search=... and archived=true&limit=50&search=...) and rendered the dimmed archived match (#fafafab3 / #808080b3, time #aeaeaeff); before: 1 request (archived=false), 0 rows.
    • Case 5 (live server, two servers): sent both archived=false and archived=true requests to both servers and rendered both dimmed rows with the second server's name.
    • Case 6 (command palette): finds no archived session on both builds.
  • Forward-merged origin/dev into branch (798e70ac3a, 0 overlapping files) to verify cleanly on the current Rune pin before merge.
  • Not run: real window, macOS, Linux.

@Hona
Hona marked this pull request as ready for review November 26, 2026 06:31
@Hona
Hona merged commit 55186e2 into dev Nov 26, 2026
7 checks passed
@Hona
Hona deleted the upstream-f/search-archived branch November 26, 2026 06:31
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