Skip to content

refactor(ui): bind chat Details geometry to owned elements - #177104

Merged
steipete merged 5 commits into
mainfrom
solid2/w-zero-details-element-refs
Oct 19, 2026
Merged

steipete merged 5 commits into
mainfrom
solid2/w-zero-details-element-refs

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Details finds its pane, header, conversation frame and footer by searching rendered DOM. That makes layout ownership implicit and ties positioning to the first matching element.

User Impact

Details preserves its docking, native popover positioning, keyboard focus and presentation behavior. Host tags, classes, routes, styles and lazy imports remain unchanged.

Why This Change Was Made

The existing pane owner passes the exact rendered elements through a plain, lifetime-bound reference object. Renderers register and retire their own refs; Details uses them for geometry and the shared resize observer. Both ordinary and subagent headers use the same binding. The shared elementRef replaces a duplicate lifetime helper; no new state owner or dependency.

Evidence

Check Result
Details browser tests 12 cases proved; supplied-footer decoy, docking, viewport/mobile/fullscreen geometry, focus and retained intent
Header/sidebar wiring 5 cases pass, plus both repaired header width cases
Default tsrs UI and relevant test projects pass; no typechecker override
Production Knip Package production command passes; export inputs unchanged by the last test-only repair
Scoped lint / formatting Pass
Independent P0–P2 review Main lifecycle change and each focused repair scoped clean
Full CI 39228925909 36passed/26skipped; all UI E2E and Gateway shards pass. Sole failed leaf is the exactly reproduced inherited composer-menu test below
Same-runner strict performance, current head Pass: startup 323,906 B gzip, CSS 38,500 B / 1 request; chat 1,455,543 → 1,455,645 B (+102); New Session 1,024,461 → 1,024,455 B (-6)

Two test readiness assumptions surfaced after main's lazy-loading changes. The Details summary E2E advanced a paused clock before the lazy Session view registered its timer; it now awaits the actual All changes action first. That case passes in the full run above. The run's sole failing leaf was DraftPlaceState repository selection › keeps a route-selected model in the unsent composer instead of restoring a remembered model, which queried a lazy model option after waiting only for its menu shell. The coupled test now awaits that exact option before clicking. It passes locally, with every model/default, no-send and request assertion retained. Isolated base and head runs both passed, so no inherited-failure exception is claimed. No timeout increase, failed-action retry or production workaround.

Local tests use the default pinned Bun. No local E2E suite, build or parity run was added for these test repairs; full ci:full remains the broad proof. There is no visual style or structure change.

Wave-zero measurement

Counts cover all six touched production files, including coupled pane callers.

Pattern Before After
createEffect 1 1
createRenderEffect 0 0
untrack 1 1
addEventListener 0 0
querySelector(All) 4 0

The effect synchronizes native popover/docked geometry. The unchanged application snapshot in chat-view.tsx belongs to the enclosing view lifetime. Details has no query, direct listener, render effect or untrack; nearest-ancestor searches are removed too.

Production LOC 2,023 → 2,081 (+58); tests 2,393 → 2,435 (+42). The added production lines expose four existing DOM ownership paths and pass tracked geometry inputs to native synchronization. pr-simplify kept the existing pane owner and deleted the duplicate ref helper.

Current head 94490c9ec26e37026b269b5a6a66d6bc9a79cefd on 5272704f51da6bcd6b30826961ca1fd23174b859. All 12 changed file blobs and all five reviewed patches remain identical through the final rebase. Frozen install passes. The original auto request stays confirmed-cancelled; landing uses fresh native review/preparation and explicit replacement recovery using the exactly attributed inherited-failure route.

Inherited CI failure

The sole failed leaf in current CI is chat-composer-plus-menu-loading.test.tsx › keeps the menu open and retries a failed content load: unable to find accessible alert at line142. Running that exact file on PR merge base 5272704f51da6bcd6b30826961ca1fd23174b859 reproduces the same name and assertion (1failed/6passed) on default pinned Bun. The test blob d556b8796360df9a12117b9383427adf0953251f is identical at that base, actual CI main parent 81e58e7bf874b97b7b685362454ced0b39cb96f3, current head and tested merge 3f4a8d46fa8e49193af2588ce2496fd28a65ea4a. The latest completed scheduled main run predates this test, so attribution uses the exact merge-base reproduction. Every other job passed or was skipped; native inherited/admin replacement is requested for this failure and its aggregate only. CI is not reported green.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 19, 2026
@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.

@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-19T09:20:31.091993Z 94490c9 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.

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

ℹ️ 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 +55 to +56
private readonly detailsElements: ChatDetailsElements = {};

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 the refactor's production LOC

This change is explicitly a refactor, but its own measurement reports that touched production code grows from 1,996 to 2,054 lines (+58), while the required Solid refactor checklist mandates a net production LOC decrease. Please simplify or consolidate the new geometry-ref plumbing rather than landing the added owner/helper surface as-is. .agents/skills/solid/references/refactor-checklist.mdL3-L8

Useful? React with 👍 / 👎.

@steipete
steipete enabled auto-merge (squash) October 19, 2026 07:51
@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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR passes renderer-owned pane, header, conversation-frame, and footer references into Details instead of finding them through DOM searches.

Example: A 600px conversation frame contains an unrelated .chat-footer before the actual composer footer.

  • Before: Details measures the unrelated footer and can collapse its available popover height.
  • After: Details uses the supplied composer footer to calculate its available height.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A useful, focused ownership refactor supported by component coverage, with one definite test-type regression remaining.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; its supplied evidence reports component browser and wiring tests, with no shipped-entry-point capture.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-authored direction removes implicit markup coupling while retaining the existing presentation owner and behavior.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep this maintainer-authored refactor open; the ownership cutover is useful, but one browser-test caller was not migrated to the new required property.

Priority: P3
Reviewed head: a0587109321b9d3fb387f74acb14bf659447127b

Before merge

  • Update the remaining header fixture for required elements (P2) - Making elements required leaves the detailsControl object in chat-pane-header.browser.test.tsx:344 structurally invalid. That browser file is included by tsconfig.core.test.ui-chat.json, so the UI chat test typecheck now rejects the fixture even though the production-only pnpm tsgo:ui excludes test files. Supply the appropriate elements value in that existing fixture, as this PR already does for the header-details unit fixture.
  • Complete next step - Inspect the failed core type and Control UI performance diagnostics, then attribute each remaining failure before landing; the available annotations do not establish their causes.

Findings

  • [P2] Update the remaining header fixture for required elements — ui/src/pages/chat/chat-pane-header-view.tsx:11

Tests

  • Missing end-to-end proof: The supplied component suites do not demonstrate the assembled Control UI owner-to-Details reference wiring through the shipped entry point.
Agent review details

How this fits together

The Control UI pane layout supplies mounted elements and presentation intent to Details, which controls docking, popover geometry, resize observation, and focus restoration.

flowchart TD
  A[Pane layout owner] --> B[Sidebar renderer]
  A --> C[Conversation renderer]
  B --> D[Owned element references]
  C --> D
  D --> E[Details presentation]
  E --> F[Docked rail or native popover]
Loading

Technical review

Best possible solution:

Complete the existing reference cutover by updating the remaining header browser fixture while preserving docking, focus, and layout behavior.

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

Source establishes the missing required elements property in an included UI chat test caller; no tests or target code were executed during this read-only review.

Is this the best way to solve the issue?

Passing exact references through the existing pane owner is a coherent small cutover; the remaining typed caller should be migrated without introducing another owner or restoring DOM searches.

Full review comments:

  • [P2] Update the remaining header fixture for required elements — ui/src/pages/chat/chat-pane-header-view.tsx:11
    Making elements required leaves the detailsControl object in chat-pane-header.browser.test.tsx:344 structurally invalid. That browser file is included by tsconfig.core.test.ui-chat.json, so the UI chat test typecheck now rejects the fixture even though the production-only pnpm tsgo:ui excludes test files. Supply the appropriate elements value in that existing fixture, as this PR already does for the header-details unit fixture.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Details docking and geometry keeps the original intent (2c70515: Use available conversation width for a docked Details rail while preserving explicit dismissal and one content tree.)
  • Fullscreen and mobile Details keeps the original intent (395cc8d: Keep Details independently accessible when the conversation is hidden, with visible-pane bounds and restored focus.)
  • Sidebar reference lifetime keeps the original intent (fd7a46b: Replace renderer-owned host discovery with explicit registrations released with their owning views.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm tsgo:test:ui
  • pnpm --dir ui exec vitest run --project browser src/pages/chat/components/chat-pane-header.browser.test.tsx src/pages/chat/components/chat-details.browser.test.ts --maxWorkers=1
  • git diff --check

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 41e10e2 adds ui/src/pages/chat/chat-pane-sidebar-view.tsx:60 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 41e10e238776; files: ui/src/pages/chat/chat-pane-sidebar-view.tsx)
  • RoboClaw: Raw commit 2c70515 adds ui/src/pages/chat/components/chat-details.tsx:42 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 2c705154ec84; files: ui/src/pages/chat/components/chat-details.tsx)

PR surface

Source +58, Tests +28. Total +86 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 117 59 +58
Tests 3 29 1 +28
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 146 60 +86

Review metrics

Metric Value Why it matters
Production versus test growth Production +58 lines; tests +28 lines The introduced diff makes four DOM ownership paths explicit and adds footer-selection and reference-lifetime coverage; line growth alone does not establish unnecessary machinery.

Labels

Label changes:

  • add P3: This is a behavior-preserving UI cleanup with a focused test-caller migration defect and no demonstrated user-facing outage.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is a behavior-preserving UI cleanup with a focused test-caller migration defect and no demonstrated user-facing outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 19, 2026, 4:01 AM ET / 08:01 UTC.

@steipete
steipete disabled auto-merge October 19, 2026 08:06
@steipete
steipete force-pushed the solid2/w-zero-details-element-refs branch 3 times, most recently from 69df3ac to 605f4a6 Compare October 19, 2026 08:54
@steipete
steipete force-pushed the solid2/w-zero-details-element-refs branch from 605f4a6 to 94490c9 Compare October 19, 2026 09:17
@steipete
steipete merged commit 43e2d3c into main Oct 19, 2026
101 of 106 checks passed
@steipete
steipete deleted the solid2/w-zero-details-element-refs branch October 19, 2026 09:44
@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
…177104)

* refactor(ui): supply owned geometry refs to chat details

* test(ui): supply details refs in header fixture

* test(ui): await lazy details session in docking check

* test(ui): await lazy Details summary before clock advance

* test(ui): await route-selected model picker option
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: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant