Skip to content

refactor(ui): own tooltip and lightbox interaction lifetimes - #176449

Merged
steipete merged 4 commits into
mainfrom
solid2/w-zero-components-followup
Oct 18, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-zero-components-followup

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Tooltip, modal and image-viewer components still bind listeners manually and rediscover elements they render. Several small effects also duplicate shared lifetime primitives.

User Impact

No visual or interaction change is intended. Tooltips retain their accessible descriptions and reconnect behavior; image viewers retain gallery navigation, zoom, keyboard focus and resource cancellation; memory import retains synchronous request admission.

Why This Change Was Made

Listeners now use the shared cleanup helper or owned native refs. The lightbox registers focus targets, file preview observes accepted modal visibility, and the folder picker captures its existing input ref. The deferred file section uses the shared intersection observer, the divider's renderer owns ARIA bindings, and memory import reads an owner projection. One shared lazy lightbox component receives each host through Solid context; its host/props types live in the existing type leaf to avoid an import cycle. Redundant untrack wrappers are removed; the one remaining snapshot names the keyed palette row's initialKey.

This is a second components checkpoint. Modal autofocus and tooltip-description discovery still need caller registration contracts; file-preview focus and scroll synchronization still need shared primitives. These remain outstanding wave-zero work.

Evidence

Check Result
UI typecheck Passed on merged candidate de4ae5412eea
Import architecture pnpm check:madge-import-cycles passed with 0 cycles at 2e9427767f87; the type-only leaf repair is unchanged by main integration
Focused tests Selected tooltip, image lightbox and memory import. Lightbox runtime proof at a84d3e19f5e passed all 21 tests (36.65 s). Main pointer-owner integration passes all 8 divider tests on the merged candidate. Initial tooltip/onboarding local attempts stalled before assertions; prior-head full UI CI passed those suites. No local broad suite.
Production build and strict performance Reused from tested runtime head a84d3e19f5e: both sides passed from merge base 01a806546943b009ed364e362c13eb57721f1627; startup 336,575 → 336,560 B gzip, 7 JS requests and 1 CSS request; raw startup JS decreases by 332 B.
Visual proof Three inspected synthetic before/after pairs at 1440×960 are pixel-identical: tooltip, image gallery, second image at 135% zoom. Both sides pass navigation, zoom, focus wrapping and Escape close.
Production Knip Merged-candidate run reports the same two unused core reply-admission files as scheduled main 39163574553, dependency job 117782017361; no new ignores or UI unused files
Independent review Fresh full candidate review against merged main d9fb4de16f39: scoped-clean P0–P2; targeted divider lint/format and diff check also pass
Broad proof Prior-head ci:full run 39168044298, at 2e9427767f87, completed with every UI unit and Control UI E2E shard green. Three exact-name inherited Gateway failures and an inherited chat budget failure remain. Merged-head CI39170533676 has passed UI units and performance; remaining E2E jobs are running. No local full E2E suite or remote lease

Measured changed production scope (18 files), against merged main parent d9fb4de16f393656aa52511ca25801296c4b77e7:

Pattern Before After
createEffect 12 9
createRenderEffect 0 0
untrack 6 1
addEventListener 17 0
querySelector(All) including generic calls 5 2
Controller / manual classes / flush / owner capture 0 / 0 / 0 / 0 0 / 0 / 0 / 0
LOC 6,187 6,238

The 51-line growth is explicit lightbox focus registration, cleanup and a host context; the shared observer, renderer bindings and projection remove duplicated lifetime machinery.

Remaining categories (paths under ui/src/components/):

  • External mention-owner synchronization: command-palette-view.tsx:449,453.
  • Media resource leases and imperative player synchronization: image-lightbox-content.tsx:452,483.
  • Native modal open-state synchronization: modal-dialog.ts:419.
  • RPC admission and cancellable migration planning: onboarding-memory-import-solid.tsx:131,170.
  • Intentional keyed-row identity snapshot: command-palette-view.tsx:357.
  • Outstanding shared focus/scroll work: file-preview-modal.tsx:183,203.
  • Outstanding caller-content ref cutovers: modal-dialog.ts:204 and tooltip-owner.ts:496.

Before: search tooltip, synthetic data

After: search tooltip, synthetic data

Before: synthetic image gallery

After: synthetic image gallery

Before: second synthetic image at 135% zoom

After: second synthetic image at 135% zoom

Current head and CI evidence

Merge commit de4ae5412eeabbf4b2175ff7aaf0a6b3a15f29ea integrates main d9fb4de16f393656aa52511ca25801296c4b77e7 after one divider import conflict. The resolution retains main's pointer-drag owner for capture, cancellation and disposal plus renderer-owned ARIA bindings, with no second cleanup. Frozen install, UI typecheck, eight divider tests, targeted lint/format and fresh review pass. Final Knip finds only src/auto-reply/reply/reply-admission-ticket.ts and src/auto-reply/reply/reply-turn-admission-owner.ts, matching scheduled main 39163574553. Current-head CI39170533676 is running; UI units and performance have passed; runtime and screenshot evidence above is explicitly reused from the unchanged lightbox contracts.

Prior-head run 39168044298, at 2e9427767f87, passed every UI unit and Control UI E2E shard. Its three failing Gateway names also fail on completed scheduled main 39163574553:

  • Managed image ordering through real chat.send and history > keeps headings, managed images and trailing prose ordered live and after reload without duplicates
  • Speech supplements through real chat.send and cursor history > attaches delayed speech to each original answer live and after reload
  • Control UI media transcript replay with a real Gateway > delivers PowerPoint and keeps persisted attachment failures replay-safe

That prior run's performance comparator reports chat boot 1,494,544 → 1,494,590 B, both above the 1,490,000 B ceiling, and passing startup at 336,637 B gzip, 7 JS / 1 CSS. These are prior-head results, not current-head admission evidence.

Final merged-head CI

Run39170533676 passed on de4ae5412eeabbf4b2175ff7aaf0a6b3a15f29ea: all three UI unit shards, all nine Control UI E2E shards, both real-Gateway shards, performance, security and the CI gate. No inherited-CI exception is needed for this head.

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

clawsweeper Bot commented Oct 18, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 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-18T22:07:10.356948Z de4ae54 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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR moves Control UI listeners, focus targets, observers, and presentation subscriptions onto existing lifetime owners.

Example: Open a two-image gallery, navigate to the second image, and close the viewer.

  • Before: The viewer discovers focusable controls from its rendered DOM and manually pairs several listeners.
  • After: Controls register their focus targets, and shared helpers release listeners with their owning lifetime.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, source-consistent ownership cleanup with inspected browser evidence and a resolved prior finding; CI completion remains separate from patch correctness.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Prepared browser screenshots exercise the real tooltip and image-viewer surfaces with synthetic content and matching before/after layouts; existing lifecycle tests support focus, reconnect, cancellation, and resource behavior, and the final type-only commit preserves the captured runtime.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Manual listener pairing and DOM rediscovery make existing UI interaction lifetimes harder to maintain.
Reason: The maintainer-directed checkpoint consolidates existing mechanisms without adding settings, changing defaults, or expanding product behavior.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: the previous lazy-loading defect is resolved, and this review found no remaining actionable patch defect.

Priority: P3
Reviewed head: 2e9427767f87663b86853210b9efdb7eafbcb1a3

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control UI custom-element bridges supply live properties to Solid renderers, whose interaction owners manage browser events, focus, media resources, and teardown.

flowchart TD
  A[Control UI callers] --> B[Native host bridge]
  B --> C[Shared lazy renderer]
  B --> D[Host context]
  D --> C
  C --> E[Interaction owners]
  E --> F[Browser events and focus]
  E --> G[Resource cleanup]
Loading

Technical review

Best possible solution:

Retain the existing synchronous interaction owners, shared lazy boundary, and explicit lifecycle cleanup.

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

This refactor claims preserved behavior rather than a new user-facing bug reproduction; no target code was executed during this read-only review.

Is this the best way to solve the issue?

The change reuses existing listener, observer, projection, and modal owners; the small host context preserves the lazy-loading contract established by #174830.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Tooltip policy and title adaptation keeps the original intent (590c7d6: Unify hints under one interaction owner while preserving accessible naming, trigger placement, and dismissal.)
  • Native tooltip and modal lifecycles keeps the original intent (b68c44c: Preserve accepted visibility, focus, cancellation, eager tooltip policy, and lazy presentation through native surfaces.)
  • Lazy lightbox renderer keeps the original intent (02d223b: Keep the full media viewer out of route boot graphs while retaining fixed host identity and live media properties.)
  • Gallery keyboard and focus behavior keeps the original intent (da2bcd6: Share gallery navigation across videos and images while retaining native player controls and focus wrapping.)
  • File-preview focus targets keeps the original intent (c591e0d: Use owned component refs while preserving file navigation and modal focus.)
  • Deferred reader sections keeps the original intent (b5ef99d: Show overview content first and fetch file diffs near visibility or explicit selection.)
  • Native-link shortcuts keeps the original intent (6320010: Render native-link actions through the shared menu while retaining shortcut dispatch and durable focus return.)
  • Memory-import presentation keeps the original intent (0af4818: Use direct presentation signals while retaining synchronous selection, cancellation, and duplicate-submit admission.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vyctor H. Brzezowski: Raw commit 1def359 adds ui/src/components/image-lightbox-gallery.ts:24 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 1def359971d0; files: ui/src/components/image-lightbox-gallery.ts)
  • Jacqueline Henriksen: Raw commit 704a21d adds ui/src/components/tooltip-title.ts:205 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 704a21dd91ef; files: ui/src/components/tooltip-title.ts)

PR surface

Source +52. Total +52 across 18 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 18 211 159 +52
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 211 159 +52

Review metrics

Metric Value Why it matters
Production versus test LOC Production +52; tests +0 Explicit focus registration and host context account for necessary growth while existing behavioral assertions remain intact.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is bounded UI ownership cleanup with no established urgent user-facing failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-18T20:58:22.076Z sha b25f402 :: needs changes before merge. :: [P2] Await lazy content in the direct-mount lightbox tests

Reviewed October 18, 2026, 5:39 PM ET / 21:39 UTC (Revision 2).

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

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

@steipete

Copy link
Copy Markdown
Contributor Author

The four lightbox regressions are fixed at their source: one module-level lazy component now receives its host through context, preserving cached readiness and reconnect behavior. All 21 existing lightbox tests pass without weakening their assertions. The follow-up type-only move into the existing types module also passes the exact Madge gate (zero cycles) and UI typecheck.

The current head is 2e9427767f87663b86853210b9efdb7eafbcb1a3; the body includes final scope, reused runtime proof, and exact inherited-failure evidence. The LOC-only finding is rejected under the campaign's explicit allowance for reported growth needed by correctness or idiomatic ownership.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 18, 2026
@steipete
steipete merged commit ecd1acd into main Oct 18, 2026
112 of 113 checks passed
@steipete
steipete deleted the solid2/w-zero-components-followup branch October 18, 2026 22:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 19, 2026
…w#176449)

* refactor(ui): own tooltip and lightbox interaction lifetimes

* fix(ui): preserve cached lightbox readiness

* fix(ui): break lightbox host context import cycle
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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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