Skip to content

refactor(ui): use a Solid action for usage-limit copying - #179256

Merged
steipete merged 5 commits into
mainfrom
solid2/w-s2-chat-a-actions
Oct 21, 2026
Merged

steipete merged 5 commits into
mainfrom
solid2/w-s2-chat-a-actions

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The ChatGPT business usage-limit dialog manually combines the clipboard operation's temporary copying state with its durable success/failure feedback. This adopts Solid 2's native action lifecycle for that operation while preserving the current UI behavior.

User Impact

Copy request for admin remains disabled while the clipboard write is pending. A retry hides the previous result until it finishes. Successful copies keep their confirmation; denied copies keep the manual request fallback. Consumer links, modal dismissal, and parked-session behavior are unchanged.

Why This Change Was Made

A generator action co-writes createOptimistic(false) for the temporary copying affordance and commits the clipboard owner's boolean result to the existing feedback signal. The optimistic flag resets when the action settles. copyToClipboard remains the sole owner of secure-context copying, legacy fallback, and cross-control attempt ordering. There is no server-owned read to refresh or affected server slot to declare.

This uses the shared action-runtime split from #179084. The native button keeps its void-returning handler contract while invoking the action. No chunking policy, startup import, dependency, component tag, class, or style is added here.

Evidence

Proof Result
Focused Bun test file, one worker 4 passed in 15.43 s after merging main’s Solid rc.16 upgrade; the existing copy case now holds both clipboard promises to prove pending disablement, retry feedback, settlement, and manual fallback
UI typecheck pnpm tsgo:ui passed again with tsrs after the rc.16 integration
Targeted lint/format Full type-aware lint and formatting passed for the current repair batch
Production Knip pnpm deadcode:knip passed in 7m 4.3s
Independent Codex review Scoped-clean through P2; the first attempt exited without a review result, and the same-service retry with the installed rc.14 contract completed successfully
Same-machine base/head root UI build and strict performance Bundle emission and finalized sidecar validation passed on both sides. Startup: 331,664 → 331,667 B gzip (+3 B), identical 996,727 raw bytes, 8 JS requests, and 1 CSS request. Both fail the inherited absolute ratchet
Chat boot 1,494,142 → 1,494,208 B gzip (+66 B), within the 1,500,000 B cap
Broad UI, E2E, chat performance and retention PR CI with ci:full

The unchanged base already fails the strict 325,476-byte startup ratchet. The candidate adds 3 gzip bytes, within the existing 64-byte build-variance allowance, with identical raw startup bytes. The shared runtime split keeps the action consumer out of startup; no budget is changed and no absolute pass is claimed. The unit run emits an existing diagnostic for the unchanged presented read in the modal's open-change callback; no diagnostic is suppressed.

No appearance or layout changes are intended: markup, classes, content, controls, and observable pending/result states are preserved. The focused test exercises those existing states; there is no new visual state to screenshot.

Solid 2 Audit

Counts cover the touched production component. The full top-level chat audit and its retained synchronous owner contracts are recorded in #179073.

Checklist item Before After
1. Conditional intrinsic handler bindings 0 0
2. Component onCleanup 0 0
3. Hand-written async read flags 0 0
4. Manual mutation process flags 1 0
5. Manual component import loaders 0 0
6. Copied structured local signals 0 0
7. Hand-written createComponent 0 0
8. Missing-provider context wrappers 0 0
9. Uncoordinated sibling Loading regions 0 0
10. Solid root/owner escape calls 0 0
Native actions / optimistic affordances 0 / 0 1 / 1
Production LOC 90 91
Test LOC, including the HTML publication flow 371 382

Effects, untrack, direct native listeners, DOM queries, flush, and owner escapes remain zero. The one production line adds the native optimistic affordance; no wrapper or new owner is introduced. The durable result signal is retained because the user must see the copy outcome after the transaction ends. The Solid skill, refactor checklist, installed rc.14/rc.16 cheatsheets and action types, and upstream action RFC informed the change.

The CI repair batch restores the void-returning native click wrapper and waits for the HTML preview counter's existing expected value after clicking it. Sandbox, final-byte, and exact-download assertions are unchanged. Main supplies the solo-widget resize/setup repair.

CI run 39574108500 on 25cce0aabf8d proves the repaired HTML-publication case (12.24 s) and solo-widget case (5.129 s). Full type-aware lint and performance pass: startup 329,236 B gzip, 986,759 raw bytes, 8 JS / 1 CSS request; chat boot 1,497,985 → 1,498,057 B gzip (+72 B). These are prior-head results, not proof of the replacement main integration.

That run also fails the pane-header case already repaired on main in #179221, the Markdown containment case, and the cross-channel automation case at its first create: reply wait. The then-latest completed scheduled main 39578067192 reproduces both the exact Markdown test and line-214 assertion, and the exact automation test and line-308 timeout (final bus-event kinds=[inbound-message,outbound-message]). The local automation baseline was stopped during worker compilation once this matching main evidence arrived; it produced no test verdict. Source attribution alone is not used as inherited-failure proof.

