Skip to content

refactor(ui): simplify chat side panels and cards - #174739

Merged
steipete merged 4 commits into
mainfrom
solid2/w-idiom4-chat-panels
Oct 16, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-idiom4-chat-panels

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat side panels and cards still carry imperative rendering state and lifecycle wiring after the Solid migration.

User Impact

No intended visual or behavioral change. Existing host tags, classes, selectors, lazy boundaries, retained panels, and request-admission contracts remain intact.

Why This Change Was Made

Use writable derivations for panel intent and secret visibility, an async memo for attachment posters, owned refs for question controls, and owned listener cleanup. CI checks consume their parent's presentation state instead of subscribing twice. Keep domain owners in plain TypeScript and preserve memo equality boundaries that prevent unrelated prop replacement from restarting automation inventory.

Remaining effects name their external synchronization (DOM geometry/focus, imperative integrations, or owner subscriptions). Retained snapshots preserve request admission or lifetime identity. Raw listeners belong to FileReader, MessagePort/window transport, and IndexedDB lifetimes; queries cross component or native-island boundaries. No dependencies were added.

Evidence

Proof Result
pnpm tsgo:ui Passed; the exact UI-chat test-types project also passed after correcting the regression test cleanup return type
Targeted question-card tests 22 passed
Targeted picker-overlay tests 10 passed
Targeted automation-summary tests 10 passed
CI regression proof Sidebar preview: 1 passed; file-search browser cases: 3 passed; sidebar region: 19 passed, including same-lock refresh focus
Targeted lint and formatting Initial lint passed; corrected-source formatting passed. Correction lint rerun stopped before linting because unchanged plugin-SDK declaration preparation timed out after 300 s; Final-head CI lint passed.
Independent P0–P2 autoreview Substantive refactor, lint follow-up, and CI corrections all clean
Production pnpm deadcode:knip Passed (no findings)
Base and head pnpm ui:build, including strict performance check Passed on the same machine with identical build metadata
Startup JS gzip (same-machine local comparison) 340,283 → 340,309 B (+26 B); both below 374,285 B baseline budget; no new startup imports or requests
Final-head CI startup JS gzip 340,207 B; strict performance check passed
Startup CSS 1 → 1 request; 38,784 → 38,784 B gzip
Targeted synthetic screenshots Model picker and pending question, desktop light 1440×960; both before/after PNG pairs byte-identical and visually inspected
Broad UI proof Final ci:full run 38978903914 passed, including UI units, Control UI E2E, browser-extension, real-Gateway, lint, types, and performance

The question and summary files were rerun only after fixing failures. Build/screenshots cover the substantive refactor. CI corrections restore mount-time ref snapshots and restrict focus transfer to lock transitions, preserving baseline behavior; failed sidebar cases pass locally, with mobile user flows covered by the replacement full CI run. Baseline: 0af4818bca861078e143316e06d74a4435d76fb4. No full local suite or parity matrix was run.

Solid refactor checklist — 39 touched production files
Metric Before After
Production LOC 11,980 11,975
Controllers 0 0
createEffect 42 34
createRenderEffect 0 0
untrack 36 15
Raw addEventListener 52 18
Query checklist regex 12 12
Hand-built class strings 9 0
Production flush 0 0
Owner captures 5 5

Counts use the skill's line-based patterns. Its query pattern excludes generic TypeScript calls, so the unchanged query count does not represent all removed own-DOM queries. Owner captures remain at foreign DOM mount boundaries. Net production LOC: −5.

Initial CI run 38973661190 exposed two regressions that are corrected in the replacement head: file-search ref callbacks read a narrowed Show accessor outside its rendering scope, and same-lock sidebar refreshes transferred focus out of active mobile menus. The existing sidebar/browser cases and a new focus regression cover these contracts. Replacement run 38976832310 cleared the UI unit and mobile regressions. It found one test-only cleanup return-type error, now corrected and checked with test/tsconfig/tsconfig.core.test.ui-chat.json. The separate link-hover-preview.e2e.test.ts case “keeps title hints when the optional hover runtime cannot load” also fails on scheduled main runs 38969675015 and 38976134677, with the identical initial-roster timeout; it was inherited. Final run 38978903914 is fully green, including that test; no CI exception is needed.

The attached before/after captures contain synthetic fixtures only.

Before: model picker

After: model picker

Before: pending question

After: pending question

Derive local panel intent and secret visibility, keep textarea sizing with the input, and pair native event cleanup with its owner. Preserve request fences, retained panel state, focus, and lazy imports. Consolidate attachment admission refs and CI presentation observation.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 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 16, 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-16T22:40:11.439224Z a228368 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 P2 Normal backlog priority with limited blast radius. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR simplifies Solid chat-panel state, attachment previews, DOM refs, and listener cleanup while preserving existing behavior.

Example: A pending question offers Comfortable, Compact, and a free-text answer.

  • Before: The panel finds its answer controls through DOM queries and manages textarea sizing centrally.
  • After: Owned refs identify the controls, and the textarea manages its own sizing with the same visible layout.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is coherent and the earlier finding is fixed; supplied behavioral evidence is primarily targeted harness coverage and static visual parity.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; inspected synthetic desktop screenshots establish model-picker and question-card visual parity, while targeted test results support lifecycle behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Existing chat interactions should retain their appearance, focus, and request behavior while their rendering lifecycle becomes simpler.
Reason: The maintainer-directed change follows the existing Solid migration, reduces imperative wiring, and keeps domain authority with established owners.

Merge readiness

✅ Ready for maintainer review

Keep open as useful maintainer-directed cleanup: the earlier ref-lifetime finding is resolved, and inspection found no new blocking defect.

Priority: P3
Reviewed head: a228368c46c0ca82389679c15fc54cbf5088d64c

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No pre-fix execution of the newly added same-lock focus regression is supplied.
Agent review details

How this fits together

The Control UI chat components consume Gateway and session-owner state, render panels and cards, and forward user actions to the existing domain owners.

flowchart LR
  A[Gateway and session owners] --> B[Reactive projections]
  B --> C[Chat panels and cards]
  C --> D[Owned DOM refs and listeners]
  D --> E[Native controls and overlays]
  E --> F[Existing domain actions]
Loading

Technical review

Best possible solution:

Retain this focused refactor with the restored mount-time ref snapshots and transition-only focus handling.

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

This is a refactor; source comparison confirms the previously reported ref callback defect is repaired, without executing tests during this read-only review.

Is this the best way to solve the issue?

The changes use existing Solid and domain owners, preserve deliberate equality and lifetime boundaries, and avoid adding configuration or parallel implementations.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Details intent, docking, and parking keeps the original intent (2c70515: Show Details beside sufficiently wide conversations while respecting explicit closure and retaining one content tree.)
  • Question controls and secret visibility keeps the original intent (48eade6: Permit local show/hide feedback while masking new questions and keeping values outside the agent transcript.)
  • Question and sidebar DOM ownership keeps the original intent (4fddb19: Move leaf rendering to Solid while preserving keyboard behavior, host selectors, and lifecycle boundaries.)
  • Retained sidebar roots and focus keeps the original intent (5ef9e1a: Preserve keyed panels across hiding and reordering while publishing committed geometry through the existing layout owner.)
  • Native picker and CI overlays keeps the original intent (84617ea: Use native overlay primitives while preserving disclosure intent during presentation parking.)
  • Attachment and HTML-preview lifetimes keeps the original intent (75df19c: Render attachments with Solid while retaining source fencing and HTML resource ownership.)
  • Automation inventory keeps the original intent (7234914: Remove the rendering bridge while preserving synchronous cron ownership, refresh coalescing, session fences, and retry focus.)
  • Draft recovery keeps the original intent (a05ccb5: Use the native modal owner while preserving stale-draft checks, clipboard/download actions, cancellation, and row identity.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -5, Tests +24. Total +19 across 40 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 39 670 675 -5
Tests 1 24 0 +24
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 40 694 675 +19

Review metrics

Metric Value Why it matters
Production versus test LOC Production +670/−675, net −5; tests +24/−0 Production shrinks slightly; the test addition protects observable focus behavior during same-lock refreshes.

Labels

Label changes:

  • add P3: This is behavior-preserving UI maintenance with no remaining demonstrated user-facing defect.
  • 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.
  • remove P2: Current review triage priority is P3, so this older priority label is no longer current.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦐 gold shrimp, 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 behavior-preserving UI maintenance with no remaining demonstrated user-facing defect.
  • 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.
  • 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-16T22:23:09.129Z sha 5edafcb :: needs changes before merge. :: [P2] Capture the search ref before entering the unowned callback

Reviewed October 16, 2026, 6:45 PM ET / 22:45 UTC (Revision 2).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. and removed P2 Normal backlog priority with limited blast radius. 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 16, 2026
@steipete
steipete merged commit 5f3a050 into main Oct 16, 2026
103 of 104 checks passed
@steipete
steipete deleted the solid2/w-idiom4-chat-panels branch October 16, 2026 23:18
@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 17, 2026
* refactor(ui): simplify chat panel state and lifecycles

Derive local panel intent and secret visibility, keep textarea sizing with the input, and pair native event cleanup with its owner. Preserve request fences, retained panel state, focus, and lazy imports. Consolidate attachment admission refs and CI presentation observation.

* refactor(ui): tidy chat panel cleanup callbacks

* fix(ui): preserve sidebar ref lifetime and menu focus

* test(ui): return void from sidebar timer cleanup
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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XL 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