Repository navigation
refactor(ui): skip rescanning unchanged worktrees - #207398
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: passed. What this changesThis PR narrows Worktrees rendering updates to inventory changes and lazily derives repository choices. Example: Display 64 worktrees across four repositories, then receive five unchanged Gateway notifications.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this useful maintainer-authored draft open; the focused optimization preserves inventory updates, and no actionable introduced defect was found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI Worktrees model accepts Gateway inventory responses; its reactive projection supplies activity-ordered rows and repository choices to the page. flowchart LR
A[Gateway inventory] --> B[Worktrees model]
C[Gateway notifications] --> B
B --> D[Owner projection]
D --> E[Records memo]
E --> F[Worktree rows]
E --> G[Lazy repository choices]
Technical reviewBest possible solution: Keep the narrow records memo and lazy repository derivation with the existing model retaining inventory ownership. Do we have a high-confidence way to reproduce the issue? Current-main source shows every owner notification invalidating the repository scan through view().records; this read-only review ran no target code. Is this the best way to solve the issue? The change uses the existing immutable inventory boundary and supported lazy-memo pattern without introducing another store, request path, or invalidation mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ca6d4ca74a87. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +3, Tests +33. Total +36 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 28, 2026, 4:01 AM ET / 09:01 UTC. |
…207547) ## Problem `ui/src/e2e/linked-session-navigation.e2e.test.ts:76` fails on main in `checks-ui-e2e (6/10)`: both cases time out after 30 s waiting for the worktree owner "Session" link to be visible. Log signature (CI run 46147302963, shard 6): `locator.waitFor: Timeout 30000ms exceeded … waiting for locator('openclaw-worktrees-page').getByRole('link', { name: 'Session', exact: true }) to be visible`. The failure looked order-dependent, but it is not. The file fails alone on main 440945f. #203716 (1a05dca) moved the owner link into the row's collapsed `<details class="worktree-row__details">` (`ui/src/pages/worktrees/worktrees-page.tsx:315-328`) and did not update this test. The CI failure screenshot shows the row collapsed with the link hidden. Main CI skips ui-e2e through changed-file selection, so the red shows only on PRs that select the shard. ## Solution The test now opens the row's repository details, as a user does, before it waits for the link. The click and href identity checks do not change. ## Impact - Test-only. No product change. - Users: no change. With #203716 the owner Session link is one disclosure click away. This PR keeps that design. Putting the link back outside the disclosure is a separate product decision. ## Evidence - Red on main: alone on 440945f, 2/2 cases time out at the same locator. - Green on this branch: `linked-session-navigation.e2e` 2/2 and `worktrees.e2e` 9/9. - `pnpm check:changed`: typecheck, lint and format pass. The dead-export scan fails on 5 existing main exports that this PR does not touch. - Shard proof: the 109-file CI shard-6 set, run locally 3 times on this head. `linked-session-navigation.e2e` passed 2/2 in every run. Two runs passed 109/109. The third run, on a heavily loaded host, failed 3 unrelated files: two initial-roster load timeouts and an `openclaw-id-menu.e2e:178` geometry check, which is tracked separately. - PR CI: `checks-ui-e2e (1/2)` ran `linked-session-navigation.e2e`, and it passed 2/2. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 27036be) Companion audit: #207883 adds worktree cleanup statuses, not delete-dialog path identity. #207398 optimizes scans, #207547 checks owner navigation, and #203819/#201422/#207982/#207579 touch styles, strings, or other fixtures; no prerequisite established. Co-authored-by: RomneyDa <[email protected]>
* fix(worktrees): identify the checkout before deletion Co-authored-by: vyctorbrzezowski <[email protected]> * fix: show the exact checkout before deleting a worktree Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 4b537414-6701-8ad6-bf14-7f1def12956c * fix: keep exact checkout identity in compact worktree rows Co-authored-by: vyctorbrzezowski <[email protected]> * fix: satisfy lint in the touched test * fix: satisfy lint in the Worktrees page * fix(ui): reuse Settings layout constraints for worktree rows --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> (cherry picked from commit 1a05dca) Companion audit: #207883 adds worktree cleanup statuses, not delete-dialog path identity. #207398 optimizes scans, #207547 checks owner navigation, and #203819/#201422/#207982/#207579 touch styles, strings, or other fixtures; no prerequisite established. Release adaptation: Use stable list records for repository labels, keep stable create and removal behavior, and show the exact checkout in both existing confirmation dialogs. Co-authored-by: RomneyDa <[email protected]>
* refactor(ui): skip unchanged Worktrees inventory scans * test(ui): follow Worktrees repository disclosure markup
What Problem This Solves
The Worktrees tab walks every checkout to rebuild its repository choices whenever the page receives a Gateway snapshot, even when the worktree list has not changed and the chooser is closed.
User Impact
The same rows appear in the same activity order. Opening the repository chooser still shows each path once, and refreshing the worktree list updates both the rows and the choices. No action or migration is required.
Why This Change Was Made
The page model already replaces the records array on a successful list read or a Gateway identity change. The view now observes that array rather than treating every page notification as a new inventory. It builds the repository choices only while they have a consumer, keeping the first occurrence of each path. No Gateway request, worktree operation, or owner lookup changed.
Related: #199323 (repository choices on the Worktrees tab).
Evidence
Mounted the production Worktrees view with the same synthetic Gateway, 64 worktrees across four repositories, and five notifications that reported the connection was still up. The same worktree button stayed mounted and both revisions made exactly one list request.
These are field-read counts, not elapsed-time measurements. The focused regression also replaces the inventory and checks that the new repository appears in both the row and the chooser, without the old option. On the parent it detects one unnecessary read after one unchanged notification; on the candidate it detects none.
c82f0f3bce35(6.03 s wall time). Focused TypeScript, lint, formatting, and diff checks passed. The production delta is +11/−8 lines; the single regression adds 33 test lines. No layout, copy, or styling changed.d79f9830c07c..c82f0f3bce35; it reviewed the diff and supplied model, projection, and chooser sources, without running code.🦞 Made with OpenClaw