Skip to content

refactor(ui): derive page views from canonical owners - #177660

Merged
steipete merged 9 commits into
mainfrom
solid2/w-view-owner-data
Oct 20, 2026
Merged

steipete merged 9 commits into
mainfrom
solid2/w-view-owner-data

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem and change

Agent panels copied fields from their reactive page and channel owners, and Usage repeated owner output in parallel view contracts. Panels now read their existing owners, and view types derive from those owners. The Agents page also delegates identity loading to the existing identity capability, deleting redundant loading state, cache filtering, and request cleanup. The capability already owns access checks, deduplication, stale replies, and RPC errors.

Identity drafts remain with the identity actions. Shared Usage state has a type-only leaf, and Channels retain explicit callback contracts. Routes, host tags, classes, styles, and lazy boundaries are unchanged. Sessions and Model Setup changes were removed after equivalent work landed or was covered by another lane.

Proof

Check Result
UI typecheck pnpm tsgo:ui passed using tsrs
Identity owner and Agents selection tests 38 passed; pinned Bun, one worker; 3.51 s
Identity request sharing Existing owner test: 40 overlapping ensure calls, 24 agents, 24 RPCs, one publication
Independent Codex P0–P2 review Original three-part owner/view review plus fresh isolated identity review; no actionable findings
Targeted lint / format / diff check Passed
Production Knip pnpm deadcode:knip passed
Solid controller and ratchet guard Passed; touched production controllers/effects/render effects/untrack/listeners/queries/flush/owner calls all remain 0 → 0
Original focused proof 18 overview/skills browser tests and 66 view/overview/page tests passed; original type repairs have identical runtime ASTs and zero static import cycles
Main integration Preserved shared ModelCatalogReader; five focused recovery cases passed on the previous head
Visual / startup No markup, style, route, or startup-boundary change; no build or screenshots needed
Broad CI Exact-head ci:full run 39353552457 passed: 45 success / 24 skipped, including full UI E2E and real-Gateway shards

Production LOC: 5,723 → 5,568 (−155) across 19 files. Tests/helpers: 4,619 → 4,726 (+107) across 15 files. Whole PR: −48 lines across 34 files. Test growth changes flat field fixtures to owner accessors while preserving behavior assertions; the identity test waits for the relevant refresh instead of page-local deduplication.

The previously green head encountered conflicts with main's Model Setup and Sessions simplifications. Equivalent changes are now excluded from this PR. The confirmed-cancelled auto request remains retired; landing uses native replacement recovery after current-head review, preparation, and CI.

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

clawsweeper Bot commented Oct 19, 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 19, 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-20T01:31:23.621370Z 8f7a7b9 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 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 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR derives Control UI view contracts from existing owners and replaces copied Agent panel fields with reactive owner accessors.

Example: Open agent beta’s Files panel and edit AGENTS.md.

  • Before: The panel reads file content, drafts, and loading flags copied into its view props.
  • After: The panel reads those values through the existing reactive page owner while retaining the same editing controls.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is coherent and source review found no actionable defect; retained evidence is harness-level rather than shipped-entry-point proof.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; the supplied evidence reports focused tests and typechecks, without a current shipped-entry-point artifact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The maintainer-approved direction reduces duplicated UI contracts and projection code while preserving existing user behavior and synchronous mutation ownership.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored refactor removes duplicate view contracts, and inspection found no concrete introduced defect; CI failures still need attribution.

Priority: P3
Reviewed head: 62bc0c75f6d99b7df87abf1724891522949d6957

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No current shipped-browser evidence demonstrates Agent panel updates through the new accessors; ordinary contributor proof gating does not apply to this maintainer-authored PR.
Agent review details

How this fits together

Control UI page owners receive Gateway state and manage synchronous requests and drafts; reactive projections expose their facts to Solid views, whose callbacks invoke the existing owners.

flowchart LR
  Gateway[Gateway state] --> Owners[Canonical domain owners]
  Owners --> Pages[Page owners and drafts]
  Pages --> Projections[Reactive owner accessors]
  Projections --> Views[Solid page views]
  Views --> Actions[Existing action callbacks]
  Actions --> Pages
Loading

Technical review

Best possible solution:

Keep the existing owners authoritative and land the accessor and type derivation cleanup once required CI has an attributable disposition.

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

This PR proposes a behavior-preserving refactor rather than a reproducible product bug; source inspection confirms the duplicated contracts and projections it removes.

Is this the best way to solve the issue?

The change uses existing reactive readers and owner output types, preserves intentional view narrowing, and adds no competing state owner or unnecessary production machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Agent page projections and panel rendering keeps the original intent (25e7d4f: The scoped Agents migration retained synchronous requests, selection, drafts, and permission owners while exposing presentation props.)
  • Agent channel connection status keeps the original intent (7e3e4f6: Explicit connected and running fields take precedence over successful API probes; the summarization logic and its regression assertions remain unchanged.)
  • Sessions and Usage presentation contracts keeps the original intent (376ccd5: Scoped factories separate synchronous request decisions from Solid presentation state; this PR retains that separation and existing refresh completion behavior.)
  • Connection view contract keeps the original intent (74828ac: The Solid migration preserved connection drafts and Gateway authority; the replacement contract remains type-only and retains readonly arrays and void callbacks.)
  • Model Setup sibling view contract keeps the original intent (03ee297: A neutral sibling module avoids duplicated DTOs and runtime coupling; this PR retains the module and derives its fields through type-only imports.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -264, Tests +101. Total -163 across 36 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 21 437 701 -264
Tests 15 371 270 +101
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 36 808 971 -163

Review metrics

Metric Value Why it matters
Production versus test LOC Production +437/-701 (net -264); tests/support +371/-270 (net +101). Production removes repeated contracts and field packets; test growth adapts existing fixtures and assertions to owner accessors.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is behavior-preserving internal UI cleanup with no demonstrated urgent user-facing 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 19, 2026, 4:02 PM ET / 20:02 UTC.

@steipete
steipete enabled auto-merge (squash) October 19, 2026 20:58
@steipete
steipete disabled auto-merge October 19, 2026 21:22
# Conflicts:
#	ui/src/pages/model-setup/model-setup-owner.ts
#	ui/src/pages/model-setup/view-types.ts
#	ui/src/pages/sessions/sessions-page-state.ts
#	ui/src/pages/sessions/sessions-page-state.types.ts
@steipete
steipete merged commit 5a85669 into main Oct 20, 2026
105 of 109 checks passed
@steipete
steipete deleted the solid2/w-view-owner-data branch October 20, 2026 02:10
@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 20, 2026
* refactor(ui): derive page views from canonical owners

* refactor(ui): retire unused channel view type exports

* fix(ui): keep page view types in their owning layers

* test(ui): settle lazy attachment previews before removal checks

* refactor(ui): keep identity loading with its canonical owner
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: 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