Skip to content

refactor(app): share the bounded session index - #62845

Open
joe-ieta wants to merge 2 commits into
anomalyco:devfrom
joe-ieta:session-index
Open

joe-ieta wants to merge 2 commits into
anomalyco:devfrom
joe-ieta:session-index

Conversation

@joe-ieta

@joe-ieta joe-ieta commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Part 1 of the split requested in #60867; design context: #60241.

Type of change

  • Refactor / code improvement

What does this PR do?

Move the bounded session index and query from Home into runtime/server, with neutral names shared by Home, Side tabs, Inbox helpers and recently closed tabs. Preserve the existing array result, query key/cache lifetime, 500-root-session request and per-directory retention.

Following review, defer the loaded-session inventory and its deletion projection to the follow-up that actually consumes them. This PR now contains only the module moves, renamed symbols and updated callers/tests.

How did you verify your code works?

On this branch: bun run check (33 tasks), bun run lint:changed upstream/dev, app bun run typecheck:tsc, 12 index/deletion tests repeated ten times, and all 80 Chromium Home/tabs regressions without retries.

Windows validation uses an equivalent temporary import for the repository's custom-elements.d.ts symlink; it is not committed. Upstream fork CI awaits maintainer workflow approval (action_required).

Checklist

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

Added by the opencode bot (AI-generated).

Related: #55301

@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 move of the bounded session index into runtime/server looks behaviour-neutral. The query key is still ["home-sessions", conn], so the cache is the same one as before. The 500-row request and per-directory retention are unchanged, and every caller was updated. I checked this by reading the diff, running the moved index tests and data.test.ts (12/12 pass) and the app's tsc -b (passes). The 3 titlebar test failures also happen on the base branch.

Public API: unchanged (internal app modules only).

The main concern is the new loaded-session inventory (details inline):

  • Nothing in this PR reads it, and filterRemoved and SessionInventory are unused too. For a split whose parts should each stand alone, I'd drop these and add them in the PR that uses them.
  • The way it's cached would make it unreliable for that follow-up.

Related: #55301

Comment thread packages/app/src/runtime/server/data.ts Resolved

@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 my earlier points: the inventory cache write, the QueryClient parameter, filterRemoved and SessionInventory are gone. The PR is now only the module move and renames, with callers and tests updated. The query (key ["home-sessions", conn], cache lifetime, 500-row request, per-directory retention) matches the base. I ran the index, data and sidebar-session tests (22 pass) and the app's tsc -b (passes). Public API: unchanged (internal app modules only). No further concerns.

@joe-ieta

joe-ieta commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Could a maintainer please approve the pending fork CI workflows for this PR? The required checks are waiting for approval (action_required); local validation is documented in the PR body. Thanks.

@opencodejr

opencodejr Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Thanks, confirmed at 739ac31:

  • runtime/server/data.ts and data.test.ts now match the base, and filterRemoved is gone.
  • loadSessionIndex returns the retained session array again, with no inventory and no SessionInventory type.

I have nothing further on these threads.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant