Repository navigation
refactor(ui): use native picker and modal rendering - #171591
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
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. |
|
Config-lane CI coordination: the full run for #171890 at This run uses the pinned Bun runtime. The same case passed in scheduled main run Source observation for your investigation: this case dispatches focus immediately after the modal appears, while |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a4df1d6c3
ℹ️ 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".
| } | ||
| </div> | ||
| `; | ||
| return solidContent(ModelPicker, params); |
There was a problem hiding this comment.
Dispose the newly embedded Solid picker roots
After this facade starts mounting ModelPicker through solidContent, every case in ui/src/components/model-picker.browser.test.ts leaves its detached Lit container mounted; its afterEach only clears document.body, while these containers were never appended there. Consequently PickerContent is never disposed and each picker remains strongly retained in the document overlay registry, leaking DOM, callbacks, and overlay state across tests. Track these hosts and call render(nothing, host) during teardown, as the sibling select-picker suite now does.
AGENTS.md reference: AGENTS.md:L50-L53
Useful? React with 👍 / 👎.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* refactor(ui): use native picker and modal rendering * fix(ui): preserve focus on draft copy feedback * fix(ui): keep draft recovery click handlers synchronous * refactor(ui): keep picker and draft view contracts acyclic * chore(ui): retire removed model picker assertion allowance * test(ui): preserve legacy picker template boundaries * test(ui): wait for the focused hovercard mount * test(ui): await plugin action geometry after resizing * test(ui): wait for sidebar after footer removal * test(ui): wait for rendered debug polling samples * test(ui): await new-session route before editing a newer draft * test(ui): dispose picker adapter roots between cases * test(ui): wait for the workspace menu to finish opening * test(ui): bound debug polling work and await terminal readiness * test(ui): record guarded raw config failure boundaries
What Problem This Solves
Model and channel picker helpers still duplicated rendering through Lit, and the imperative modal host retained a Lit renderer beside its native Solid path. File-draft recovery was its last Lit dialog caller.
Use the existing native model/select picker owners, add the native channel picker, and give the modal host one Solid render root. Existing dialog callers use that owner directly. Draft recovery preserves clipboard/download actions, stale-draft authority checks, cancellation, and lazy registration; copy feedback updates the existing button so keyboard focus stays put. Native types live with their Solid views and legacy facades re-export them without import cycles.
The remaining picker facades serve actual legacy callers with their existing opaque-content contract. Tags, classes, selectors, placement restrictions, and lazy boundaries are preserved. No dependencies are added.
Evidence
pnpm tsgo:uipassed on merged candidate4eb084449628bpnpm deadcode:knippassed on final published head0a4df1d6c3db8; no findings or new ignores72789fa; subsequent own changes are reviewed test fixtures and main reconciliation, preserving placement policy. Final Knip covers0a4df1d6c3db838523513039greenThe migration changes production LOC 1,747 → 1,661 (−86) and the five directly changed migration test files 652 → 763 (+111). All changed test files together are 3,801 → 4,013 (+212), including debug, terminal readiness, instant-thread, plugin geometry, sidebar fixtures, and the 69-line bounded Raw-failure diagnostic. Counts use the merged main base
836e6062. Existing browser coverage for draft copy/download/discard/newer edits remains.ci:fullcovers shared picker and modal focus behavior.Exact-head CI run
38548197669at0a4df1d6c3db8passed all three UI unit shards, all nine mocked Control UI E2E shards, both real-Gateway shards, andsecurity-fast. The sole substantive failure ischeck-test-types-core-2:desktop-panel-abandonment.test.ts:50reports TS2322 for readonlyattachedSessionIdsversus mutablestring[]. Its aggregate gate is also red.The original classifier marked that failure NEW against older passing scheduled main run
38543352664. Newer scheduled main run38550286127at00b330babd579reproduces the identical diagnostic in job115806467497. The failing test blob is identical in the actual CI main baseline, tested merge, and newer scheduled main. Native inherited-failure admission retains that exact evidence; failed CI is not described as green.The coupled fixture repairs preserve assertions: dispose raw-Lit picker roots before removing containers; wait for the roster menu's own committed open phase; collect DebugOverlay history in compact mode before expanding for the full chart assertion; and wait for terminal readiness and plugin geometry. Main integration retains
repositoryOnly,allowMachineOverrides, and selectable-target checks while removing the retired modal renderer argument. These corrections passed independent P2 review.Earlier HTML attachment, DebugOverlay, and guarded Raw-config timeouts are not claimed causally fixed by a passing replacement run. The Raw failure retained
form-api/4 after a requestedraw-api/8 edit; its reviewed diagnostic records at most 100 input/owner/DOM snapshots only on failure, preserves assertions and timeouts, and removes observers afterward. The current full runtime run passes those cases. A bounded local three-file Bun attempt was terminated by the repository's no-output watchdog before results; no further local broad runs were used. The diagnostic's local type/lint/runtime gap was left to CI under the shared capacity hold.Screenshots
The exact baseline is
976cc974fab1912c696d1101bd17a1abf05eb77e. The screenshots use the real rendering entry points in a small source-served synthetic fixture. Closed pickers and draft recovery are pixel-identical; the open menu has a small rendering difference confined to the Search placeholder.Before closed model/channel pickers:

After closed model/channel pickers:

Before open model menu:

After open model menu:

Before file-draft recovery:

After file-draft recovery:
