Skip to content

refactor(ui): reuse chat panel lifecycle primitives - #176605

Merged
steipete merged 1 commit into
mainfrom
solid2/w-zero-chat-panel-primitives
Oct 18, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-zero-chat-panel-primitives

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat headline cadence, attachment scroll indicators, publication menu visibility and widget geometry still carried local effect/listener machinery. The refactor uses the existing shared primitives while preserving retained-panel behavior and resize ordering.

Changes

Derive the readable headline from its previous value and a shared timer cadence; fast activities replace pending copy while failed/blocked activity remains immediate. Use the shared scroll-state and presentation projections. Pair native lightbox media handlers through listen, and batch widget geometry reads before layout writes through the existing layout scheduler.

Evidence

Check Result
Focused tests 27 pass: activity headline 18, GitHub publication 6, video gallery source 3; one run each / one worker
UI typecheck Pass
Targeted UI lint / independent review Pass; full-context P0–P2 scoped clean. Two mechanical return-style corrections after review pass targeted lint; two pre-existing WidgetFrame reactive warnings remain outside the changed code.
Base/head production builds / strict performance Both normalized builds pass (191.29 s / 145.31 s); strict check passes with zero violations. Startup 337,281 → 337,273 B gzip (-8 B), 7 JS requests; CSS 38,500 B / one request unchanged. Chat 1,489,844 → 1,489,803 B (-41 B), 25 requests; New Session 1,047,857 → 1,047,855 B (-2 B), 20 requests.
Production Knip Completed once (1,017.78 s): only two inherited unused core files, no UI findings. Both reply-admission files and Knip config have identical blobs at base and head; no ignores added
Broad proof ci:full runs every UI unit, Control UI E2E, browser-extension and real-Gateway shard
Pattern across five production files Before After
createEffect 4 1
createRenderEffect 0 0
untrack 3 1
Direct listeners 5 0
DOM queries 1 1
LOC 1,430 1,367

Survivors: widget-card-view.tsx:522 synchronizes external ResizeObserver geometry and deliberately defers observer attachment to avoid skipped resize delivery; the existing shared observer helper does not cover that ordering. widget-card-view.tsx:290 snapshots initialPromptCapable for the frame identity. Its existing export lookup at line 493 is tracked for the next owned-ref cutover and is not claimed as an allowed Solid-shell query.

Production drops 63 lines. No new abstraction or dependency. Markup, styles, host tags, routes and lazy boundaries remain unchanged; no intended visual change, so this behavioral refactor uses focused interaction tests and full CI rather than additional screenshots. Base de42210bcdd6244ad44a6165a5ba555ae24b2046.

Head 2f2dd477f7c7d463afceb7cc81733cc72e553e68. Whole change: five production files, 99 insertions and 162 deletions; no tests added or changed.

@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-18T23:17:35.124284Z 2f2dd47 PR opened
ℹ️ 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 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 replaces local chat timing, visibility, listener, and geometry machinery with existing shared lifecycle primitives.

Example: “Read first” appears at 0 ms and “Read latest” arrives at 800 ms.

  • Before: The local timeout holds “Read first” until 3,000 ms, then displays “Read latest”.
  • After: The shared timer preserves the same reading window and latest-operation replacement.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, apparently correct simplification with strong supporting CI and preserved contracts; supplied behavioral evidence remains test-based.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor-proof gate does not apply to this maintainer-authored refactor; supporting evidence consists of focused component tests and passing exact-head UI/Gateway CI, without a standalone runtime demonstration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: Maintainer-authored direction and prior merged work support consolidating lifecycle machinery without changing product behavior or adding abstractions.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it is a focused, maintainer-directed simplification that preserves the existing lifecycle contracts; no actionable defect was found.

Priority: P3
Reviewed head: 2f2dd477f7c7d463afceb7cc81733cc72e553e68

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control UI chat components consume activity, attachment, presentation, and resize updates and produce retained DOM, menu visibility, media handlers, and widget placement.

flowchart TD
  A[Chat owner updates] --> B[Solid chat components]
  C[Presentation state] --> B
  B --> D[Shared lifecycle primitives]
  E[Browser media and resize events] --> D
  D --> F[Retained DOM and widget placement]
Loading

Technical review

Best possible solution:

Use the existing shared primitives while retaining headline cadence, presentation parking, media cleanup, and deferred resize observation.

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

This PR claims a refactor rather than a reproduced product bug; source inspection and existing contract tests support its stated scope.

Is this the best way to solve the issue?

The change follows the smallest complete approach by replacing duplicated lifecycle wiring with existing owners and removing the superseded paths.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Activity headline cadence keeps the original intent (improve(ui): keep live tool purposes visible in activity summaries #160881: Keep useful operation purposes readable for three seconds, coalesce rapid updates, and expose urgent outcomes immediately.)
  • Attachment presentation lifecycle keeps the original intent (a423f19: Preserve attachment behavior and retained media lifetimes during the Solid rendering migration.)
  • Publication menu visibility keeps the original intent (84617ea: Use the native menu owner and close publication-account menus when the containing Details surface hides.)
  • Video lightbox listeners keeps the original intent (da2bcd6: Connect only the selected gallery video and release its native playback handlers and source on navigation or close.)
  • Widget action placement keeps the original intent (4d18f99: Place actions in the initial attachment frame and defer observer attachment and resize writes to avoid skipped resize delivery.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -63. Total -63 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 99 162 -63
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 5 99 162 -63

Labels

Label changes:

  • add P3: This is a behavior-preserving internal cleanup with no reported current user failure.
  • 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 is a behavior-preserving internal cleanup with no reported current user failure.
  • 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, 7:28 PM ET / 23:28 UTC.

@steipete
steipete merged commit f5d76ab into main Oct 18, 2026
106 of 107 checks passed
@steipete
steipete deleted the solid2/w-zero-chat-panel-primitives branch October 18, 2026 23:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: 👀 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