Skip to content

refactor(ui): use native picker and modal rendering - #171591

Merged
steipete merged 18 commits into
mainfrom
solid2/rest-picker-adapters
Oct 14, 2026
Merged

steipete merged 18 commits into
mainfrom
solid2/rest-picker-adapters

Conversation

@steipete

@steipete steipete commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

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

Proof Result
Codemod and review Mechanical dry-runs inspected; lifecycle/cancellation resolved manually; migration, focus, and reconciliation reviews scoped clean through P2
UI types pnpm tsgo:ui passed on merged candidate 4eb084449628b
Focused tests Six touched-file tests passed, covering loading/cancellation, channel choices, copy focus, and completion after dismissal
Production Knip pnpm deadcode:knip passed on final published head 0a4df1d6c3db8; no findings or new ignores
Same-machine builds and strict performance Production comparison passed: 349,043 → 349,027 B startup JavaScript gzip (−16 B); one CSS request, 49,703 B unchanged; below 374,285 B budget
Unchanged-input proof reuse Build production head 72789fa; subsequent own changes are reviewed test fixtures and main reconciliation, preserving placement policy. Final Knip covers 0a4df1d6c3db8
Screenshots Six inspected synthetic captures below; closed pickers and draft recovery are pixel-identical
Attachment investigation Current Bun picker→attachment sequence passes 27/27 in one Chromium worker, including all six attachment cases. Temporary response-state diagnostics removed. This passing probe establishes neither a fix nor inheritance for recurring CI attachment failures
Debug polling fixture Exact reviewed correction reused: wait for rendered samples instead of a 900-second asynchronous timer sweep; wait for initial lazy disk sample before reconnect. Original owner proof: 7/7 and full CI run 38523513039 green

The 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:full covers shared picker and modal focus behavior.

Exact-head CI run 38548197669 at 0a4df1d6c3db8 passed all three UI unit shards, all nine mocked Control UI E2E shards, both real-Gateway shards, and security-fast. The sole substantive failure is check-test-types-core-2: desktop-panel-abandonment.test.ts:50 reports TS2322 for readonly attachedSessionIds versus mutable string[]. Its aggregate gate is also red.

The original classifier marked that failure NEW against older passing scheduled main run 38543352664. Newer scheduled main run 38550286127 at 00b330babd579 reproduces the identical diagnostic in job 115806467497. 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 requested raw-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:
Before closed pickers

After closed model/channel pickers:
After closed pickers

Before open model menu:
Before open model menu

After open model menu:
After open model menu

Before file-draft recovery:
Before draft recovery

After file-draft recovery:
After draft recovery

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 14, 2026
@clawsweeper

clawsweeper Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T10:20:13.489572Z 0a4df1d New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot reopened this Oct 14, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Config-lane CI coordination: the full run for #171890 at 683dec9b5c6287eb5eb088eb643247422e63d7a6 fails browser sign-in recovery > verifies renewed website access using the current stored-password credential in ui/src/app/browser-auth-recovery.test.ts:208 (restored calls expected 1, received 0).

Exact job: https://github.com/openclaw/openclaw/actions/runs/38533069689/job/115749742997

This run uses the pinned Bun runtime. The same case passed in scheduled main run 38529517398 under Node; the newer scheduled run failed preflight and skipped UI. We are preparing one exact-base Bun reproduction and are not claiming inheritance or editing your owner files.

Source observation for your investigation: this case dispatches focus immediately after the modal appears, while check() clears its pending promise only in finally. Modal appearance alone does not establish an idle probe, and focus while pending returns that same promise. The other browser case explicitly waits for enabled “Check again” before advancing. A rendered idle boundary may be the appropriate fixture prerequisite, but this timing cause is not yet reproduced.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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);

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.

P2 Badge 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 👍 / 👎.

@steipete
steipete merged commit a05ccb5 into main Oct 14, 2026
107 of 111 checks passed
@steipete
steipete deleted the solid2/rest-picker-adapters branch October 14, 2026 13:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 15, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant