Repository navigation
refactor(ui): retain picker focus and option refs - #174206
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f29976c960
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return; | ||
| } | ||
| const node = list.querySelector<HTMLElement>("[data-active]"); | ||
| const node = optionElements.get(active() ?? ""); |
There was a problem hiding this comment.
Keep a null highlight distinct from the empty option
When filtering produces no matching rows in a picker that includes the common value: "" option, the menu machine sets active() to null, but this lookup aliases that state to the empty-value row. That row is hidden and has zero bounds, so revealInScrollRegion treats it as above the list and resets scrollTop; the previous [data-active] lookup found no node and preserved the user's scroll position. Guard active() === null before consulting the map so only an actually highlighted empty-value option is revealed.
AGENTS.md reference: ui/AGENTS.md:L36-L40
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR replaces picker DOM queries with retained element refs and removes redundant untracking. Example: Open a native sheet picker using its trigger.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored refactor open; the retained-row lookup introduces a scrolling regression when no enabled option is highlighted. Priority: P3 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe shared Control UI picker receives options and selection callbacks, delegates highlighting to the menu machine, and renders focusable sheets or popovers. flowchart LR
A[Picker callers] --> B[Picker view]
B --> C[Menu machine]
B --> D[Overlay lifecycle]
C --> E[Option refs and scrolling]
D --> E
Technical reviewBest possible solution: Retain the refs while skipping row lookup when the menu highlight is null. Do we have a high-confidence way to reproduce the issue? Source establishes a stable null highlight for disabled-only search results and a hidden empty-value row that the new lookup incorrectly reveals; no browser reproduction was run. Is this the best way to solve the issue? Retained refs fit the repository's Solid guidance, provided null remains distinct from the valid empty-string option. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bffe7345795e. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource -3. Total -3 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel 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 October 16, 2026, 8:39 AM ET / 12:39 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* refactor(ui): bind picker focus and rows through refs * style(ui): brace picker row cleanup condition
What Problem This Solves
The select picker re-finds its own sheet-back button and option rows through DOM queries and wraps unowned callbacks in unnecessary
untrackcalls.User Impact
Focus restoration, keyboard navigation, scrolling the highlighted option, native sheet behavior, and all existing tags and selectors stay unchanged.
Why This Change Was Made
The view retains its sheet-back button and keyed option elements through refs. A retiring keyed row removes only its own entry. Three deliberate untracked reads remain for the native sheet lifetime, synchronous menu-owner trigger identity, and keyed row identity. Microtask, settled, and event callbacks need no extra untracking.
Evidence
SynologyChatAccountRawexport inextensions/synology-chat/src/types.ts; byte-identical logsci:fullNo appearance or layout change; no screenshot delta. Startup raw bytes and lazy boundaries are unchanged. The final braces-only lint correction does not change the reviewed or tested behavior.
Metrics
One production file,
select-picker-view.tsx, against9db9baeb763dc0cdea8ba3979ff0e259ccff8508:loccontrollercreateEffectcreateRenderEffectuntrackaddEventListenerquerySelectorclassStringsflushownerCaptureThe checklist query regex excludes generic calls; actual DOM queries drop 2 → 0. All three effects synchronize the native overlay/scroll state.
Full CI attribution
Full run 38900282625 failed only
chat-provider-review.e2e.test.ts > Control UI mocked Gateway E2E > reviews provider findings before explicit continuation and waits for the authoritative row(plus the aggregate): it timed out at line 115 waiting for the continuation RPC after a plain dialog button click. That exact test passed scheduled main run 38894297213, job 116951151480, in 2119 ms. This is not an identical inherited failure.Source/flow review supports an unrelated provider-review timeout. The actual tested merge
ab63d311d4e562bae22be643a9a226608c21ff01has ordered parents242fff2254ebc47baf01a05e7814e6de40d25861and this PR head. The provider-review owner/helper/test, modal adapter/renderer, overlay lifecycle and registry have identical blobs on that base, tested merge, PR head and passing main. This flow never opens a picker. The changed refs are local to each picker; the removed untracking surrounds settled/microtask/open callbacks and does not alter the dialog or its RPC admission.The public timeout capture shows a connected, ready page, a paused composer and no browser crash; it does not identify which live admission check or click step failed. No E2E replay was used to claim a fix. The native admin evidence preserves this uncertainty, the passing-main result, the exact failure and the separate investigated local Knip failure.