Skip to content

refactor(ui): consolidate page reads and canonical display facts - #175698

Merged
steipete merged 1 commit into
mainfrom
deslop/z31-1-page-loaders-20261015
Oct 17, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/z31-1-page-loaders-20261015

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Control UI pages independently implement replaceable reads and reconstruct already-canonical Gateway records, leaving several competing owners for the same work.

User Impact

Rendering and supported workflows are unchanged. Skills Library and Workshop now also keep a retired scope's failed read from publishing an error or clearing the current scope's loading state.

Why This Change Was Made

Relocate Usage's request executor into one small page-request owner and adopt it in Plugins, Providers, Worktrees, New Session remote search, Meetings, Memory Import, and Skills. Retain ordinary scope cancellation and caller-owned mutation/security admission. The executor releases before completion callbacks so existing refresh policies can start a successor; publication failures still propagate.

Consume typed update and question records from their Gateway producers instead of maintaining parallel structural decoders. Keep display normalization, URL/media/secret-store checks, omitted-versus-null update semantics, hydration and resolution authority. Reuse the existing text-diff traversal in Workshop and avoid re-normalizing already-normalized theme/settings facts.

Net production reduction: 502 lines against the branch base (tests and proof artifacts excluded). No schema, config, protocol, dependency, or changelog change.

Best-effort tradeoffs accepted

Evidence

Focused owner suites passed, including regressions that failed before the Library/Workshop scope fixes; the latest question/shared-request run passed 91 tests across five files in 27.28 seconds. Earlier unaffected owner runs passed 263 tests. Tests run serially with one worker under isolated HOME/OpenClaw/XDG state. No retries, skips, timeout increases, or weakened retained assertions were introduced.

Targeted production types and all three touched-test graphs passed, extending the canonical UI app/pages/other test configs. Formatting passed all 31 extant changed/new files. Independent review completed scoped-clean P0–P2 against the complete source, with final source verification. Targeted lint passed (two unchanged Meetings stable-callback warnings); lint-suppressions passed 14 tests on both Node and pinned Bun. Runtime cycle check passed with zero cycles. The whole-UI import graph check was stopped after ten minutes of compiler work without a result under shared-host load; no passing result is claimed, and exact-head hosted CI must provide that gate. Exact-head PR CI is the broad proof; no local full suite/build/E2E was run under the shared-host budget.

Inspected before/after synthetic captures cover the update prompt, question card, and Workshop saved-version diff. Layout, labels and ordering match; elapsed live counters in the surrounding mock UI differ. Captures use isolated synthetic fixtures, not a real Gateway or personal state.

Conflict-only rebase: preserved both main's disconnected-import policy regression and this branch's retired-list regression. Production patch is unchanged; only adjacent test placement changed. Rebased Library suite passed 12/12; targeted conflict-test types and lint passed. The suppression replay passed 13/14 on Node and pinned Bun, failing on the inherited src/infra/database-engine/admission-role.test-support.ts|unicorn/require-post-message-target-origin|1 inventory entry absent from its allowlist. Both that source and test/scripts/lint-suppressions.test.ts are byte-identical to main base a0d2f6e24de16310dbb5a82bf2dc3693f6e8a1b5; this diff adds no suppressions or baseline exceptions. Earlier full proof above is pre-rebase evidence, not new-head hosted success. Exact-head hosted CI remains required.

Update prompt before

Update prompt after

Workshop saved-version diff before

Workshop saved-version diff after

Question card before

Question card after

@clawsweeper

clawsweeper Bot commented Oct 17, 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.

Share replaceable page requests, consume canonical Gateway update/question facts, and reuse the Workshop text diff owner. Preserve display and security boundaries while avoiding repeated internal normalization. Prevent retired Library and Workshop reads from publishing errors into the current scope.
@steipete
steipete force-pushed the deslop/z31-1-page-loaders-20261015 branch from 38b0d6c to c19fc17 Compare October 17, 2026 16:53
@steipete
steipete marked this pull request as ready for review October 17, 2026 16:53
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T16:57:36.475404Z c19fc17 Draft marked ready
ℹ️ 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro 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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. 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 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR shares replaceable page requests, consumes canonical Gateway display records, and prevents retired Skills reads from changing the current view.

Example: Switch Workshop from research to scout while research's list request is pending.

  • Before: A later research failure displays its error and clears scout's loading indicator.
  • After: The retired failure is ignored and scout remains loading until its own request settles.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, coherent consolidation with no identified defect and successful current-head checks; behavioral evidence remains primarily harness-based.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; inspected synthetic update and Workshop captures show visual parity, while retired-scope failure handling is demonstrated only by owner tests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: A failed read from a previous Skills connection or selected agent can display an irrelevant error and prematurely stop the current loading state.
Reason: The direction is maintainer-approved, removes competing owners, and includes a concrete scoped-error repair without adding configuration or public API.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed refactor consolidates request ownership and fixes stale Skills errors; no actionable introduced defect was found.

Priority: P2
Reviewed head: c19fc17a9b3678a9d36714c26e4c4634f996ce78

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied captures do not demonstrate a retired Library or Workshop failure through a real Gateway; that behavior is supported by owner-level regressions.
Agent review details

How this fits together

Control UI pages receive Gateway RPC results and events, retain connection-scoped request ownership, and publish current results into their display state.

flowchart LR
  A[Control UI pages] --> B[Shared page request owner]
  B --> C[Gateway RPC client]
  C --> D[Canonical Gateway producers]
  D --> E[Results and events]
  E --> F[Scoped display projections]
  F --> A
Loading

Technical review

Best possible solution:

Retain the shared request owner and canonical producer contracts with the existing scoped publication and effect-admission checks.

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

Current-main Library and Workshop failure paths lack the scope checks already used for successful results; the added deferred-request regressions exercise that mismatch, but no target code was run during this review.

Is this the best way to solve the issue?

The patch reuses the existing Usage invocation model, removes competing implementations, and preserves caller-owned mutation admission; producer and settings-writer inspection supports the explicitly accepted normalization removals.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Introduced change and clean checkout: Reviewed the pinned merge-base-to-head hunks rather than endpoint drift; the checkout remained clean. (c19fc17a9b36)
  • Request ownership preserved: The shared executor rejects superseded publications, releases ownership before callbacks, propagates publisher exceptions, and retains no completed payload cache; its Usage and Plugins predecessors are removed. (ui/src/lib/page-request.ts:37, c19fc17a9b36)
  • Current-main Skills defect: Current main still publishes Library errors and clears loading without checking the captured connection; the patch adds that check, and Workshop receives the corresponding scope check. (ui/src/pages/skills/library-state.ts:143, 53829f9e6a00)
  • Accepted canonical-producer tradeoffs: The maintainer-authored body explicitly accepts removing duplicate structural filtering and normalization. Source inspection confirms question request validation, theme normalization at producers, retained question URL/media/secret checks, and synchronous Worktrees request retirement. (ui/src/app/question-prompt-parse.ts:25, c19fc17a9b36)
  • Settings compatibility: Storage keys, shapes, and defaults remain unchanged; persisted loads still normalize all three maps, and their entry-update owners normalize or bound writes before save. (ui/src/app/settings.ts:458, c19fc17a9b36)
  • Inspected visual evidence: The four prepared images show matching synthetic update and Workshop before/after layouts; surrounding elapsed counters differ. These images establish visual parity, not real-Gateway request recovery. (c19fc17a9b36)

PR surface

Source -502, Tests -11. Total -513 across 34 files. Added test files: 2.

View PR surface stats
Area Files Added Removed Net
Source 27 288 790 -502
Tests 7 299 310 -11
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 34 587 1100 -513

Review metrics

Metric Value Why it matters
Production versus test LOC Production −502 LOC; tests −11 LOC The reduction comes from deleting duplicate decoders, request executors, and diff traversal while adding focused scope regressions.

Labels

Label changes:

  • add P2: The stale Skills failure affects loading and error presentation with limited scope; the remaining change consolidates existing behavior.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • 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:

  • P2: The stale Skills failure affects loading and error presentation with limited scope; the remaining change consolidates existing behavior.
  • 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.

Reviewed October 17, 2026, 1:11 PM ET / 17:11 UTC.

@steipete
steipete merged commit 36bd5fa into main Oct 17, 2026
149 of 150 checks passed
@steipete
steipete deleted the deslop/z31-1-page-loaders-20261015 branch October 17, 2026 18:24
@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 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. 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