Skip to content

fix(templates): catalog cards jump on load and icons arrive late - #199866

Merged
Patrick-Erichsen merged 5 commits into
mainfrom
templates-loading-jank
Nov 16, 2026
Merged

Patrick-Erichsen merged 5 commits into
mainfrom
templates-loading-jank

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: the Templates catalog jumps when cards replace the loading placeholders, and card icons appear a few hundred milliseconds after the card text.

User Impact

User impact: cards now fill their placeholders in place, and first-screen icons paint in the same frame as the text.

Two visible tradeoffs:

  • Every card now reserves two title lines and two summary lines, so all cards are the same height. A card with a one-line title is about 20 px taller than before.
  • On a cold browser cache the catalog waits for first-screen icons before revealing cards, capped at 500 ms. In six cold loads the first card text moved from about 535 ms to about 775 ms, while the fully painted catalog moved from about 860 ms to about 775 ms. Icons already in the browser cache add no wait.

Why This Change Was Made

The placeholders were a flat grid of blocks that ignored section headers and card height, so no loaded card landed where a placeholder had been. They now render the same section and card structure as the loaded catalog. Matching exactly requires a known card height, which is why cards reserve their title and summary lines; a matching skeleton with natural card heights still left every card out of place.

Icons were only requested once the cards rendered. The catalog now fetches and decodes the first 24 icons before revealing cards, using the same request mode as the card image so the browser reuses the response. Slow or failed icons stop holding the catalog after 500 ms and load in place as before.

Preconnecting to the registry and eager, high-priority image loading were also measured and showed no gain, so they are not part of this change.

Evidence

Measured on an isolated Gateway serving each build, against the live ClawHub catalog, entering Templates from Chat with a cold browser cache. Before is main at 718a2f8; after is this change at 1d9bf3b. Three later commits repair review and CI findings without changing that behavior:

  • b453488 gives section headers one height whether or not they have a "View all" action. Placement was rechecked on that head with the same harness (14 of 14 at 1280 px, 8 of 8 at 820 px, 5 of 5 at 400 px, 16 of 16 for a selected category).
  • 081dff2 draws the placeholder bars inline instead of in the stylesheet. The first version added 888 bytes to a stylesheet that is already at its fixed size ceiling and failed control-ui-performance. Against the same base the stylesheet is now 18 bytes smaller raw and 10 bytes larger gzipped, inside the 64-byte build variance.
  • 3d32dc6 always renders the summary paragraph, so a Template without a summary keeps its reserved lines. Before that commit the new browser case measured the summary-free card at 83 px against a 129.5 px placeholder.

The last two heads are covered by the browser test below rather than a new recording.

Cold load at 1280 px (6 runs each) Before After
Visible cards landing on a placeholder 0 of 14 14 of 14
Section headers landing on a placeholder 0 of 2 2 of 2
Icons after card text (median first / last) 147 ms / 332 ms same frame, 6 of 6 runs
First card text (median) 534 ms 775 ms
Everything painted (median) 858 ms 777 ms

Placement is also exact at 820 px (8 of 8 cards) and 400 px (5 of 5 cards), three runs each, and for a selected category at 1280 and 820 px. Placement compares each loaded card and header rectangle with the placeholder rectangles from the last loading frame. The layout-shift observer reports zero on both builds because the placeholders are replaced rather than moved, so it cannot show this difference.

Before:

Before: flat placeholder grid, then cards in new positions with empty icon squares

After:

After: placeholders mirror the catalog, then cards and icons fill them in place

Side-by-side recording, real time and then at one-fifth speed:

templates-loading-before-after.mp4

Tests and checks on bd176f2 (the branch with current main merged in to resolve a conflict with #198070):

  • Browser suite templates-catalog.e2e.test.ts: 27 passed. The loading test now holds the catalog response at four viewport sizes, plus a summary-free Template on mobile, and asserts that the first shelf header and first card arrive exactly where their placeholders were. It replaces the previous assertion that a measured grid ends near the bottom of the viewport.
  • templates-home.test.ts, templates-add.test.ts and templates-admission.test.ts: 53 passed. New tests cover holding the placeholders until artwork decodes or fails, and releasing them at the 500 ms budget.
  • pnpm check:baseline-ratchets passed locally on the merged head.
  • pnpm check:changed passed with the dead-export scan skipped. That scan reported unused exports in src/state/* and ui/src/lib/openclaw-id/member-welcome.ts, which this change does not touch.

Known limit: when the registry is slow, the 500 ms budget expires and the cards are revealed with some icons still loading. That happened in 2 of 16 cold catalog loads across the final builds (and in 1 of 2 category loads during a slow period), and those loads show their text up to 500 ms later than main would have.

The Templates catalog placeholders were a flat grid of blocks that ignored
section headers and card height, so no loaded card landed where a
placeholder had been. Card artwork was only requested once the cards
rendered, so icons appeared a few hundred milliseconds after the text.

Placeholders now mirror the loaded sections and cards, and cards reserve
two title lines and two summary lines so every card has the same height.
First-screen artwork is fetched and decoded before the cards are revealed,
bounded at 500 ms, so icons paint in the same frame as the text.
@clawsweeper

clawsweeper Bot commented Nov 16, 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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
Featured and search-result sections have no "View all" action, so their
header was 3 px shorter than the placeholders and the shelves that do.
A single header height replaces the hidden placeholder button, and the
browser test now asserts that the first shelf and card arrive exactly
where their placeholders were instead of measuring a viewport-sized grid.
@Patrick-Erichsen
Patrick-Erichsen enabled auto-merge (squash) November 16, 2026 01:07
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR matches Templates loading placeholders to loaded cards and preloads artwork with a 500 ms reveal budget.

Example: Open Templates at 1280 px with a cold browser cache.

  • Before: The supplied measurements show 0 of 14 visible cards matching placeholder positions, with icons appearing after text.
  • After: The supplied measurements show 14 of 14 cards matching placeholders, with artwork and text appearing together in six measured loads.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, visually demonstrated repair with both earlier findings addressed; broad validation on the exact head is still running.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots show the production Control UI served by an isolated Gateway against the live catalog, with matching placeholders and artwork visible alongside card text; later focused repairs are supported by reported head browser tests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Templates cards appear in different positions from their loading placeholders, and their icons arrive after the text.
Reason: The UI requires stable loading geometry, and the maintainer-authored PR explicitly accepts uniform card heights and bounded artwork waiting.

Merge readiness

✅ Ready for maintainer review

This PR addresses a verified catalog presentation defect. Both prior findings are resolved, and no new actionable defect was found; exact-head CI remains in progress.

Priority: P2
Reviewed head: 3d32dc69ff3b9f566ca8464e08abae460ca19ad5

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The body records a failing summary-free geometry case before its repair; a merge-base red run of the other revised regressions is not shown.
Agent review details

How this fits together

The Control UI receives public catalog entries through the Gateway, prepares their registry artwork, and renders featured shelves, category shelves, or search results.

flowchart LR
  A[Templates navigation] --> B[Explore request owner]
  B --> C[Gateway catalog read]
  C --> D[Catalog entries]
  D --> E[Bounded artwork decode]
  E --> F[Cards and shelves]
  B --> G[Matching loading placeholders]
Loading

Technical review

Best possible solution:

Keep the existing Explore loading boundary, match its section and card geometry, and decode bounded artwork using the established image request policy.

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

Current main renders flat placeholders independently of shelf headers and card geometry, and requests artwork only when cards render; the inspected before screenshots corroborate both symptoms.

Is this the best way to solve the issue?

The change fixes presentation at its existing owners, removes the superseded measurement path, and preserves request handling and image policy with explicitly accepted visual and latency tradeoffs.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Viewport-filling catalog placeholders changes intended behavior with a stated reason (8ea2c99: Fill the visible loading surface and reduce catalog latency through one overview request.)
  • Card layout and shared stylesheet changes intended behavior with a stated reason (c1ecbca: Share template presentation styling and preserve the approved card appearance; this PR explains the additional reserved text space needed for matching placeholders.)
  • Artwork loading and fallback keeps the original intent (40ba171: Render trusted published artwork using anonymous CORS and no referrer while retaining fallback artwork on failure.)
  • Explore async request presentation keeps the original intent (f0d7334: Present admitted requests through local Loading and Errored boundaries while preserving query, debounce, and connection retirement.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Patrick Erichsen: Raw commit 40ba171 adds ui/src/pages/agents-home/claw-artwork.tsx:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 40ba1715d3f7; files: ui/src/pages/agents-home/claw-artwork.tsx)
  • Peter Steinberger: Raw commit f0d7334 adds ui/src/pages/agents-home/claws-explore.tsx:84 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f0d7334db0e5; files: ui/src/pages/agents-home/claws-explore.tsx)

PR surface

Source +71, Tests +68. Total +139 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 116 45 +71
Tests 2 93 25 +68
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 209 70 +139

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Artwork reveal budget 24 unique artwork URLs; maximum 500 ms wait Bounds the added reveal delay without adding configuration or persistent cache state.
Production versus test changes Production +116/-45 lines; tests +93/-25 lines Growth implements matching placeholder markup and bounded artwork preparation while replacing the old measurement path; tests cover geometry, decode failure, and timeout.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Catalog loading has visible placement and artwork timing defects, while browsing and Add remain usable.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster 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 (1 earlier review cycle)
  • reviewed 2026-11-16T01:16:45.963Z sha b453488 :: needs changes before merge. :: [P2] Reduce stylesheet growth to pass the existing performance gate | [P2] Reserve the summary area when a card has no summary

Reviewed November 15, 2026, 8:35 PM ET / November 16, 2026, 01:35 UTC (Revision 2).

…ceiling

The placeholder rules added 888 bytes to a Control UI stylesheet that is
already at its fixed size ceiling, which failed the performance gate.
The placeholder bars are now drawn inline and the loading wrapper reuses
the results body class, so the stylesheet no longer grows.
…mmary

A card without a summary dropped its summary paragraph, so it was 46 px
shorter than its placeholder and moved every card below it in a
one-column layout. The paragraph is now always rendered, and the browser
test covers a summary-free Template on mobile.
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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 rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Nov 16, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
# Conflicts:
#	ui/src/pages/agents-home/templates-explore.tsx
#	ui/src/styles/templates-catalog.css
@Patrick-Erichsen
Patrick-Erichsen merged commit 2159567 into main Nov 16, 2026
90 of 92 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the templates-loading-jank branch November 16, 2026 03:16
@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 16, 2026
…nclaw#199866)

* fix(templates): catalog cards jump on load and icons arrive late

The Templates catalog placeholders were a flat grid of blocks that ignored
section headers and card height, so no loaded card landed where a
placeholder had been. Card artwork was only requested once the cards
rendered, so icons appeared a few hundred milliseconds after the text.

Placeholders now mirror the loaded sections and cards, and cards reserve
two title lines and two summary lines so every card has the same height.
First-screen artwork is fetched and decoded before the cards are revealed,
bounded at 500 ms, so icons paint in the same frame as the text.

* fix(templates): keep section headers one height with or without View all

Featured and search-result sections have no "View all" action, so their
header was 3 px shorter than the placeholders and the shelves that do.
A single header height replaces the hidden placeholder button, and the
browser test now asserts that the first shelf and card arrive exactly
where their placeholders were instead of measuring a viewport-sized grid.

* fix(templates): keep catalog placeholders within the stylesheet size ceiling

The placeholder rules added 888 bytes to a Control UI stylesheet that is
already at its fixed size ceiling, which failed the performance gate.
The placeholder bars are now drawn inline and the loading wrapper reuses
the results body class, so the stylesheet no longer grows.

* fix(templates): reserve the summary lines for a Template without a summary

A card without a summary dropped its summary paragraph, so it was 46 px
shorter than its placeholder and moved every card below it in a
one-column layout. The paragraph is now always rendered, and the browser
test covers a summary-free Template on mobile.
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. 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