Skip to content

refactor(ui): use owners for login focus and portal updates - #176716

Merged
steipete merged 2 commits into
mainfrom
solid2/w-zero-focus-portals
Oct 19, 2026
Merged

steipete merged 2 commits into
mainfrom
solid2/w-zero-focus-portals

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Login focus and Portals request updates used effects even though their owners already receive the relevant events. Login now chooses its current method or API-key target from the existing settled focus callback. Its API-key button ref forwards through the live login owner, matching the adjacent method-choice ref. Portals consumes native host-property receipts and coalesces paired changes before requesting the final environment.

This removes both effects while preserving selectors, lazy imports, iframe lifetime, cancellation, and focus behavior.

Evidence

Current head: b144533b3ee8abef294ba53bd0bd83d49d005ea1, refreshed without conflicts onto 737c8c126153d2b36d22fc50eb4ada8062394d93. All six authored files and the complete patch are identical to the previously reviewed head afa3e6d4b312bda0e8502af78f75a667753bbd08.

Check Result
Fresh frozen install Passed, 1.36 s
Fresh pnpm tsgo:ui Passed, 21.53 s
Fresh UI-pages test typecheck Passed, 19.12 s
Fresh production Knip Passed, 503.07 s; no findings; head unchanged and checkout clean
Reused login boundary tests 21 passed; provider grouping, quick-key fallback focus, and Back/search case passed again after the callback repair
Reused Portals boundary tests 18 passed
Reused scoped lint, format, whitespace Passed, including type-aware lint on the repaired login view
Reused isolated autoreview Original migration P0–P3 and callback repair P0–P2: no actionable findings
Fresh full CI Completed; all UI and performance checks passed; one inherited Gateway failure, detailed below

The refreshed comparison covers 57 focused owner, view, bridge, focus, lifecycle, harness, style, and dependency inputs: 51 unchanged, six changed and inspected. The changes are outside these tested contracts: default-model selection, an unused gateway-page accessor, unrelated strings/defaults selectors, and a process-helper dependency pin. The original review context manifest was not recovered; this is an explicit fresh comparison. Broader app changes are left to fresh PR CI, and no claim is made that the whole transitive graph is unchanged.

The 39 unique boundary cases cover first-method focus, Back/search focus, quick-key fallback, provider return, paired property writes requesting only the final environment, and retained iframe/request lifetimes. These passing tests were preserved without another runtime rerun. The original complete-file tests used the authorized Node/cache-disabled fallback after diagnosed pre-collection rename stalls; the subsequent callback case passed with pinned default Bun. Portals emitted no Solid diagnostics. Login emitted STRICT_READ_UNTRACKED diagnostics whose complete attribution remains unproved; none were suppressed.

No local build or screenshots were added: this changes lifecycle wiring without changing rendered markup, CSS, classes, selectors, routes, lazy imports, or startup modules. Broad integration proof comes from ci:full on the refreshed head.

Touched production scope Before After
createEffect 2 0
createRenderEffect, untrack, raw listeners, DOM queries 0 0
Controller patterns, class-string assembly, flush, owner escapes 0 0
Production LOC 1763 1776
Test LOC 1529 1567

The 13 added production lines preserve Portals' coalescing contract while removing copied reactive state. No targeted patterns remain in these four production files.

Historical CI 39185953269, on afa3e6d4b312bda0e8502af78f75a667753bbd08, passed every runtime job. Its existing chat absolute-budget failure measured base 1,491,219 B and old head 1,491,161 B (-58 B), both above 1,490,000 B; startup was 337,464 B gzip (7 JS/1 CSS). These measurements and that CI result do not certify the refreshed head.

Inherited CI qualification

Exact-head CI 39199106551 completed for b144533b3ee8abef294ba53bd0bd83d49d005ea1. All UI unit, ordinary Control UI E2E, browser-extension, type/lint, security, and strict performance checks passed. The only failed nonaggregate jobs contain these cases:

  • ui-e2e-serial ui/src/e2e/session-pr-reader-lifetime.real-gateway.e2e.test.ts > Session PR readers through a real Gateway > keeps session PR and CI results with the current workspace and reader.

The reader case timed out after 120 seconds. The same exact names and error signatures fail on the latest completed scheduled main run 39205204421, at e3cc361b27cb48b494708891fee8df83e6811946. The actual CI checkout's ordered parents and reconstructed merge tree are verified, and the named failure-source blobs match its base and the scheduled-main head. These are qualified inherited failures; the native inherited-failure/admin route is used without claiming CI green. No failed assertion was weakened and no local E2E rerun was added.

Current-head startup: 337,503 B gzip JavaScript, 7 requests, plus 38,500 B gzip CSS, 1 request. Same-host base/head chat boot: 1,489,923 → 1,489,905 B (-18 B); New Session: 1,049,408 → 1,049,397 B (-11 B). Lazy boundaries are unchanged.

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 19, 2026
@steipete
steipete marked this pull request as ready for review October 19, 2026 00:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-19T04:25:43.237719Z b144533 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR routes provider-login focus through settled callbacks and coalesces Portals host-property updates in the existing owner.

Example: Select the quick-key-only provider, return to search, then select zebra.

  • Before: Each option registers its focus target through a reactive effect.
  • After: The settled callback focuses the API-key button or the current first method button directly.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent with prior owner decisions; available behavioral evidence remains harness-based, and CI failure attribution is incomplete.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; its reported login and Portals tests exercise production components in process, and the body explicitly supplies no browser capture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible behavior change is intended; provider focus and retained portal previews must remain stable.
Reason: The established area owner directs a narrow removal of redundant effects while preserving the prior focus, cancellation, polling, and iframe contracts.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a focused, owner-directed lifecycle refactor with no actionable introduced defect found; unresolved CI failures still prevent a clean landing assessment.

Priority: P3
Reviewed head: 49fb31c2460dddecce71f650e363a6354f9b3c4f

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence exercises mounted production components with mocked Gateway I/O, without a shipped-browser trace of focus and final-target transitions.
Agent review details

How this fits together

The Control UI login owner consumes provider choices and focuses rendered controls; the Portals owner consumes host properties and Gateway events, requests portal or environment state, and publishes the retained preview.

flowchart TD
  A[Provider selection] --> B[Login owner]
  B --> C[Settled focus callback]
  C --> D[Current choice button]
  E[Native host property changes] --> F[Portals owner]
  F --> G[Gateway reads]
  G --> H[Retained portal preview]
Loading

Technical review

Best possible solution:

Retain the existing owners and focused coalescing mechanism, with required CI failures resolved or independently attributed before landing.

Do we have a high-confidence way to reproduce the issue?

This is a behavior-preserving refactor, not a reported product failure; source and existing test scenarios were inspected without executing target code.

Is this the best way to solve the issue?

The implementation uses existing focus, bridge, projection, and Portals owners, removes the replaced effects, and adds only the scheduling state needed to preserve paired-write coalescing.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against dba2de1418b8.

Provenance checked

  • Login focus target registration keeps the original intent (18cd308: The shared login factory retained focus restoration while moving Models rendering to owner-scoped Solid factories.)
  • Settled login focus callbacks keeps the original intent (442d0dc: Focus work moved from reactive synchronization to handlers that run after rendering settles.)
  • Portals presentation transitions keeps the original intent (788c2ae: The component-owned Portals factory preserves polling, iframe identity, probe reuse, and explicit command receipts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 18cd308 adds ui/src/pages/model-providers/login-controller.ts:336 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 18cd3088f476; files: ui/src/pages/model-providers/login-controller.ts)
  • Ayaan Zaidi: Raw commit 525a7cd adds ui/src/pages/model-providers/login-controller.ts:197 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 525a7cd755d3; files: ui/src/pages/model-providers/login-controller.ts)

PR surface

Source +13, Tests +38. Total +51 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 74 61 +13
Tests 2 40 2 +38
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 114 63 +51

Review metrics

Metric Value Why it matters
Production versus test growth Production +13 lines; tests +38 lines Production growth implements receipt coalescing and disposal handling; test growth covers final-target admission and distinct focus transitions.

Labels

Label changes:

  • add P3: This preserves existing behavior while simplifying UI lifecycle wiring; no urgent user-facing regression is established.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This preserves existing behavior while simplifying UI lifecycle wiring; no urgent user-facing regression is established.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 18, 2026, 9:12 PM ET / October 19, 2026, 01:12 UTC.

@steipete
steipete force-pushed the solid2/w-zero-focus-portals branch from 49fb31c to afa3e6d Compare October 19, 2026 01:34
@steipete
steipete force-pushed the solid2/w-zero-focus-portals branch from afa3e6d to b144533 Compare October 19, 2026 04:21

@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: b144533b3e

ℹ️ 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".

Comment on lines 32 to +36
) {
let active = true;
let presentationPending = false;
const snapshotPresentation = (): PortalsPresentation => {
const current = presentation();

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.

P1 Badge Reduce this Solid refactor’s production LOC

The four touched production files grow by 13 lines overall (74 additions versus 61 deletions), contrary to the required Solid refactor checklist’s net-negative production-LOC rule. Most of the growth comes from this new snapshot/coalescing lifecycle, so simplify that ownership path or retain the smaller existing mechanism rather than landing a refactor that increases lifecycle bookkeeping.

AGENTS.md reference: ui/AGENTS.md:L5-L5

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 978464d into main Oct 19, 2026
102 of 107 checks passed
@steipete
steipete deleted the solid2/w-zero-focus-portals branch October 19, 2026 06:46
@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 20, 2026
…#176716)

* refactor(ui): route login focus and portal updates through owners

* fix(ui): preserve login API-key ref method binding
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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant