Skip to content

fix(web): stop header logo resizing on mount, narrow banner gradient - #2059

Merged
Eli Bosley (elibosley) merged 2 commits into
mainfrom
fix/consolidated-header-boot-placeholder
Aug 3, 2026
Merged

fix(web): stop header logo resizing on mount, narrow banner gradient#2059
Eli Bosley (elibosley) merged 2 commits into
mainfrom
fix/consolidated-header-boot-placeholder

Conversation

@elibosley

@elibosley Eli Bosley (elibosley) commented Aug 3, 2026

Copy link
Copy Markdown
Member

Resolves two QA-blocking visual regressions on OS-620 (consolidated <unraid-header>), found in QA of webGUI PR #2701.

What

  • Logo resized on mount (sidebar themes). The mounted logo carried max-w-full, so on gray/azure at mobile widths it compressed ~9% (140px → 127px) after mount, while the server-rendered boot placeholder in webGUI Header.php stayed 140px. Now shrink-0 with a fixed width, so the two agree. The nav side already truncates and absorbs the space — verified no horizontal overflow.
  • Banner gradient obscured the banner image. The gradient layer covered the right 45% (576px at a 1280px viewport), roughly 1.8× the legacy header's min(30%, 320px) edge gradient. Now matches the legacy width.

Pairs with unraid/webgui#2701, which carries the light-DOM boot-placeholder side.

Tests

New theme-gated snapshot test covering all four shipped themes in the configuration webGUI ships them in (sidebar themes carry the array-usage bar, top-nav themes do not), plus explicit guards on both regressions above. Verified the guards actually fail when the bugs are reintroduced.

Verification

Measured on devgen.local (Unraid 7.3.2) across white/black/gray/azure at 1280px and 390px:

result
boot vs mounted logo top 0px (≤0.01px sub-pixel)
boot vs mounted logo width 0px (140/160 stable)
banner gradient 320px at 1280px (legacy width)
horizontal overflow 0 everywhere

Refs OS-620

Summary by CodeRabbit

  • Bug Fixes

    • Improved header banner gradient sizing for more consistent visual alignment.
    • Preserved header logo dimensions across responsive layouts by preventing unintended shrinking.
  • Tests

    • Added comprehensive coverage for header themes, logo sizing, banner gradients, and array-based rendering.

Resolves two QA-blocking visual regressions in the consolidated header.

- The mounted logo carried max-w-full, so on sidebar themes (gray/azure)
  at mobile widths it compressed ~9% (140px -> 127px) after mount, while
  the server-rendered boot placeholder in webGUI Header.php stayed 140px.
  Use shrink-0 and a fixed width so the two agree; the nav side already
  truncates, so it absorbs the space (verified: no horizontal overflow).
- The banner gradient covered the right 45% (576px at 1280px), roughly
  1.8x the legacy header's min(30%, 320px) edge gradient, visibly
  obscuring users' banner images. Match the legacy width.

Adds a theme-gated snapshot test covering all four shipped themes in the
configuration webGUI ships them in (sidebar themes carry the array-usage
bar, top-nav themes do not), plus guards on both regressions above.

Verified on devgen.local (7.3.2) across white/black/gray/azure at 1280px
and 390px: boot-vs-mounted logo delta 0px (<=0.01px sub-pixel), logo
width stable, gradient 320px, no overflow.
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3c9c97f4-23ef-4bda-96bc-4f6ee6928663

📥 Commits

Reviewing files that changed from the base of the PR and between 0c90da2 and ff2514c.

⛔ Files ignored due to path filters (1)
  • web/__test__/components/__snapshots__/HeaderThemes.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (1)
  • web/__test__/components/HeaderThemes.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/test/components/HeaderThemes.test.ts

Walkthrough

The header now uses a bounded, right-aligned banner gradient and prevents themed logos from shrinking. New tests cover all shipped themes, layout variants, logo styles, fixed sizing, gradient bounds, and disabled-gradient behavior.

Changes

Header theme layout

Layer / File(s) Summary
Header visual behavior
web/src/components/Header.standalone.vue, web/src/components/Header/HeaderLogo.vue
The banner gradient uses min(30%, 320px) with right alignment. Both logo SVG variants use shrink-0 instead of max-w-full.
Header theme validation
web/__test__/components/HeaderThemes.test.ts
Tests cover theme layouts, sidebar-only usage, navigation omission, logo styles, fixed logo sizing, bounded gradients, and disabled-gradient behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • unraid/api#2037: Introduced the consolidated header components that this change extends.

Poem

A rabbit checked the header bright,
And found the logos held their height.
The gradient stayed within its wall,
While themes were tested, one and all.
“Hop approved!” the rabbit cried.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes both main fixes: preventing header logo resizing and narrowing the banner gradient.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/consolidated-header-boot-placeholder

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/__test__/components/HeaderThemes.test.ts`:
- Around line 141-145: Update the createTestingPinia call in the beforeEach
setup to use stubActions: false, allowing themeStore.setTheme(...) to execute
and mutate the configured theme state used by the mounted Header assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8fcf578c-75b6-4143-a6c6-7a6004c3238d

📥 Commits

Reviewing files that changed from the base of the PR and between 12c23d8 and 0c90da2.

⛔ Files ignored due to path filters (1)
  • web/__test__/components/__snapshots__/HeaderThemes.test.ts.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • web/__test__/components/HeaderThemes.test.ts
  • web/src/components/Header.standalone.vue
  • web/src/components/Header/HeaderLogo.vue

Comment thread web/__test__/components/HeaderThemes.test.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 0c90da232c

ℹ️ 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 (@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 (@codex) address that feedback".


beforeEach(() => {
provideApolloClient(new ApolloClient({ cache: new InMemoryCache() }));
pinia = createTestingPinia({ createSpy: vi.fn, initialState: { server: { ...server } } });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Run setTheme instead of stubbing it

createTestingPinia stubs actions by default, so each later themeStore.setTheme(...) call is only recorded and leaves the store in its default white, banner-disabled state. Consequently, the black/gray/azure cases never mount with their requested themes, and the banner-disabled test passes without exercising its transition; pass stubActions: false or initialize the theme state directly so these theme-gated tests validate the intended behavior.

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.13%. Comparing base (12c23d8) to head (ff2514c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2059      +/-   ##
==========================================
+ Coverage   53.07%   53.13%   +0.06%     
==========================================
  Files        1041     1041              
  Lines       72425    72425              
  Branches     8354     8354              
==========================================
+ Hits        38440    38484      +44     
+ Misses      33858    33814      -44     
  Partials      127      127              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL:

https://preview.dl.unraid.net/unraid-api/tag/PR2059/dynamix.unraid.net.plg

createTestingPinia stubs actions by default, so themeStore.setTheme() was
a no-op and every case silently ran against the default theme (white,
banner disabled) — the per-theme coverage was not testing anything, and
the banner-gradient assertion passed trivially.

Pass stubActions: false so setTheme mutates the store, and record the
banner-driven .uh-meta-over-banner state in the layout signature so a
regression here fails the snapshot instead of going unnoticed (verified:
reverting the flag now fails all four theme snapshots).
@elibosley
Eli Bosley (elibosley) merged commit 98034ff into main Aug 3, 2026
11 of 12 checks passed
@elibosley
Eli Bosley (elibosley) deleted the fix/consolidated-header-boot-placeholder branch August 3, 2026 20:02
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🔄 PR Merged - Plugin Redirected to Staging

This PR has been merged and the preview plugin has been updated to redirect to the staging version.

For users testing this PR:

  • Your plugin will automatically update to the staging version on the next update check
  • The staging version includes all merged changes from this PR
  • No manual intervention required

Staging URL:

https://preview.dl.unraid.net/unraid-api/dynamix.unraid.net.plg

Thank you for testing! 🚀

@unraid-bot Unraid Bot (unraid-bot) added the 7.4.0 Approved for release 7.4.0 (auto-managed by notification-worker) label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.4.0 Approved for release 7.4.0 (auto-managed by notification-worker)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants