Skip to content

refactor(ui): remove duplicate shell layout publication - #176965

Merged
steipete merged 5 commits into
mainfrom
solid2/w-zero-layout-traits
Oct 19, 2026
Merged

steipete merged 5 commits into
mainfrom
solid2/w-zero-layout-traits

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Remove the migration-only initial shell-layout publication and its untrack snapshot. The existing tracked effect publishes traits before descendant settled measurements, then owns later updates and cleanup through the same ShellLayoutOwner. Initial measurement probes now use onSettled; the native, bridged, detached and Models loading-shell contracts remain covered.

The current change also preserves bounded public failure facts for the unexplained self-avatar CI case: request/status/MIME counts and menu/avatar presence. Raw URLs and identifiers are not exported; public facts are booleans, counts or null. Existing assertions, test timeouts and baselines are unchanged. The best-effort avatar DOM read has a one-second host deadline, so a stalled renderer cannot hide the original assertion failure. Main owns the managed-media capture observer and waits for the terminal recap before capture. The conflicting local media diagnostics were removed during rebase; that file is unchanged by this PR.

Proof

Base: 886ba0f3eaeb533f53b17ba47ffc30e179449388. Head: 5ec028691d4f21a8a653fd370ad0ed4cbc3b93dc. The original four commits are patch-identical across the latest rebase; the layout patch is unchanged. Rebase resolution retained main's managed-media helper and removed our overlapping diagnostic additions. Frozen install, the default UI and affected UI E2E type graphs, focused lint and formatting passed on this final patch. The added root-owner diagnostic passed independent P0–P2 review. No checker override has been used: pnpm tsgo:ui runs the repository's default tsrs backend.

Check Result
Original layout unit contract 11/11 passed once on the earlier patch-identical head
Diagnostic helper unit 22/22 passed once
Diagnostic types Final UI types passed; both affected E2E type graphs passed before the conflict-only removal
Production Knip Passed on final head 5ec028691d4f; no ignores added
Independent review / simplify Reduced patch reviewed; one P2 unbounded diagnostic read fixed, then scoped-clean P0–P2 review
Prior failed CI 39219095698: two E2E failures; other jobs passed
Lint correction Run 39227526531 exposed three shadowed diagnostic locals and a missing-braces error; all corrected, focused lint passed, independent review clean
Exact-case replays Each case passed once on actual base and candidate; full owner file also passed 12/12 once
Gateway cleanup diagnostic Exact failing-PR base replay passed 4/4; root-owner message reviewed, typed and linted; full CI passed
Scheduled main comparison 39218528567: both exact names pass

The prior-head failures were Control UI session owner assignment mocked Gateway E2E > assigns named and self owners through one themed keyboard-accessible submenu (self-avatar image count 0), and Managed image ordering through real chat.send and history > keeps headings, managed images and trailing prose ordered live and after reload without duplicates (image/frame nodes replaced with identical bounds). The retained CI artifact omitted the private DOM/screenshot detail needed to distinguish causes. Passing replays are not a repair or an inherited-failure claim. The avatar diagnostic change supplies missing evidence if that failure recurs. The managed-media case uses main's newer capture observer without local changes.

Run 39227526531 also failed the first Control UI usage sessions owner attribution > keeps same-id owners separate with an empty current session: %s case during browser cleanup: two Gateway roots remained after 15 seconds. The retained fixture failure then failed the second parameter and both clears ranges after session recreation (1 points) / (2 points) cases. All four exact cases passed scheduled main 39225083411, and all four passed one local replay on actual failing-PR base ccfc2d2961bb5836654fb10ce4d89638af938448 (148.51 seconds in Vitest, 303.08 seconds including the required runtime build). This is an unresolved prior-head cleanup failure, not an inherited-failure claim. The assertion now includes the existing bounded Gateway root-owner inventory; its zero-count requirement, timeout and cleanup order are unchanged. Current-head CI must pass this file.

Production Knip passed on this final head. Older candidates and their exact bases both reported the same unused Signal/Levanto/plugin-install-record declarations; current main has removed those failures. No ignores or production workaround were added.

Historical paired production proof is reused for the unchanged layout patch: base 86431079ec51, head b87870628254, same machine. Both builds passed; startup was 337,063 → 337,060 B gzip, CSS 38,500 B / 1 request unchanged. Both strict checks failed only the then-existing New Session cap (1,050,179 → 1,050,170 B; limit 1,050,000 B). Four inspected synthetic before/after pairs are byte-identical. These are historical results, not current-head performance claims. Current PR CI owns current performance and broad ci:full proof; its measured results are below. No local full E2E/parity suite or remote lease.

Final current-head CI and inherited exception

Run 39231810160 tested merge 2259569a90505d75126bee1f0aa9b73942bc8f05 of main 4d86a5965c24e1684185e6d6bab6d97ed26bd0de and this head. All nine UI browser shards, both real-Gateway shards, types, lint and performance passed. The prior avatar, media and Gateway root-cleanup cases pass in this run.

The only failed test is src/pages/chat/components/chat-composer-plus-menu-loading.test.tsx > keeps the menu open and retries a failed content load: the menu closes and hides its error/Retry control. One targeted run on the actual CI main parent reproduced that exact case and assertion (1 failed, 6 passed; 3.45 s Vitest / 6.12 s including the wrapper). The latest completed scheduled main run predates this regression and passed it; the inheritance claim uses the actual-base failure, not a shared shard name. #177208 owns the fix. This PR does not edit those sources. Their four relevant blobs are identical across base, head and the inspected tested merge. The downstream CI gate is red solely for that case. Native inherited/admin replacement recovery is used under the user's standing authorization; this failed run is not described as green.

Current CI performance Result
Startup JS 323,892 B gzip, 7 requests
Startup CSS 38,500 B gzip, 1 request
Chat boot JS, paired base → tested merge 1,455,558 → 1,455,502 B gzip
New Session boot JS, paired base → tested merge 1,024,741 → 1,024,709 B gzip
Strict performance check Passed

Size and wave-zero counts

The layout production delta is 34 → 32 LOC; its tests 314 → 318. Avatar diagnostics add 98 net test/helper lines and the Gateway cleanup message adds 7, with no runtime change. Complete diff: 6 files, +125/−18. All changed tests/helpers 3,257 → 3,366 (+109). Growth retains otherwise-missing CI evidence; it adds no production synchronization.

Production pattern Before After
untrack 1 0
createEffect 1 1
createRenderEffect 0 0
addEventListener 0 0
querySelector(All) 0 0

The surviving effect publishes page layout traits into the ancestor shell's class owner. No new owner, primitive, eager import or compatibility path. Changelog is release-owned.

Before / after

Synthetic full Models Settings app and shell, with identical masking of checkout metadata only. Pending frames show the auth-status response pending; the global model defaults are already rendered. The unchanged unit regression owns the pre-body reservation proof. These are bounded captures of the touched state, not a full E2E run.

State Before After
Desktop 1440×1000, auth-status response pending Before desktop pending After desktop pending
Desktop 1440×1000, auth-status settled Before desktop settled After desktop settled
Mobile 393×852, auth-status response pending Before mobile pending After mobile pending
Mobile 393×852, auth-status settled Before mobile settled After mobile settled

No remote leases, private state, or model calls. Changelog is release-owned in this repository.

@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-19T09:43:42.168255Z 5ec0286 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR removes the eager shell-layout publication and moves two initial test measurements into Solid’s settled lifecycle.

Example: Open Models Settings at 1440×1000 while auth status is pending.

  • Before: The Models column has the expected layout, with traits published eagerly and again through the tracked effect.
  • After: The Models column retains the same layout, with publication handled by the tracked effect.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused, justified cleanup with inspected visual evidence and no introduced defect; the exact-head Gateway failure remains unattributed.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The supplied production-browser captures exercise the Models Settings app and shell with synthetic data at 1440×1000, showing matching pending and settled layouts before and after the change; the retained owner tests support dynamic updates and cleanup.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No visible behavior change is intended; the shell retains redundant migration-era initialization.
Reason: The maintainer-authored direction removes an unnecessary publication path without adding state, API, configuration, or another owner.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this maintainer-directed cleanup removes redundant initialization while preserving the existing layout owner; no introduced code defect was found.

Priority: P3
Reviewed head: b878706282540e3472966f6a3d040eaeafd224c2

Before merge

  • Resolve merge risk - Before merge, establish whether the real-Gateway transcript-reader failure is independent of this PR or requires a repair.

Findings

None.

Agent review details

How this fits together

Control UI page components report layout traits through ShellLayoutBoundary to ShellLayoutOwner, which applies classes to the ancestor main element and clears departing reporters.

flowchart TD
  A[Settings and route components] --> B[ShellLayoutBoundary]
  B --> C[Tracked Solid effect]
  C --> D[ShellLayoutOwner]
  D --> E[Main element classes]
  E --> F[Settled descendant measurements]
Loading

Technical review

Best possible solution:

Use the existing tracked effect as the sole trait publisher while retaining synchronous class ownership, settled measurements, and reporter cleanup.

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

This is a refactor rather than a reported product failure; source confirms eager and tracked initial publication, and no target code was executed during review.

Is this the best way to solve the issue?

The diff is the smallest complete cleanup: it removes the redundant path, keeps the existing owner, and preserves distinct loading, update, sibling, bridge, and cleanup assertions.

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Use the existing tracked effect as the sole trait publisher while retaining synchronous class ownership, settled measurements, and reporter cleanup.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Provenance checked

  • Eager initial shell-layout publication changes intended behavior with a stated reason (eca633a: The migration published traits before evaluating descendant getters so setup-time measurements saw the shell classes.)
  • Tracked publication and synchronous owner keeps the original intent (7310bf1: The rendering-lifetime cleanup replaced the render effect with a user effect while retaining the synchronous layout owner and initial snapshot.)
  • Initial measurement probes changes intended behavior with a stated reason (eca633a: The original tests measured during component setup; this PR explicitly changes their timing to supported settled setup while retaining layout assertions.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit eca633a adds ui/src/app/shell-layout-traits-solid.tsx:22 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: eca633a8801b; files: ui/src/app/shell-layout-traits-solid.tsx)
  • Ayaan Zaidi: Raw commit 5e97b15 adds ui/src/app/shell-layout-traits-solid.test.tsx:28 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5e97b15d2105; files: ui/src/app/shell-layout-traits-solid.test.tsx)

PR surface

Source -2, Tests +4. Total +2 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 4 -2
Tests 1 7 3 +4
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 9 7 +2

Review metrics

Metric Value Why it matters
Production versus test LOC Production −2; tests +4 The cleanup removes the eager snapshot and publication; test growth places existing measurements in onSettled without adding scaffolding.

Labels

Label changes:

  • add P3: This is a small behavior-preserving UI lifecycle cleanup with no established user-facing regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.

Label justifications:

  • P3: This is a small behavior-preserving UI lifecycle cleanup with no established user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • 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.

Reviewed October 19, 2026, 1:40 AM ET / 05:40 UTC.

@steipete
steipete force-pushed the solid2/w-zero-layout-traits branch from b878706 to 70159b8 Compare October 19, 2026 07:54
@steipete
steipete force-pushed the solid2/w-zero-layout-traits branch from 70159b8 to 785c928 Compare October 19, 2026 08:46
@steipete steipete changed the title refactor(ui): remove duplicate initial shell layout publication refactor(ui): remove duplicate shell layout publication Oct 19, 2026
@steipete
steipete force-pushed the solid2/w-zero-layout-traits branch from 785c928 to 60c946e Compare October 19, 2026 09:06
@steipete
steipete enabled auto-merge (squash) October 19, 2026 09:14
@steipete
steipete disabled auto-merge October 19, 2026 09:20
Publish layout traits through the existing tracked effect, which runs before descendant settled setup and measurements. The renderer flushes before returning, so the component-setup snapshot is redundant. Keep dynamic trait updates and cleanup, and align the two measurement probes with onSettled without dropping their assertions.
@steipete
steipete force-pushed the solid2/w-zero-layout-traits branch from 60c946e to 5ec0286 Compare October 19, 2026 09:40

@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: 5ec028691d

ℹ️ 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 25 to 27
createEffect(
() => props.traits,
(traits) => scope.owner.record(token, scope.host, traits),

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 Preserve synchronous trait publication for child setup

When a descendant reads or measures layout during component setup, this effect has not yet applied, so it observes the shell without the requested classes and can initialize from incorrect CSS. The previous regression explicitly exercised this ordering, but this commit moves both probes into onSettled, masking the behavior change rather than preserving the refactor's existing contract. Keep an initial synchronous publication, or otherwise publish before evaluating children.

AGENTS.md reference: AGENTS.md:L78-L80

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 4ea6e2b into main Oct 19, 2026
105 of 111 checks passed
@steipete
steipete deleted the solid2/w-zero-layout-traits branch October 19, 2026 10:08
@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 20, 2026
)

* refactor(ui): remove duplicate shell layout publication

Publish layout traits through the existing tracked effect, which runs before descendant settled setup and measurements. The renderer flushes before returning, so the component-setup snapshot is redundant. Keep dynamic trait updates and cleanup, and align the two measurement probes with onSettled without dropping their assertions.

* test(ui): retain facts for avatar and media failures

* test(ui): bound avatar failure diagnostics

* test(ui): fix avatar diagnostic lint

* test(ui): name unsettled Gateway roots in cleanup failures
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: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant