Skip to content

refactor(ui): present cron scratch reads with native readiness - #180116

Merged
steipete merged 6 commits into
mainfrom
solid2/w-s2-cron-scratch-readiness
Oct 22, 2026
Merged

steipete merged 6 commits into
mainfrom
solid2/w-s2-cron-scratch-readiness

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

On-demand Cron scratch reads need native pending and error presentation while retaining the user's draft when a reload fails. The HTML publication test also needs trusted pointer routing through its nested sandbox frames before clicking Count.

User Impact

Loading, failed reloads, and retries preserve the Scratch editor and draft. Saving or removing after a failed reload clears that stale read error and shows the write outcome. The existing save/remove actions, revision conflicts, redaction safeguards, and connection/job/access retirement remain intact.

Why This Change Was Made

The existing synchronous request owner still admits and settles work. A promise-returning Solid memo observes each admitted read; isPending, Loading, and a separate Errored slot present its readiness without replacing the editor. The conflict resolution against main 68d5fb239c11ab34addfcbf127e46b95b6281b3c retains main's native save actions and renewable retirement lifetimes.

The HTML test uses the existing clickBoardWidgetControl helper for one native Count click. All publication, source-retention, sandbox, exact-download, and output assertions are unchanged; main's failure diagnostics are retained.

Evidence

  • Frozen install, UI typecheck, scoped typed lint, formatting, and diff checks passed.
  • All 17 focused Scratch tests passed, including main's pending-save tests plus read/retry, stale-read-error retirement, duplicate admission, revision/redaction, and scope-retirement coverage.
  • Fresh independent P0–P2 review completed cleanly on the three-file delta against pinned main.
  • Exact-main and candidate production builds passed. Strict paired performance has zero violations or warnings: startup JS 316,499 → 316,963 B (+464 B); startup CSS 40,894 B / 1 request unchanged; Chat +504 B and New Session +479 B. Both builds use identical normalized metadata.
  • Existing inspected synthetic before/after captures below are retained: the integration does not change their presentation.
  • Retrospective production Knip: the final integrated-head/base check was missed before the 09:53:59 UTC merge. Canonical pnpm deadcode:knip runs on exact head 93a9b8c69bf5eeb3e312b7043d181111604c16e4 and base 68d5fb239c11ab34addfcbf127e46b95b6281b3c ran on October 22, 2026, from 09:57:21 to 09:59:35 UTC. Both exited 1 with byte-identical reports of 13 existing heartbeat unused files, no UI or unused-dependency findings, and no new findings on the head. This is post-merge evidence, not a pre-merge pass.

Scratch production LOC is 302 → 330 (+28) against the integrated main; tests are 277 → 343 (+66). The added production code presents read readiness and errors. No dependency, translation, route, tag, or selector changes.

Touched-file semantic checklist Before → after
Native conditional handlers, component lifecycle debt 0 → 0
Manual Scratch read presentation 1 → 0; one promise-returning memo
Mutations Main's native save/remove action retained
Lazy boundary, structured-state ownership, manual component calls Unchanged
Missing-provider wrappers, sibling coordination, owner escapes 0 → 0

Visual proof

All captures contain synthetic data; full frames were inspected. Loading and failure preserve the existing layout and unsaved draft.

State Before After
Loading Before scratch reload After scratch reload
Failed reload Before scratch reload error After scratch reload error

CI and browser proof

Prior run 39727333709 failed HTML publication on head 5679b933ba72d3cb8e4780092143bd686a96dd60: Count remained 0 after its click. This was not established as inherited. The pointer repair addresses that interaction without weakening assertions. A shared diagnostic ended at its 300-second watchdog before browser launch and is inconclusive setup evidence. Full CI run 39756469571 succeeded on integrated head 93a9b8c69bf5eeb3e312b7043d181111604c16e4, including UI and real-Gateway E2E. The PR merged as 4da5842f1bd51510fe3e0b876d77eb788a632436. No new local E2E pass is claimed.

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

clawsweeper Bot commented Oct 22, 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 22, 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-22T09:37:40.988537Z 93a9b8c 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: d6b2ea9348

ℹ️ 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 +168 to +171
function loadScratch() {
if (!pending && isCurrent()) {
void setReadReceipt(request());
}

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.

P2 Badge Clear the failed read when a write succeeds

After a reload rejects, read remains errored until setReadReceipt receives another read. The preserved draft can then be saved or removed because the controls re-enable, but those write paths never replace or reset the receipt, so a successful write displays “saved” or “removed” alongside the stale reload failure. Clear the read error after a successful write, or keep writes blocked until the read is retried, so the action presents one coherent outcome.

AGENTS.md reference: AGENTS.md:L75-L75

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR presents automation scratch reads through Solid loading and error boundaries while preserving drafts and existing write handling.

Example: Reload scratch while the textarea contains “Synthetic unsaved draft”.

  • Before: Manual busy and message state presents the pending read and its failure.
  • After: Solid readiness disables controls during reload, and the error boundary shows failure while retaining the draft.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused owner-preserving implementation with inspected visual proof, meaningful regressions, and an independently matched inherited CI failure.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected synthetic browser captures exercise the scratch editor’s pending and failed reload presentation with the draft retained; reported retry and focused regressions support recovery and write-error retirement.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Scratch reload must retain unsaved text and expose a recoverable failure without stale errors accompanying later write outcomes.
Reason: The maintainer-authored direction completes the named async-presentation follow-up while preserving existing controls and authority.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored PR open: the focused refactor preserves existing ownership and fixes the prior stale-error finding, with no new actionable defect found.

Priority: P3
Reviewed head: 02cb5f60554d835cbb8639158926d587116e670a

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Automations editor sends scoped scratch get/set requests to the Gateway and presents redacted content, revision conflicts, and write outcomes.

flowchart TD
  A[Automations editor] --> B[Scratch request owner]
  B --> C[Gateway scratch RPC]
  C --> D[Revision and draft state]
  B --> E[Read receipt]
  E --> F[Solid readiness and error boundary]
  D --> G[Scratch controls]
  F --> G
Loading

Technical review

Best possible solution:

Retain the existing request owner and merge this focused readiness refactor through the repository’s inherited-failure handling.

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

This is primarily a refactor; source inspection confirms the manual presentation on main, and the PR reports red/green reproduction of its intermediate stale-error defect.

Is this the best way to solve the issue?

The change follows the existing receipt-observer recipe, removes manual read-busy presentation, and preserves synchronous admission, scope retirement, revision checks, and mutation outcomes.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Scratch admission, redaction, revisions, and scope retirement keeps the original intent (ec5d369: The Automations migration made scratch independently editable while preserving revision and authority boundaries.)
  • Draft-store presentation keeps the original intent (d131ab9: Use draft store updates without changing admission or markup; native async presentation remained an explicit follow-up.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +39, Tests +67. Total +106 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 102 63 +39
Tests 1 67 0 +67
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 169 63 +106

Review metrics

Metric Value Why it matters
Production versus test growth Production +39 LOC; tests +67 LOC Growth supplies the native readiness/error boundary and distinct draft-retention and stale-error regressions without introducing another request owner.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a focused presentation refactor with preserved user behavior and a repaired intermediate stale-error regression.
  • 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 (3 earlier review cycles)
  • reviewed 2026-10-22T01:41:36.585Z sha d6b2ea9 :: needs changes before merge. :: [P2] Clear the rejected read receipt after a successful write
  • reviewed 2026-10-22T02:47:37.106Z sha 02cb5f6 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-22T02:56:13.749Z sha 02cb5f6 :: needs maintainer review before merge. :: none

Reviewed October 22, 2026, 12:47 AM ET / 04:47 UTC (Revision 4).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 22, 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: 🐚 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 P2 Normal backlog priority with limited blast radius. 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 22, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Oct 22, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
Merge current main while preserving native Scratch read readiness, main save-action retirement, and the existing nested-frame Count pointer repair.

Validation: 17 focused Scratch tests, UI typecheck, scoped typed lint and formatting, and fresh independent review passed. Paired build comparison remains a pre-push gate.
@steipete
steipete enabled auto-merge (squash) October 22, 2026 09:42
@steipete
steipete merged commit 4da5842 into main Oct 22, 2026
95 of 96 checks passed
@steipete
steipete deleted the solid2/w-s2-cron-scratch-readiness branch October 22, 2026 09:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…law#180116)

* refactor(ui): present cron scratch reads with native readiness

* fix(ui): retire failed scratch reads when writes start

* test(ui): wait for HTML preview pointer routing
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