The main integration retains #179221’s exact pane-activation repair. Frozen installation and pnpm tsgo:ui pass, and the unchanged three-file authored delta is independently reviewed clean through P2. The confirmed-cancelled auto request remains retired; the replacement head will use native recovery after its full CI run.

Final candidate CI 39585793366 (adf32da240a8) passes all UI-unit shards, eight of nine UI E2E shards, performance, and security-fast. The HTML-publication case passes in 12.040 s, folding in 21.726 s, and real-Gateway chat loading performance in 27.161 s. The only failed jobs contain the exact Markdown containment assertion (line 214) and automation create: timeout (line 308) also failing on latest completed scheduled main 39585413125. The run has 35 successful, 26 intentionally skipped, and those two failed jobs plus their aggregate gate; no cancelled or timed-out job is omitted.

Current-head startup is 330,965 B gzip, 990,059 raw bytes, 8 JS / 1 CSS request. Chat boot is 1,499,590 → 1,499,584 B gzip (−6 B). Performance passes. Native inherited-failure evidence pins tested merge 794eec7cb2da with ordered parents b79c32a97f88 and this exact head, verifies unchanged named failure inputs, and retains hashed PR/latest-main logs. Landing uses explicit replacement recovery of the confirmed-cancelled auto request; failed CI is not relabeled green.

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

clawsweeper Bot commented Oct 21, 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 21, 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 🔄 Running since 2026-10-21T10:36:21.474214Z adf32da 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.

@steipete
steipete enabled auto-merge (squash) October 21, 2026 08:24
@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 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces manual clipboard pending state with a Solid action and optimistic flag while retaining copy-result feedback.

Example: A Business user clicks Copy request for admin, then retries after a successful copy.

  • Before: A combined state signal disables the button while copying and displays success or manual-copy fallback afterward.
  • After: Solid manages the pending flag; the button, retry feedback, confirmation, and manual-copy fallback retain their existing behavior.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent, while behavioral evidence remains a component harness rather than shipped-entry-point proof.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; supplied evidence is a focused component test and build validation, with no live-browser copy demonstration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Existing copy behavior is preserved while temporary process state moves to Solid's native lifecycle.
Reason: The maintainer-authored direction matches the documented Solid pattern and the explicitly deferred follow-up, with a narrowly scoped implementation.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR is a focused Solid lifecycle refactor with no actionable introduced defects found; required CI remains unsuccessful.

Priority: P3
Reviewed head: d8249d1082c426b8b442cae8e8e190130d9bf398

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supplied coverage exercises pending, retry, and fallback through a mounted component with mocked clipboard I/O; it does not demonstrate those interactions in a running browser.
Agent review details

How this fits together

The chat notice renderer selects a session/run-scoped usage-limit dialog, whose copy button passes localized request text to the shared clipboard helper and displays its boolean outcome.

flowchart TD
  A[Chat run error] --> B[Chat notice renderer]
  B --> C[Usage limit dialog]
  C --> D[Solid copy action]
  D --> E[Shared clipboard helper]
  E --> F[Browser clipboard or legacy fallback]
  E --> G[Success or manual copy feedback]
Loading

Technical review

Best possible solution:

Retain this small conversion using Solid for pending presentation and the existing clipboard helper for copying and fallback policy.

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

No broken product behavior is claimed; source inspection confirms the manual pending-state implementation this refactor replaces.

Is this the best way to solve the issue?

The conversion follows the documented Solid action contract, preserves durable feedback, and adds no competing clipboard owner or unnecessary abstraction.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Usage-limit clipboard presentation and behavioral test keeps the original intent (dbda20f: Provide actionable ChatGPT usage-limit recovery with copy confirmation, manual fallback, and session/run-scoped dismissal.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • stevenlee-oai: Raw commit dbda20f adds ui/src/pages/chat/chatgpt-usage-limit.tsx:10 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dbda20fd3afd; files: ui/src/pages/chat/chatgpt-usage-limit.tsx)
  • Peter Steinberger: Raw commit 6406ebc adds ui/src/components/session-group-defaults-dialog.tsx:52 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6406ebccc96e; files: ui/src/components/session-group-defaults-dialog.tsx)

PR surface

Source +1, Tests +11. Total +12 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 11 10 +1
Tests 1 13 2 +11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 24 12 +12

Labels

Label changes:

  • add P3: This is a behavior-preserving UI lifecycle cleanup without an established user-facing regression.
  • 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 UI lifecycle cleanup without an established user-facing regression.
  • 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 21, 2026, 4:39 AM ET / 08:39 UTC.

@steipete
steipete disabled auto-merge October 21, 2026 08:45
@steipete
steipete merged commit a5e54e4 into main Oct 21, 2026
100 of 104 checks passed
@steipete
steipete deleted the solid2/w-s2-chat-a-actions branch October 21, 2026 11:34
@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 22, 2026
…9256)

* refactor(ui): use a Solid action for usage-limit copying

* fix(ui): preserve action handler and HTML result contracts
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: XS 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