GeezerVison is showing github.com — refactor(app): share session index and project actions by joe-ieta · Pull Request #62845 · anomalyco/opencode
Conversation
joe-ieta
commented
Nov 9, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Shared navigation infrastructure from #60867; design context: #60241. This combines the bounded session-index extraction with the project-actions extraction previously reviewed in #62850. The Running component remains separate in #62851.
Type of change
- Refactor / code improvement
What does this PR do?
Home owns session-index and project-action modules that are also used by shell navigation and settings. Move these reusable modules to shared locations so callers no longer depend on Home internals:
- Move the bounded session index and query to
runtime/server, incorporating upstream's existing root-index merge helper. Home-specific project queries and session lookup stay in Home.
- Move project menus, actions, the import state machine and directory helpers to
shell/projects. Directory selection requires the caller's onSelect callback, preserving Home's existing project-add queue and authentication flow.
- Update Home, project history, settings, Side tabs, Inbox helpers and recently closed tabs to use the shared modules.
Preserve the 500-root-session request, array result, query key/cache lifetime, per-directory retention, upstream recency rules and visible menu behavior. The diff against dev is 25 files, 164 additions and 160 deletions, primarily moves, names and imports. No feature flag is needed for this internal refactor. Running and the proposed Side bar interface mode remain outside this PR.
How did you verify your code works?
Validated the review fix at b696d7a81d, based on official dev at d33b5783338b8b350aafc09f7dc2701eeba52a9a (2026-11-19).
bun run check: 35/35 tasks passed.
- App unit suite: 2,773 passed, 0 failed.
- Production app build passed.
- Chromium production-build regressions: 4/4 passed, two workers, no retries. Covered project menus, worktree selection, directory selection and re-pairing a signed-out server before adding projects.
Windows checks used local-only equivalents for the declaration symlink and CSS lint path normalization; neither workaround is in the commits. The production build was completed separately before starting the isolated browser test server. No performance result is claimed.
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 9, 2026
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.
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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Updated to b69665da42f15513432c08875fb1ff51d07f9229, merging official dev at a86ac3f1b9. Upstream added a same-named session-index module, so this merge combines them while preserving upstream's recency rules. Project-specific queries stay in Home; the new project history browser and customized sidebar use the shared index.
Validation on the updated head: full bun run check (35/35), app units (2,773/2,773), and all 94 Chromium Home/tabs regressions on a production build with no retries. The PR body has the details; local Windows validation workarounds are excluded from the commit. The previously removed unused inventory/cache side effects remain absent.
The standards checks passed and GitHub reports the branch mergeable. The fork workflows, including check-test and check, require maintainer approval (action_required). Please approve those runs and complete the final review when available. All previous review threads are resolved.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
The update onto current dev keeps this a pure move and rename. The shared index now sits next to mergeRootSessionIndex and keeps Home's archived filter. sessionIndexQuery is unchanged from homeSessionsQuery (same key and cache lifetime). Home-specific project queries stay in Home, and the new dev callers (browse-view.tsx, sidebar-customized.tsx) are updated. I compared the removed and added modules, checked that no old references remain, and ran the app's tsc -b (passes) and the index, sidebar and Home tests: the only 2 failures also happen on the base. Public API: unchanged (internal app modules only). No further concerns.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
joe-ieta
changed the title
refactor(app): share the bounded session index
refactor(app): share session index and project actions
Nov 19, 2026
|
The two small shared-infrastructure extractions are now consolidated here at cf0814f8d202755c03ca5299f0e7c52fa30b4cca; #62850 is closed as superseded, with its branch and review history retained. This remains a 25-file refactor (171 additions / 160 deletions against dev), while Running stays separate in #62851 and the proposed Side bar mode remains outside this PR.
Validated the combined head against dev d33b578333: full bun run check 35/35, App unit tests 2773/2773, production build and 15/15 Chromium regressions passed (two workers, no retries). The PR description contains the covered paths and local Windows validation details.
Existing review threads are resolved. The new check-test run and other required workflows are waiting for maintainer approval (action_required). Please approve the workflows and review the consolidated refactor when available.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
The added project-actions move looks behaviour-neutral, like the session-index part, which is unchanged since my last review. import-machine, add, reveal, file-manager and menu are moved without changes, and every caller is updated. The shared choose keeps Home's flow and reads server health from the same source. Its new empty-selection check doesn't change anything, because Home's machine already ignores an empty add. I checked this by reading the diff and grepping for old paths. I also ran the app's tsc -b (passes) and the project, index and Home machine tests: the only failure also happens on the base branch. Public API: unchanged (internal app modules only). One small concern inline: the unused direct-add fallback in choose.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
The new commit addresses my earlier point: choose now requires onSelect, and the direct addProjects fallback is gone. Selected directories always go through the caller's add path, which for Home is its project-add machine. The app's tsc -b passes and the shell/projects tests pass. Public API: unchanged (internal app modules only). No further concerns.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The review fix at b696d7a81d is validated and the reviewer has confirmed there are no further concerns. Full lint/typecheck, 2,773 app unit tests, the production build and four affected Chromium regressions pass. The updated check-test run and other required workflows still need maintainer approval before the existing human review can proceed.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
|