Skip to content

⚡ Bolt: add explicit dimensions to template icons - #49

Open
dezren39 wants to merge 2 commits into
mainfrom
bolt/template-explicit-dimensions-cls
Open

dezren39 wants to merge 2 commits into
mainfrom
bolt/template-explicit-dimensions-cls

Conversation

@dezren39

@dezren39 dezren39 commented Nov 15, 2026 •

Copy link
Copy Markdown
Member
  • I release the following change request under the default LICENSE configuration described here: README.md#license

Dispatch queue task: #11934 (no linked tracking issue).

💡 What

Add explicit intrinsic sizing to template chrome assets across templates/components/footer.tpl, templates/components/sidebar.tpl, templates/components/sidebar-tree.tpl, and templates/hooks/after-note.tpl:

  • Set width/height attributes and matching inline height for 1rem icon-only SVGs in the footer, sidebar action links, and sidebar tree "new note" action.
  • Set intrinsic width/height (24×24, matching viewBox) on sidebar tree node/expand icons whose rendered size is class-driven.
  • Set intrinsic width/height (24×24) on after-note action SVGs (h-6 w-6).
  • Set explicit width/height and fetchpriority="high" on the above-the-fold sidebar site logo <img> (keeps existing decoding="async").

🎯 Why

These icons and the site logo appear in repeated page chrome (every generated page). Without intrinsic dimensions, browsers can’t reserve space before CSS/Tailwind applies, which can cause layout shift (CLS) and extra reflow as styles load. Above-the-fold branding also benefits from prioritized fetching.

📊 Impact

  • Expected: Reduces/eliminates CLS for header/sidebar/footer/after-note icon regions and the sidebar logo on initial load and navigations; enables stable layout before full CSS/image load.
  • Scope: Template chrome used across generated pages (site-wide).
  • Risk: Low — additive HTML attributes and inline style height only; no behavior, URLs, or content changes.

🔬 Measurement

  • Before: 1rem chrome SVGs and after-note SVGs had no intrinsic width/height attributes; sidebar logo <img> lacked intrinsic dimensions/fetch priority (only style="width: 1rem;" + decoding="async").
  • After: 1rem SVGs now include width="16" height="16" and style="width: 1rem; height: 1rem;"; 24px-class/viewBox SVGs include width="24" height="24"; sidebar logo includes width="16" height="16" and fetchpriority="high".
  • How to verify: Load a page and observe no icon/logo pop-in or layout jump in the sidebar/footer/after-note areas during first paint (Chrome DevTools Performance/Layout Shift regions or Lighthouse CLS). Compare rendered icon sizes remain unchanged.

✅ Verification

  • Reviewed diffs for all four modified templates (29 insertions / 24 deletions, attributes-only changes).
  • Attempted nix build --no-link in this run, but it exceeded the session/tooling time limit before completion (Nix build did not finish within ~15 minutes here). No pnpm/separate lint-test scripts exist in this repo; CI runs nix build.
  • Confidence: High that the change is correct and low-risk; CI/build confirmation is pending. Leaving merge decision to a human/CI — I did not merge.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Add explicit width/height attributes (and height in inline styles where applicable) to footer, sidebar, sidebar-tree, and after-note SVG/icon elements, and to the above-the-fold sidebar logo image. Also set fetchpriority="high" on the sidebar logo.

This gives the browser intrinsic sizing before CSS/Tailwind loads, reducing layout shift (CLS) and avoiding reflow/jank during initial render for repeated UI chrome.
@coderabbitai

coderabbitai Bot commented Nov 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 408053af-b912-4c98-b50f-8e1e54c0e3dc
Commits

Reviewing files that changed from the base of the PR and between 509557e and 72ef4a3.

Files selected for processing: 6

  • .github/workflows/ci.yaml
  • .jules/palette.md
  • templates/components/footer.tpl
  • templates/components/sidebar-tree.tpl
  • templates/components/sidebar.tpl
  • templates/hooks/after-note.tpl
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T19:42:29.448258Z
We couldn’t complete this review. Comment @codex review to try again.
72ef4a3 PR opened
ℹ️ 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

This branch had an error being deployed

1 failed deployment
ci — 72ef4a37 Deployed Nov 15, 2026 by dezren39 via ci #405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant