-
Notifications
You must be signed in to change notification settings - Fork 23
feat(web): consolidated single-component header for Unraid 7.3+ (fixes mobile overlap) #2037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
85118c7
feat(web): consolidated single-component header for Unraid 7.3+
elibosley d006af9
feat(web): array-usage bar in consolidated header
elibosley 3e65503
feat(web): app-style responsive grid layout for consolidated header
elibosley 893e9d5
fix(web): make consolidated header custom element fill its width
elibosley 0216657
feat(web): lift uptime/license to the top of the consolidated header
elibosley d623e7c
feat(web): consolidated header mirrors desktop layout at all sizes
elibosley 49fcc11
fix(web): tighten consolidated header control spacing
elibosley 2518bdd
fix(web): use independent header columns on mobile
elibosley 926e25b
fix(web): align header metadata above nav row
elibosley 7c8c510
fix(web): align header version under logo
elibosley 449b586
feat(web): add adaptive header logo style
elibosley 2ce9fa7
fix(web): render adaptive logo as transparent mask
elibosley 0eff697
fix(web): use transparent inline adaptive logo
elibosley b75e50f
fix(web): isolate header logo link from legacy block styles
elibosley 39dfa3f
fix(web): rely on consolidated header block reset
elibosley dc0a513
fix(web): let webgui own consolidated header padding
elibosley 4a2461f
fix(web): align header logo and version rows
elibosley 2e3b373
fix(web): center header logo independent of version row
elibosley f2d9069
fix(web): center header entries in middle band
elibosley 5825752
fix(web): use compact mirrored header rows
elibosley b807beb
fix(web): flip compact header logo and version
elibosley 5fc90a8
fix(web): tune compact header vertical spacing
elibosley d2584e1
fix(web): anchor compact header columns independently
elibosley 9cf007d
fix(web): center compact header primary entries
elibosley 4026b2c
fix(web): reserve compact header tag rows
elibosley 15e6822
test(web): align consolidated header test with header-shell grid
elibosley 682d2b1
fix(web): stop webgui #header legacy classes from styling the header
elibosley c38ae4e
fix(web): fade in consolidated header to soften mount pop-in
elibosley 3dcb1f2
revert: drop consolidated header mount fade-in
elibosley b21029a
fix(web): restore edge banner gradient instead of full-coverage overlay
elibosley 2b84971
fix(web): restore right-side banner gradient on consolidated header
elibosley ff3fd66
fix(web): split consolidated header meta row on mobile
elibosley a896b05
fix(web): mobile text-size-adjust and notification density polish
elibosley c5e7f44
chore: ignore .gstack/ tooling directory
elibosley 8f89e69
fix(header): preserve version dropdown hover contrast (#2047)
elibosley 9dfed54
fix(web): show only the alert icon on mobile in header account trigger
elibosley c220861
fix(web): show largest uptime unit with full breakdown on hover
elibosley 3abc74e
fix(web): use @unraid/ui tooltip for the compact uptime
elibosley 1c3e314
fix(web): align consolidated header meta row with the nav controls
elibosley 0672ce7
fix(web): group header logo+version and align mobile uptime
elibosley 62caf08
fix(web): top-anchor mobile header with uptime and version mirrored
elibosley ea58df4
fix(web): inline the gradient header logo to avoid a mount flash
elibosley ead8641
fix(web): keep mount placeholder until real content renders (no blank…
elibosley b7631fa
chore(ai-review): mark branch reviewed
elibosley c8e5608
refactor(web): harden shared mount-engine placeholder swap
elibosley 85d43e4
docs(web): sync consolidated-header version comments to 7.4+
elibosley ba0d98a
docs(web): sync remaining consolidated-header comment to 7.4+
elibosley d74f475
chore(ai-review): refresh reviewed marker for ba0d98a8
elibosley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,3 +130,4 @@ web/public/test-pages/*.html | |
| # local scripts for testing and development | ||
| .dev-scripts/ | ||
|
|
||
| .gstack/ | ||
22 changes: 22 additions & 0 deletions
22
.limetech/ai-review-markers/feat-consolidated-header-f1ad9c831fe8.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "agent": "claude", | ||
| "base_oid": "f3205d978fada931da54df4255d41c07489066d9", | ||
| "base_ref": "origin/main", | ||
| "branch": "feat/consolidated-header", | ||
| "linear_data_shares": [], | ||
| "linear_skip_reason": "No durable cross-branch knowledge emerged; delta findings are branch-local non-blocking test-coverage nits and a comment fix.", | ||
| "linear_state": "skipped", | ||
| "review_notes": "Requested preset auto; resolved to thorough with the shared mount-engine.ts delta reviewed deep (blast-radius trigger). Full branch was exhaustively reviewed at prior SHA ead8641; this pass verifies the applied fixes + 7.4 gate comment sync. Lenses: correctness, architecture, tests, type/modeling - all delegated, one read-only subagent each, strong model/high reasoning. Data-safety/security/documentation lenses not re-run (no changed surface in the delta; covered at ead8641). Source remediation: report-only (one comment fix applied that a lens explicitly requested). Marker: commit-on-green. Refreshes the stale marker from prior SHA ead8641 after 4 follow-up commits.", | ||
| "review_status": "reviewed", | ||
| "reviewed_at": "2026-07-23T12:44:57Z", | ||
| "reviewed_sha": "ba0d98a82ad7e566eb721d2e085c96e7e2796510", | ||
| "schema": "limetech.ai-review-marker.v1", | ||
| "scope": "branch-diff", | ||
| "summary": "No blocking findings. Delegated re-review of the delta since the prior exhaustive pass (mount-engine placeholder-gating + timer/observer/buffer teardown, headerLogoStyle typing, 7.3->7.4 gate comment sync). Correctness/architecture/type lenses clean; blast radius confirmed bounded to the header; 4 non-blocking test-coverage nits; one stale 7.3 comment fixed (main.css). Lint/type-check clean; 656 tests pass.", | ||
| "unreviewed_head_reason": "The latest PR SHA is the marker-only commit that records this review.", | ||
| "validation": { | ||
| "lint": "pass (eslint + prettier)", | ||
| "tests": "656 passed / 6 skipped / 67 files", | ||
| "type_check": "pass (vue-tsc)" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,235 @@ | ||
| import { ref } from 'vue'; | ||
| import { setActivePinia } from 'pinia'; | ||
| import { provideApolloClient } from '@vue/apollo-composable'; | ||
| import { mount } from '@vue/test-utils'; | ||
|
|
||
| import { ApolloClient, InMemoryCache } from '@apollo/client/core'; | ||
| import { createTestingPinia } from '@pinia/testing'; | ||
| import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; | ||
|
|
||
| import type { VueWrapper } from '@vue/test-utils'; | ||
| import type { Server, ServerconnectPluginInstalled, ServerState } from '~/types/server'; | ||
| import type { Pinia } from 'pinia'; | ||
|
|
||
| import Header from '~/components/Header.standalone.vue'; | ||
| import { useServerStore } from '~/store/server'; | ||
| import { useThemeStore } from '~/store/theme'; | ||
|
|
||
| const mockCopy = vi.fn(); | ||
| const mockCopied = ref(false); | ||
| const mockIsSupported = ref(true); | ||
|
|
||
| vi.mock('@vueuse/core', () => ({ | ||
| useClipboard: () => { | ||
| const actualCopy = (text: string) => { | ||
| if (mockIsSupported.value) { | ||
| mockCopy(text); | ||
| mockCopied.value = true; | ||
| } else { | ||
| mockCopied.value = false; | ||
| } | ||
| }; | ||
| return { | ||
| copy: actualCopy, | ||
| copied: mockCopied, | ||
| isSupported: mockIsSupported, | ||
| }; | ||
| }, | ||
| useLocalStorage: <T>(key: string, initialValue: T) => { | ||
| const storage = new Map<string, T>(); | ||
| if (!storage.has(key)) { | ||
| storage.set(key, initialValue); | ||
| } | ||
| return ref(storage.get(key) ?? initialValue); | ||
| }, | ||
| })); | ||
|
|
||
| vi.mock('@unraid/ui', () => ({ | ||
| DropdownMenu: { | ||
| template: '<div data-testid="dropdown-menu"><slot name="trigger" /><slot name="content" /></div>', | ||
| }, | ||
| Button: { | ||
| template: '<button><slot /></button>', | ||
| props: ['variant', 'size'], | ||
| }, | ||
| cn: (...classes: string[]) => classes.filter(Boolean).join(' '), | ||
| isDarkModeActive: vi.fn(() => false), | ||
| })); | ||
|
|
||
| const mockWatcher = vi.fn(); | ||
|
|
||
| vi.mock('~/store/callbackActions', () => ({ | ||
| useCallbackActionsStore: vi.fn(() => ({ | ||
| watcher: mockWatcher, | ||
| callbackData: ref(null), | ||
| })), | ||
| })); | ||
|
|
||
| const t = (key: string, args?: unknown[]) => (args ? `${key} ${JSON.stringify(args)}` : key); | ||
| vi.mock('vue-i18n', () => ({ | ||
| useI18n: () => ({ t }), | ||
| })); | ||
|
|
||
| const initialServerData: Server = { | ||
| name: 'DEVGEN', | ||
| description: 'Dev Server', | ||
| guid: 'TEST-GUID', | ||
| keyfile: 'keyfile.key', | ||
| lanIp: '192.168.1.100', | ||
| connectPluginInstalled: 'dynamix.unraid.net.plg' as ServerconnectPluginInstalled, | ||
| state: 'PRO' as ServerState, | ||
| dateTimeFormat: { date: 'YYYY-MM-DD', time: 'HH:mm' }, | ||
| deviceCount: 5, | ||
| flashProduct: 'TestFlash', | ||
| flashVendor: 'TestVendor', | ||
| regGuid: 'REG-GUID', | ||
| regTm: 1678886400, | ||
| regTo: 'Test User', | ||
| regTy: 'Pro', | ||
| regExp: undefined, | ||
| regUpdatesExpired: false, | ||
| registered: true, | ||
| wanIp: '8.8.8.8', | ||
| }; | ||
|
|
||
| // Stub the heavier child components; the consolidated header is responsible for | ||
| // layout composition, which is what these tests exercise. | ||
| const stubs = { | ||
| HeaderVersion: { template: '<div data-testid="header-version"></div>' }, | ||
| ArrayUsage: { template: '<div data-testid="array-usage"></div>' }, | ||
| UpcServerStatus: { | ||
| template: '<div data-testid="server-status"></div>', | ||
| props: ['class'], | ||
| }, | ||
| NotificationsSidebar: { template: '<div data-testid="notifications-sidebar"></div>' }, | ||
| DropdownMenu: { | ||
| template: '<div data-testid="dropdown-menu"><slot name="trigger" /><slot name="content" /></div>', | ||
| }, | ||
| UpcDropdownContent: { template: '<div data-testid="dropdown-content"></div>' }, | ||
| UpcDropdownTrigger: { template: '<button data-testid="dropdown-trigger"></button>' }, | ||
| }; | ||
|
|
||
| describe('Header.standalone.vue', () => { | ||
| let wrapper: VueWrapper<InstanceType<typeof Header>>; | ||
| let pinia: Pinia; | ||
| let serverStore: ReturnType<typeof useServerStore>; | ||
| let themeStore: ReturnType<typeof useThemeStore>; | ||
| let consoleSpies: Array<ReturnType<typeof vi.spyOn>> = []; | ||
|
|
||
| beforeEach(() => { | ||
| Object.defineProperty(window, 'location', { | ||
| value: { | ||
| hostname: 'localhost', | ||
| port: '3000', | ||
| pathname: '/', | ||
| protocol: 'http:', | ||
| href: 'http://localhost:3000/', | ||
| }, | ||
| writable: true, | ||
| configurable: true, | ||
| }); | ||
|
|
||
| provideApolloClient(new ApolloClient({ cache: new InMemoryCache() })); | ||
|
|
||
| consoleSpies = [ | ||
| vi.spyOn(console, 'log').mockImplementation(() => {}), | ||
| vi.spyOn(console, 'warn').mockImplementation(() => {}), | ||
| vi.spyOn(console, 'debug').mockImplementation(() => {}), | ||
| vi.spyOn(console, 'error').mockImplementation(() => {}), | ||
| ]; | ||
|
|
||
| mockCopied.value = false; | ||
| mockIsSupported.value = true; | ||
|
|
||
| pinia = createTestingPinia({ | ||
| createSpy: vi.fn, | ||
| initialState: { server: { ...initialServerData } }, | ||
| stubActions: false, | ||
| }); | ||
| setActivePinia(pinia); | ||
|
|
||
| serverStore = useServerStore(); | ||
| themeStore = useThemeStore(); | ||
| themeStore.setTheme({ | ||
| name: 'white', | ||
| banner: true, | ||
| bannerGradient: true, | ||
| descriptionShow: true, | ||
| textColor: '', | ||
| metaColor: '', | ||
| bgColor: '', | ||
| }); | ||
|
|
||
| vi.spyOn(serverStore, 'setServer').mockImplementation((server) => { | ||
| Object.assign(serverStore, server); | ||
| return server; | ||
| }); | ||
|
|
||
| vi.clearAllMocks(); | ||
|
|
||
| wrapper = mount(Header, { | ||
| props: { server: JSON.stringify(initialServerData) }, | ||
| global: { plugins: [pinia], stubs }, | ||
| }); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| wrapper?.unmount(); | ||
| consoleSpies.forEach((spy) => spy.mockRestore()); | ||
| vi.restoreAllMocks(); | ||
| }); | ||
|
|
||
| it('renders every header region in a single component', () => { | ||
| expect(wrapper.find('[data-testid="header-version"]').exists()).toBe(true); | ||
| expect(wrapper.find('[data-testid="server-status"]').exists()).toBe(true); | ||
| expect(wrapper.find('[data-testid="notifications-sidebar"]').exists()).toBe(true); | ||
| expect(wrapper.find('[data-testid="dropdown-menu"]').exists()).toBe(true); | ||
| expect(wrapper.find('[data-testid="dropdown-trigger"]').exists()).toBe(true); | ||
| expect(wrapper.find('button').text()).toContain('DEVGEN'); | ||
| }); | ||
|
|
||
| it('hydrates the server store from the prop and starts the callback watcher', () => { | ||
| expect(serverStore.setServer).toHaveBeenCalledTimes(1); | ||
| expect(serverStore.setServer).toHaveBeenCalledWith(JSON.parse(JSON.stringify(initialServerData))); | ||
| expect(mockWatcher).toHaveBeenCalledTimes(1); | ||
| }); | ||
|
|
||
| it('throws when the server prop is missing', () => { | ||
| expect(() => mount(Header, { props: {}, global: { plugins: [pinia], stubs } })).toThrow( | ||
| 'Server data not present' | ||
| ); | ||
| }); | ||
|
|
||
| it('lays out on a responsive grid with each region in its own area (no overlap)', () => { | ||
| const root = wrapper.get('#UnraidHeader'); | ||
| // A single grid owns the responsive layout (breakpoints live in scoped CSS). | ||
| expect(root.classes()).toContain('unraid-header-shell'); | ||
| // Every header region is placed in its own grid area, so nothing is absolutely | ||
| // positioned on top of anything else (the root cause of the old mobile overlap). | ||
| expect(root.find('.uh-logo-block').exists()).toBe(true); | ||
| expect(root.find('.uh-meta-right').exists()).toBe(true); | ||
| expect(root.find('.uh-nav-right').exists()).toBe(true); | ||
| expect(root.find('.uh-name').exists()).toBe(true); | ||
| // The only absolutely-positioned element allowed is the banner gradient layer. | ||
| expect(root.classes()).not.toContain('absolute'); | ||
| expect(root.find('.absolute:not(.unraid-banner-gradient-layer)').exists()).toBe(false); | ||
| }); | ||
|
|
||
| it('hides the array-usage bar by default and shows it when enabled', async () => { | ||
| expect(wrapper.find('[data-testid="array-usage"]').exists()).toBe(false); | ||
|
|
||
| const withUsage = mount(Header, { | ||
| props: { server: JSON.stringify(initialServerData), showArrayUsage: 'true' }, | ||
| global: { plugins: [pinia], stubs }, | ||
| }); | ||
| expect(withUsage.find('[data-testid="array-usage"]').exists()).toBe(true); | ||
| withUsage.unmount(); | ||
| }); | ||
|
|
||
| it('copies the LAN IP when the server name is clicked', async () => { | ||
| mockIsSupported.value = true; | ||
| await wrapper.find('button').trigger('click'); | ||
| await wrapper.vm.$nextTick(); | ||
| expect(mockCopy).toHaveBeenCalledWith(initialServerData.lanIp); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Avoid asserting the exact error message text.
Per coding guidelines, tests should assert that an error is thrown, not the exact wording, to avoid breaking on incidental message changes.
✏️ Proposed fix
it('throws when the server prop is missing', () => { - expect(() => mount(Header, { props: {}, global: { plugins: [pinia], stubs } })).toThrow( - 'Server data not present' - ); + expect(() => mount(Header, { props: {}, global: { plugins: [pinia], stubs } })).toThrow(); });📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Coding guidelines