2023-04-09 14:34:33 -06:00
|
|
|
import React from "react";
|
2025-12-07 11:54:20 -07:00
|
|
|
import {Link, NavLink} from "react-router";
|
2026-07-30 13:15:43 -06:00
|
|
|
import {IconMenu2, IconPlugOff, IconTemperature, IconTemperaturePlus} from "@tabler/icons-react";
|
|
|
|
|
import {Icon, IconButton, Menu, Tooltip} from "./ui";
|
|
|
|
|
import {Media, SettingsContext, StatusContext} from "../contexts/contexts";
|
2025-01-11 12:04:14 -07:00
|
|
|
import {DarkModeToggle, HotspotStatusIcon, useLocalStorage} from "./Common";
|
2023-04-10 13:15:34 -06:00
|
|
|
import {ShareButton} from "./Share";
|
2026-06-03 18:46:29 -06:00
|
|
|
import {
|
|
|
|
|
useCPUTemperature,
|
2026-06-03 20:02:59 -06:00
|
|
|
useDriveHealth,
|
2026-06-03 18:46:29 -06:00
|
|
|
useDriveTemperature,
|
|
|
|
|
useIOStats,
|
|
|
|
|
useLoad,
|
|
|
|
|
useMemoryStats,
|
|
|
|
|
usePowerStats,
|
|
|
|
|
useWROLMode
|
|
|
|
|
} from "../hooks/customHooks";
|
2026-01-23 19:51:02 -07:00
|
|
|
import {useReorganizationStatus} from "../contexts/FileWorkerStatusContext";
|
2024-01-01 11:31:17 -07:00
|
|
|
import {SearchIconButton} from "./Search";
|
2026-02-04 12:23:28 -07:00
|
|
|
import {HELP_VIEWER_URI, NAME, semanticUIColorMap} from "./Vars";
|
2026-04-09 16:01:59 -06:00
|
|
|
import {useOverflowNav} from "../hooks/useOverflowNav";
|
ui: the navbar measures its foreground instead of assuming one
The bar's background is the one surface a user picks -- twelve colour names,
which each theme resolves to twelve of its own colours. Forty-eight
backgrounds, and the links and status icons were drawn on all of them in a
single token, `--btn-text`, which is near-black in three of the four themes.
Night's `--brown` is #451212. A near-black glyph on it is 1.33:1. Nine of
night's twelve colours and seven of amber's sat below 4.5:1, and twelve of the
forty-eight below 3:1 -- icons the same colour as the bar behind them.
So the foreground is measured against the background the theme actually
resolved, choosing between that theme's own `--btn-text`, `--black` and
`--white`. Its own, not literal ones: a white pixel in night mode undoes the
dark adaptation the theme exists to protect, so night's "white" is #ff8a8a.
Measuring at runtime rather than shipping an `--on-red` token per colour also
means the custom YAML themes still ahead get this for free.
Nothing is below 3:1 any more and the worst case is 3.27:1, up from 1.33:1.
No combination is worse than it was.
Ten of the forty-eight are still under 4.5:1 and no foreground will lift them:
a monochrome theme resolves all twelve names onto one ramp, and a mid-tone of a
hue cannot carry text of that same hue. That shortfall is in the palette, so
/theme-sample now draws all twelve bars with the measured ratio printed beside
each one, calling out the ten -- it is a decision to make while looking at them.
The WCAG primitives move to themes/contrast so theme code can measure a colour
without importing Common.js, which pulls in half the component library.
Common.js forwards `contrastRatio` with a delegating function rather than a bare
re-export: six specs mock it with `{...jest.requireActual('./Common')}`, the
spread invokes every getter, and those spreads run re-entrantly while the module
is still evaluating -- a re-export getter fires before its import binding exists
and takes the whole suite down.
Tested: navColors.test.js measures all forty-eight against the palette parsed
out of tokens.css, and holds Nav.js to the call by source since neither bar is
reachable from a test that could measure it. ui-layout.cy.js measures the
painted result in a real browser in all four themes and holds it against the
number the component reports. Reverting to the fixed foreground reddens four
jest cases and three cypress ones.
1115 jest / 62 suites, 177 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:07:19 -06:00
|
|
|
import {defaultNavColor, navBarStyle, useNavColors} from "../themes/navColors";
|
2024-12-18 16:39:50 -07:00
|
|
|
import _ from "lodash";
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2026-02-04 12:23:28 -07:00
|
|
|
function updateFavicon(colorName) {
|
|
|
|
|
// Fall back to violet if invalid color
|
|
|
|
|
const safeColor = colorName in semanticUIColorMap ? colorName : 'violet';
|
|
|
|
|
const faviconPath = `/favicon-${safeColor}.svg`;
|
|
|
|
|
|
|
|
|
|
// Update all favicon links
|
|
|
|
|
const iconLinks = document.querySelectorAll('link[rel="icon"], link[rel="shortcut icon"]');
|
|
|
|
|
iconLinks.forEach(link => {
|
|
|
|
|
link.href = faviconPath;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Also update the 32x32 and 16x16 specific icons if they exist
|
|
|
|
|
const icon32 = document.querySelector('link[sizes="32x32"]');
|
|
|
|
|
const icon16 = document.querySelector('link[sizes="16x16"]');
|
|
|
|
|
if (icon32) icon32.href = faviconPath;
|
|
|
|
|
if (icon16) icon16.href = faviconPath;
|
|
|
|
|
|
|
|
|
|
// Update theme-color meta tag for iOS/Android status bar
|
|
|
|
|
const hexColor = semanticUIColorMap[safeColor];
|
|
|
|
|
const themeColorMeta = document.querySelector('meta[name="theme-color"]');
|
|
|
|
|
if (themeColorMeta) themeColorMeta.content = hexColor;
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-30 13:15:43 -06:00
|
|
|
// A theme token name, or null to inherit the surrounding text/icon color (never
|
|
|
|
|
// literally "var(--null)").
|
|
|
|
|
const colorVar = (color) => color ? `var(--${color})` : undefined;
|
|
|
|
|
|
2026-04-09 16:01:59 -06:00
|
|
|
const help = {to: HELP_VIEWER_URI, text: 'Help', key: 'help', target: '_blank'};
|
|
|
|
|
const admin = {to: '/admin', text: 'Admin', key: 'admin'};
|
|
|
|
|
const rightLinks = [help, admin];
|
|
|
|
|
const allLinks = [
|
2023-02-21 15:49:11 -07:00
|
|
|
{text: 'Videos', to: '/videos', key: 'videos'},
|
2026-03-20 15:38:32 -06:00
|
|
|
{text: 'Archive', to: '/archives', key: 'archive'},
|
2026-03-17 18:35:57 -06:00
|
|
|
{text: 'Docs', to: '/docs', key: 'docs'},
|
2023-02-21 15:49:11 -07:00
|
|
|
{text: 'Map', to: '/map', key: 'map'},
|
|
|
|
|
{text: 'Files', to: '/files', key: 'files'},
|
Add ordered collections (playlists): polymorphic items + item API (#475)
* Add Playlists: ordered, mixed-type collections
A playlist (Collection kind='playlist') is a manually-curated, ordered list that
mixes item types. Squash of the playlists feature branch (24 commits).
Data model & API:
- CollectionItem is polymorphic via item_kind: 'file' (FileGroup), 'zim'
(zim_id + zim_entry), or 'url' (link to anything the WROLPi browser opens,
e.g. /map?lat=&lon=&z=). CHECK constraint enforces exactly one kind; per-kind
unique constraints; migration a7b1c2d3e4f5.
- Endpoints: create playlist; add/remove/reorder items (idempotent adds: 201 new,
200 existing); GET returns the ordered items. All mutations wrol_mode_check'd.
Config (source of truth):
- playlists.yaml (PlaylistsConfig) stores each playlist's metadata AND ordered
items (file by relative path, zim by path+entry, url inline); round-trips a
DB wipe. Supports backup import (DB_CONFIG_FILE_NAMES).
- The redundant generic CollectionsConfig (collections.yaml) is deleted:
channels/domains own their configs, authors/subjects are re-derived.
On-disk sync (sync_playlists_directory switch):
- Each playlist materializes into the configurable Playlists Directory
(playlists_destination, Settings UI input, excluded from indexing) with
position-prefixed entries: NNNN_<file> hard links (copy fallback across
filesystems) and NNNN_<title>.html stubs for zim/url items.
- Tagged playlists are namespaced like channels: <playlists>/<tag>/<name>;
a tag change moves the directory and prunes the empty old tag dir.
- Deletion safety: managed files are only removed when they are our marked
stubs or still have another hard link (st_nlink > 1) -- never a last copy.
Stray loose files at the playlists root are removed; stub URLs are
scheme-allowlisted (no javascript:/data:).
Frontend:
- /playlists list page (CollectionTable, name filter, New Playlist modal, Tag
column) between Files and Zim in the nav.
- View-only detail page (Name link) and edit page (Edit button): themed table
with model icons/colors + poster thumbnails, items link to their model page
(video/archive/doc) or preview, up/down reorder, remove, add-URL form,
single-tag selector; all editing disabled in WROL Mode.
- Reusable green "Add to Playlist" button on Video/Archive/Doc detail pages,
the FilePreview toolbar, Zim search results, and Map pins (added as a /map
URL item with a map-marker icon).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Playlist edit page parity: rename, custom directory, tag modal move suggestion
Match the ChannelEditPage/DomainEditPage UX on the playlist edit page:
Back/View buttons, an edit form (name, description, directory), and the
shared CollectionTagModal with the violet "Tag" button. The tag modal now
suggests moving the playlist to its managed tag location
(playlists/<tag>/<name>); accepting the suggestion stores directory=None so
the sync keeps auto-managing the location. Tag buttons on the Channel and
Domain edit pages are now violet to match.
Backend: update_collection learns rename (with per-kind validation and
duplicate checks) and playlist custom directories (cleanup of the abandoned
directory, config round-trip, commit-before-switch to avoid the background
sync racing pre-commit state). tag_collection's duplicated untag/tag
branches are merged, and the per-kind config-save dispatch is consolidated
into _activate_config_save().
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Deduplicate Collection error handling and Tag creation
Delete the duplicate UnknownCollection in wrolpi/collections/errors.py and
re-export the canonical one from wrolpi/errors.py, which carries
status_code=NOT_FOUND (the local copy inherited 500). Replace the repeated
query/raise pattern in reorganize.py with Collection.find_by_id.
Add Tag.get_or_create_tag and use it for collection tagging; flush the new
Tag before returning so callers can read .id immediately -- previously
tagging a collection with a brand-new tag name set tag_id=None. Regression
test included.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 19:37:34 -06:00
|
|
|
{text: 'Playlists', to: '/playlists', key: 'playlists'},
|
2026-04-09 16:01:59 -06:00
|
|
|
{text: 'Zim', to: '/zim', key: 'zim'},
|
|
|
|
|
{text: 'Inventory', to: '/inventory', key: 'inventory'},
|
|
|
|
|
{to: '/more/calculators', text: 'Calculators', key: 'calculators', end: true},
|
2026-07-01 18:48:06 -06:00
|
|
|
{text: 'Flasher', to: '/flasher', key: 'flasher'},
|
2026-04-09 16:01:59 -06:00
|
|
|
{to: '/more/statistics', text: 'Statistics', key: 'statistics', end: true},
|
2023-02-21 15:49:11 -07:00
|
|
|
];
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2022-11-04 09:19:51 -06:00
|
|
|
function MenuLink({link}) {
|
2026-07-30 13:15:43 -06:00
|
|
|
// A top-level tab rendered directly in the bar (not inside a dropdown).
|
2023-02-21 15:49:11 -07:00
|
|
|
if (link.links) {
|
|
|
|
|
return <DropdownLinks link={link}/>
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
2026-07-30 13:15:43 -06:00
|
|
|
const end = link.end ? {end: true} : {};
|
|
|
|
|
const target = link.target ? {target: link.target, rel: 'noopener noreferrer'} : {};
|
|
|
|
|
return <NavLink
|
|
|
|
|
className='wrolpi-navbar-link'
|
|
|
|
|
to={link.to}
|
|
|
|
|
{...end}
|
|
|
|
|
{...target}
|
|
|
|
|
>
|
|
|
|
|
{link.text}
|
|
|
|
|
</NavLink>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function DropdownMenuItem({link}) {
|
|
|
|
|
// An item inside a Menu.Dropdown: the mobile hamburger menu, or the desktop
|
|
|
|
|
// "More" overflow menu.
|
|
|
|
|
if (link.links) {
|
|
|
|
|
// Mantine's Menu does not nest submenus without extra plumbing; a labelled,
|
|
|
|
|
// indented group stands in for Semantic's nested Dropdown. No current data
|
|
|
|
|
// uses this path (no allLinks entry has its own `links`).
|
|
|
|
|
return <React.Fragment>
|
|
|
|
|
<Menu.Label>{link.text}</Menu.Label>
|
|
|
|
|
{link.links.map(l => <DropdownMenuItem key={l.key} link={l}/>)}
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
}
|
|
|
|
|
const end = link.end ? {end: true} : {};
|
|
|
|
|
const target = link.target ? {target: link.target, rel: 'noopener noreferrer'} : {};
|
|
|
|
|
return <Menu.Item component={NavLink} to={link.to} {...end} {...target}>
|
|
|
|
|
{link.text}
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
}
|
|
|
|
|
|
ui: the navbar corner was nudged rather than laid out, and it showed
Three faults in the bar, all reproduced by measurement before being fixed.
The indicators sat low. The slot carried `marginTop: 0.8em`, a nudge left over
from Semantic's menu; the corner centres its children, and a top margin is part
of the margin box being centred, so it applied as a ~6px downward shift. It
read as an error on the hotspot and the theme picker but not on share or search,
which is why it survived: an IconButton is a square ActionIcon that centres its
glyph exactly, while a bare-icon anchor sits high inside a line box that
reserves descender space for text that is not there. The nudge cancelled that
out on one shape and was pure error on the other. Both are laid out now --
flex, centred, no nudge -- and the anchors get `display: flex` so they hug their
glyph instead of a text line.
Help and Admin highlighted only a box around their text while Videos and
Statistics highlighted the full height. Same class, same rules, different
parent: the bar stretches its children, but the corner is a nested flex
container that centres its own, so a link inside it was sized to its content.
The hover background is painted on the link box, so that box IS the affordance.
The bar broke onto a second line at certain widths. Two measurement errors that
only overlap in a narrow band, which is why it appeared while resizing rather
than always. useOverflowNav measured the WRAPPER's offsetWidth and subtracted
only the home link and the corner, missing the bar's own `padding: 0 0.25em` --
about 8px it believed it had. And the hidden "More" placeholder it measured was
a plain button with no dropdown caret, about 21px narrower than the button that
eventually rendered. The placeholder is now the same component as the real
trigger, so the two cannot drift again.
Tested in ui-layout.cy.js against the real <DesktopNav/>, which takes its
colours, home link and indicators as props and so needs none of NavBar's polling
hooks. Indicator centres are measured against the bar's centre rather than each
other, because three things can be equally and consistently wrong and were. The
wrap case sweeps 1180px down to 640px in 6px steps -- a spot check steps over a
band that narrow. All three failed first: share 3.4px high, Help 24.8px against
a 54.4px bar, and two rows at 1156px.
Confirmed on the running app: every indicator at 0.0px from the bar's centre,
Help and Admin at the full 54.4px, and no wrap anywhere from 1500px to 780px.
1115 jest / 62 suites, 182 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:25:04 -06:00
|
|
|
/*
|
|
|
|
|
* The trigger for a navbar dropdown.
|
|
|
|
|
*
|
|
|
|
|
* Shared with the hidden placeholder DesktopNav measures on its first render, and that is
|
|
|
|
|
* the point of extracting it. The placeholder used to be a plain `<button>More</button>`
|
|
|
|
|
* with no caret, so the space reserved for the overflow menu was about 21px short of the
|
|
|
|
|
* button that eventually rendered -- the row overflowed by that much and the bar wrapped.
|
|
|
|
|
* Measuring one thing and drawing another is only ever right by coincidence.
|
|
|
|
|
*/
|
ui: the corner triggers, the More button, and the search modal
Four faults, each measured in the running app before and after.
The search glyph carried Semantic's `item` class, which has had no rules at all
since Semantic was removed: no pointer cursor, no hover, and an 18.6px hit area
against a 54.4px bar. It is the same kind of thing as Help and Admin and now
takes the same class. The share glyph did compute `cursor: pointer` -- it is an
`<a href>` -- but its target was the 24px box the icon occupies, so the pointer
appeared only if you found it exactly. Corner anchors now stretch and pad like
a link.
The More button rendered with NO class at all: a bare grey UA button while the
rest of the bar took the user's colour. Menu.Target clones its child and hands
it a className of its own, and the trigger spread those cloned props after its
own `className` attribute, so the clone replaced ours. It is merged now. This
was mine, from extracting NavDropdownTrigger last commit -- and it also made the
previous commit's "measured and drawn are the same component" claim only half
true, because the hidden placeholder is not cloned and so kept its class.
The bar still wrapped, for a reason the padding fix could not reach: the corner
does not keep a constant width. The Cmd-K hint renders only once
useKeyboardDetected has seen a keypress, so it appears at an arbitrary later
moment and widens the corner by ~30px; the load, memory, temperature and drive
warnings come and go with the machine's state. None of that resizes the
container, which was the only thing observed -- so nothing recalculated. That
is the other half of "at certain widths": the same viewport wrapped or not
depending on whether the user had touched a key. The corner and the home link
are observed too now.
The search modal showed an input and the first line of the first group. The
suggestion list is absolutely positioned, which is right everywhere else -- a
list that reflows the page while you type is unusable -- but in a modal it fails
twice: an absolute list adds no height, so the panel sized itself to the search
box alone at 114px, and the panel's own `overflow: auto` then clipped the list
at that edge. In the modal the list sits in flow; the inverse is asserted so
the rule cannot leak to the pages where overlaying is correct.
Two of the new tests were wrong first and reverting the fix left them green:
they asserted hand-written markup carrying the classes I expected the components
to have, rather than the real SearchIconButton and ShareButton. They use the
real components now. Every fix was then planted against: 5 red for the More
class, 2 for the search class, 2 for the corner hit area, 1 for the observer,
2 for the modal.
1115 jest / 62 suites, 196 in ui-layout.cy.js, clean npm run build.
Confirmed live: share and search both pointer at 54.4px, More white on the bar
colour with a transparent face, and the modal's list in flow and unclipped.
2026-08-02 14:45:49 -06:00
|
|
|
const NavDropdownTrigger = React.forwardRef(({text, className, ...props}, ref) =>
|
|
|
|
|
/*
|
|
|
|
|
* `className` is pulled out and MERGED, never spread over. Menu.Target clones its child
|
|
|
|
|
* and hands it a className of its own, and a `{...props}` spread placed after the
|
|
|
|
|
* attribute replaces ours with it -- which left the real More button with no class at
|
|
|
|
|
* all, so it rendered as a bare grey UA button instead of taking the bar's colour, its
|
|
|
|
|
* padding and its hover. The hidden placeholder is not cloned by Menu.Target, so it
|
|
|
|
|
* kept its class and measured wider than the button that actually drew.
|
|
|
|
|
*/
|
|
|
|
|
<button type='button' ref={ref}
|
|
|
|
|
className={['wrolpi-navbar-link', 'wrolpi-navbar-link-button', className]
|
|
|
|
|
.filter(Boolean).join(' ')}
|
ui: the navbar corner was nudged rather than laid out, and it showed
Three faults in the bar, all reproduced by measurement before being fixed.
The indicators sat low. The slot carried `marginTop: 0.8em`, a nudge left over
from Semantic's menu; the corner centres its children, and a top margin is part
of the margin box being centred, so it applied as a ~6px downward shift. It
read as an error on the hotspot and the theme picker but not on share or search,
which is why it survived: an IconButton is a square ActionIcon that centres its
glyph exactly, while a bare-icon anchor sits high inside a line box that
reserves descender space for text that is not there. The nudge cancelled that
out on one shape and was pure error on the other. Both are laid out now --
flex, centred, no nudge -- and the anchors get `display: flex` so they hug their
glyph instead of a text line.
Help and Admin highlighted only a box around their text while Videos and
Statistics highlighted the full height. Same class, same rules, different
parent: the bar stretches its children, but the corner is a nested flex
container that centres its own, so a link inside it was sized to its content.
The hover background is painted on the link box, so that box IS the affordance.
The bar broke onto a second line at certain widths. Two measurement errors that
only overlap in a narrow band, which is why it appeared while resizing rather
than always. useOverflowNav measured the WRAPPER's offsetWidth and subtracted
only the home link and the corner, missing the bar's own `padding: 0 0.25em` --
about 8px it believed it had. And the hidden "More" placeholder it measured was
a plain button with no dropdown caret, about 21px narrower than the button that
eventually rendered. The placeholder is now the same component as the real
trigger, so the two cannot drift again.
Tested in ui-layout.cy.js against the real <DesktopNav/>, which takes its
colours, home link and indicators as props and so needs none of NavBar's polling
hooks. Indicator centres are measured against the bar's centre rather than each
other, because three things can be equally and consistently wrong and were. The
wrap case sweeps 1180px down to 640px in 6px steps -- a spot check steps over a
band that narrow. All three failed first: share 3.4px high, Help 24.8px against
a 54.4px bar, and two rows at 1156px.
Confirmed on the running app: every indicator at 0.0px from the bar's centre,
Help and Admin at the full 54.4px, and no wrap anywhere from 1500px to 780px.
1115 jest / 62 suites, 182 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:25:04 -06:00
|
|
|
{...props}>
|
|
|
|
|
{text}
|
|
|
|
|
<Icon name='dropdown' size='small' style={{marginLeft: '0.35em'}}/>
|
|
|
|
|
</button>
|
|
|
|
|
);
|
|
|
|
|
NavDropdownTrigger.displayName = 'NavDropdownTrigger';
|
|
|
|
|
|
2026-07-30 13:15:43 -06:00
|
|
|
function DropdownLinks({link}) {
|
|
|
|
|
// A labelled dropdown trigger: the desktop "More" overflow, or any nested
|
|
|
|
|
// link group handed to MenuLink.
|
|
|
|
|
return <Menu position='bottom-end' withinPortal>
|
|
|
|
|
<Menu.Target>
|
ui: the navbar corner was nudged rather than laid out, and it showed
Three faults in the bar, all reproduced by measurement before being fixed.
The indicators sat low. The slot carried `marginTop: 0.8em`, a nudge left over
from Semantic's menu; the corner centres its children, and a top margin is part
of the margin box being centred, so it applied as a ~6px downward shift. It
read as an error on the hotspot and the theme picker but not on share or search,
which is why it survived: an IconButton is a square ActionIcon that centres its
glyph exactly, while a bare-icon anchor sits high inside a line box that
reserves descender space for text that is not there. The nudge cancelled that
out on one shape and was pure error on the other. Both are laid out now --
flex, centred, no nudge -- and the anchors get `display: flex` so they hug their
glyph instead of a text line.
Help and Admin highlighted only a box around their text while Videos and
Statistics highlighted the full height. Same class, same rules, different
parent: the bar stretches its children, but the corner is a nested flex
container that centres its own, so a link inside it was sized to its content.
The hover background is painted on the link box, so that box IS the affordance.
The bar broke onto a second line at certain widths. Two measurement errors that
only overlap in a narrow band, which is why it appeared while resizing rather
than always. useOverflowNav measured the WRAPPER's offsetWidth and subtracted
only the home link and the corner, missing the bar's own `padding: 0 0.25em` --
about 8px it believed it had. And the hidden "More" placeholder it measured was
a plain button with no dropdown caret, about 21px narrower than the button that
eventually rendered. The placeholder is now the same component as the real
trigger, so the two cannot drift again.
Tested in ui-layout.cy.js against the real <DesktopNav/>, which takes its
colours, home link and indicators as props and so needs none of NavBar's polling
hooks. Indicator centres are measured against the bar's centre rather than each
other, because three things can be equally and consistently wrong and were. The
wrap case sweeps 1180px down to 640px in 6px steps -- a spot check steps over a
band that narrow. All three failed first: share 3.4px high, Help 24.8px against
a 54.4px bar, and two rows at 1156px.
Confirmed on the running app: every indicator at 0.0px from the bar's centre,
Help and Admin at the full 54.4px, and no wrap anywhere from 1500px to 780px.
1115 jest / 62 suites, 182 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:25:04 -06:00
|
|
|
<NavDropdownTrigger text={link.text}/>
|
2026-07-30 13:15:43 -06:00
|
|
|
</Menu.Target>
|
|
|
|
|
<Menu.Dropdown>
|
|
|
|
|
{link.links.map(l => <DropdownMenuItem key={l.key} link={l}/>)}
|
|
|
|
|
</Menu.Dropdown>
|
|
|
|
|
</Menu>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function MobileMenu({links}) {
|
|
|
|
|
// The mobile hamburger menu: an icon-only trigger holding every link.
|
|
|
|
|
return <Menu position='bottom-end' withinPortal>
|
|
|
|
|
<Menu.Target>
|
|
|
|
|
<IconButton icon={IconMenu2} label='Menu' variant='subtle'/>
|
|
|
|
|
</Menu.Target>
|
|
|
|
|
<Menu.Dropdown>
|
|
|
|
|
{links.map(link => <DropdownMenuItem key={link.key} link={link}/>)}
|
|
|
|
|
</Menu.Dropdown>
|
|
|
|
|
</Menu>
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|
|
|
|
|
|
ui: the navbar corner was nudged rather than laid out, and it showed
Three faults in the bar, all reproduced by measurement before being fixed.
The indicators sat low. The slot carried `marginTop: 0.8em`, a nudge left over
from Semantic's menu; the corner centres its children, and a top margin is part
of the margin box being centred, so it applied as a ~6px downward shift. It
read as an error on the hotspot and the theme picker but not on share or search,
which is why it survived: an IconButton is a square ActionIcon that centres its
glyph exactly, while a bare-icon anchor sits high inside a line box that
reserves descender space for text that is not there. The nudge cancelled that
out on one shape and was pure error on the other. Both are laid out now --
flex, centred, no nudge -- and the anchors get `display: flex` so they hug their
glyph instead of a text line.
Help and Admin highlighted only a box around their text while Videos and
Statistics highlighted the full height. Same class, same rules, different
parent: the bar stretches its children, but the corner is a nested flex
container that centres its own, so a link inside it was sized to its content.
The hover background is painted on the link box, so that box IS the affordance.
The bar broke onto a second line at certain widths. Two measurement errors that
only overlap in a narrow band, which is why it appeared while resizing rather
than always. useOverflowNav measured the WRAPPER's offsetWidth and subtracted
only the home link and the corner, missing the bar's own `padding: 0 0.25em` --
about 8px it believed it had. And the hidden "More" placeholder it measured was
a plain button with no dropdown caret, about 21px narrower than the button that
eventually rendered. The placeholder is now the same component as the real
trigger, so the two cannot drift again.
Tested in ui-layout.cy.js against the real <DesktopNav/>, which takes its
colours, home link and indicators as props and so needs none of NavBar's polling
hooks. Indicator centres are measured against the bar's centre rather than each
other, because three things can be equally and consistently wrong and were. The
wrap case sweeps 1180px down to 640px in 6px steps -- a spot check steps over a
band that narrow. All three failed first: share 3.4px high, Help 24.8px against
a 54.4px bar, and two rows at 1156px.
Confirmed on the running app: every indicator at 0.0px from the bar's centre,
Help and Admin at the full 54.4px, and no wrap anywhere from 1500px to 780px.
1115 jest / 62 suites, 182 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:25:04 -06:00
|
|
|
/*
|
|
|
|
|
* One status indicator's slot in the right-hand corner.
|
|
|
|
|
*
|
|
|
|
|
* This used to carry `marginTop: 0.8em`, a nudge left over from Semantic's menu. The corner
|
|
|
|
|
* centres its children, and a top margin is part of the margin box being centred, so the
|
|
|
|
|
* nudge pushed every indicator down by half of it -- about 6px.
|
|
|
|
|
*
|
|
|
|
|
* That read as an error on some and not others, which is why it survived: the bare-icon
|
|
|
|
|
* anchors (share, search) sit high inside their line box because it reserves descender space
|
|
|
|
|
* for text that is not there, so the nudge happened to cancel out. An IconButton is a square
|
|
|
|
|
* ActionIcon that centres its glyph exactly, so for the hotspot and the theme picker the
|
|
|
|
|
* nudge was 6px of pure error. Laying the slot out as a flex box centres both shapes on
|
|
|
|
|
* their real glyph box and needs no nudge at all.
|
|
|
|
|
*/
|
|
|
|
|
export function NavIconWrapper({children}) {
|
2025-01-11 12:04:14 -07:00
|
|
|
if (children) {
|
ui: the navbar corner was nudged rather than laid out, and it showed
Three faults in the bar, all reproduced by measurement before being fixed.
The indicators sat low. The slot carried `marginTop: 0.8em`, a nudge left over
from Semantic's menu; the corner centres its children, and a top margin is part
of the margin box being centred, so it applied as a ~6px downward shift. It
read as an error on the hotspot and the theme picker but not on share or search,
which is why it survived: an IconButton is a square ActionIcon that centres its
glyph exactly, while a bare-icon anchor sits high inside a line box that
reserves descender space for text that is not there. The nudge cancelled that
out on one shape and was pure error on the other. Both are laid out now --
flex, centred, no nudge -- and the anchors get `display: flex` so they hug their
glyph instead of a text line.
Help and Admin highlighted only a box around their text while Videos and
Statistics highlighted the full height. Same class, same rules, different
parent: the bar stretches its children, but the corner is a nested flex
container that centres its own, so a link inside it was sized to its content.
The hover background is painted on the link box, so that box IS the affordance.
The bar broke onto a second line at certain widths. Two measurement errors that
only overlap in a narrow band, which is why it appeared while resizing rather
than always. useOverflowNav measured the WRAPPER's offsetWidth and subtracted
only the home link and the corner, missing the bar's own `padding: 0 0.25em` --
about 8px it believed it had. And the hidden "More" placeholder it measured was
a plain button with no dropdown caret, about 21px narrower than the button that
eventually rendered. The placeholder is now the same component as the real
trigger, so the two cannot drift again.
Tested in ui-layout.cy.js against the real <DesktopNav/>, which takes its
colours, home link and indicators as props and so needs none of NavBar's polling
hooks. Indicator centres are measured against the bar's centre rather than each
other, because three things can be equally and consistently wrong and were. The
wrap case sweeps 1180px down to 640px in 6px steps -- a spot check steps over a
band that narrow. All three failed first: share 3.4px high, Help 24.8px against
a 54.4px bar, and two rows at 1156px.
Confirmed on the running app: every indicator at 0.0px from the bar's centre,
Help and Admin at the full 54.4px, and no wrap anywhere from 1500px to 780px.
1115 jest / 62 suites, 182 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:25:04 -06:00
|
|
|
return <div className='wrolpi-navbar-icon'>{children}</div>
|
2025-01-11 12:04:14 -07:00
|
|
|
} else {
|
|
|
|
|
// Do not use navbar space if children is empty.
|
|
|
|
|
return <React.Fragment/>
|
2025-01-11 11:06:31 -07:00
|
|
|
}
|
2022-10-19 09:18:53 -06:00
|
|
|
}
|
|
|
|
|
|
2024-10-05 14:06:13 -06:00
|
|
|
function useNavColorSetting() {
|
|
|
|
|
// Use localstorage to avoid flickering navbar color on startup.
|
|
|
|
|
const {settings} = React.useContext(SettingsContext);
|
ui: the navbar measures its foreground instead of assuming one
The bar's background is the one surface a user picks -- twelve colour names,
which each theme resolves to twelve of its own colours. Forty-eight
backgrounds, and the links and status icons were drawn on all of them in a
single token, `--btn-text`, which is near-black in three of the four themes.
Night's `--brown` is #451212. A near-black glyph on it is 1.33:1. Nine of
night's twelve colours and seven of amber's sat below 4.5:1, and twelve of the
forty-eight below 3:1 -- icons the same colour as the bar behind them.
So the foreground is measured against the background the theme actually
resolved, choosing between that theme's own `--btn-text`, `--black` and
`--white`. Its own, not literal ones: a white pixel in night mode undoes the
dark adaptation the theme exists to protect, so night's "white" is #ff8a8a.
Measuring at runtime rather than shipping an `--on-red` token per colour also
means the custom YAML themes still ahead get this for free.
Nothing is below 3:1 any more and the worst case is 3.27:1, up from 1.33:1.
No combination is worse than it was.
Ten of the forty-eight are still under 4.5:1 and no foreground will lift them:
a monochrome theme resolves all twelve names onto one ramp, and a mid-tone of a
hue cannot carry text of that same hue. That shortfall is in the palette, so
/theme-sample now draws all twelve bars with the measured ratio printed beside
each one, calling out the ten -- it is a decision to make while looking at them.
The WCAG primitives move to themes/contrast so theme code can measure a colour
without importing Common.js, which pulls in half the component library.
Common.js forwards `contrastRatio` with a delegating function rather than a bare
re-export: six specs mock it with `{...jest.requireActual('./Common')}`, the
spread invokes every getter, and those spreads run re-entrantly while the module
is still evaluating -- a re-export getter fires before its import binding exists
and takes the whole suite down.
Tested: navColors.test.js measures all forty-eight against the palette parsed
out of tokens.css, and holds Nav.js to the call by source since neither bar is
reachable from a test that could measure it. ui-layout.cy.js measures the
painted result in a real browser in all four themes and holds it against the
number the component reports. Reverting to the fixed foreground reddens four
jest cases and three cypress ones.
1115 jest / 62 suites, 177 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:07:19 -06:00
|
|
|
const [navColor, setNavColor] = useLocalStorage('nav_color', defaultNavColor);
|
2024-10-05 14:06:13 -06:00
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
2024-12-18 17:31:50 -07:00
|
|
|
if (!_.isEmpty(settings)) {
|
|
|
|
|
setNavColor(settings.nav_color);
|
|
|
|
|
}
|
2024-10-05 14:06:13 -06:00
|
|
|
}, [settings.nav_color]);
|
|
|
|
|
|
2026-02-04 12:23:28 -07:00
|
|
|
// Update favicon to match nav color
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
if (navColor) {
|
|
|
|
|
updateFavicon(navColor);
|
|
|
|
|
}
|
|
|
|
|
}, [navColor]);
|
|
|
|
|
|
2024-10-05 14:06:13 -06:00
|
|
|
return navColor
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-01 16:42:52 -06:00
|
|
|
export function NavBar() {
|
2023-07-21 15:14:09 -06:00
|
|
|
const wrolModeEnabled = useWROLMode();
|
2024-08-15 21:45:06 -06:00
|
|
|
const {status} = React.useContext(StatusContext);
|
2024-10-05 14:06:13 -06:00
|
|
|
const navColor = useNavColorSetting();
|
ui: the navbar measures its foreground instead of assuming one
The bar's background is the one surface a user picks -- twelve colour names,
which each theme resolves to twelve of its own colours. Forty-eight
backgrounds, and the links and status icons were drawn on all of them in a
single token, `--btn-text`, which is near-black in three of the four themes.
Night's `--brown` is #451212. A near-black glyph on it is 1.33:1. Nine of
night's twelve colours and seven of amber's sat below 4.5:1, and twelve of the
forty-eight below 3:1 -- icons the same colour as the bar behind them.
So the foreground is measured against the background the theme actually
resolved, choosing between that theme's own `--btn-text`, `--black` and
`--white`. Its own, not literal ones: a white pixel in night mode undoes the
dark adaptation the theme exists to protect, so night's "white" is #ff8a8a.
Measuring at runtime rather than shipping an `--on-red` token per colour also
means the custom YAML themes still ahead get this for free.
Nothing is below 3:1 any more and the worst case is 3.27:1, up from 1.33:1.
No combination is worse than it was.
Ten of the forty-eight are still under 4.5:1 and no foreground will lift them:
a monochrome theme resolves all twelve names onto one ramp, and a mid-tone of a
hue cannot carry text of that same hue. That shortfall is in the palette, so
/theme-sample now draws all twelve bars with the measured ratio printed beside
each one, calling out the ten -- it is a decision to make while looking at them.
The WCAG primitives move to themes/contrast so theme code can measure a colour
without importing Common.js, which pulls in half the component library.
Common.js forwards `contrastRatio` with a delegating function rather than a bare
re-export: six specs mock it with `{...jest.requireActual('./Common')}`, the
spread invokes every getter, and those spreads run re-entrantly while the module
is still evaluating -- a re-export getter fires before its import binding exists
and takes the whole suite down.
Tested: navColors.test.js measures all forty-eight against the palette parsed
out of tokens.css, and holds Nav.js to the call by source since neither bar is
reachable from a test that could measure it. ui-layout.cy.js measures the
painted result in a real browser in all four themes and holds it against the
number the component reports. Reverting to the fixed foreground reddens four
jest cases and three cypress ones.
1115 jest / 62 suites, 177 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:07:19 -06:00
|
|
|
/*
|
|
|
|
|
* The bar's foreground is measured against the background the theme resolved for the
|
|
|
|
|
* user's colour, not taken from a single token. See themes/navColors.
|
|
|
|
|
*/
|
|
|
|
|
const navColors = useNavColors(navColor);
|
review: measure what can be measured, and say what is not
Acting on the review of #621. No bugs were found; these are the four
suggestions and two nits.
The real one: measurement accepted only hex. `relativeLuminance` returned 0 for
anything else, which is black's luminance and indistinguishable from it -- so a
token written `rgb(92 79 168)` measured as pure black, the "best" foreground was
chosen against a colour the theme does not contain, and the wrong hex was then
frozen into an inline style where CSS could no longer correct it. Silent, and
worse than not measuring. `parseColor` now reads `rgb()`/`rgba()` in both the
comma and space forms, percentages, and `#rgba`/`#rrggbbaa`; `isMeasurable` lets
a caller tell "unreadable" from "black"; and navColorsFrom falls back to the
tokens when the background or every candidate is unreadable. Unreadable
candidates are filtered rather than the whole measurement abandoned, so one
oddly written token does not cost the other two. This matters because the
header claimed custom YAML themes get correct foregrounds for free, and a
hand-written palette is exactly where a non-hex value will first appear.
The Cypress inverse hardcoded night's `--btn-text` as `#0a0000`. The unit tests
parse tokens.css precisely so a palette edit cannot leave a stale claim behind,
and that literal was the one place the rule was broken. It reads the token from
the theme now, asserts it resolved, and additionally pins that red still takes
`--btn-text` while brown no longer does.
Documented rather than changed: the warning indicators still pick their colour
from the `conflictingColors` name list. It is the same defect as the one fixed
here and measurably worse -- `--danger` and `--warning` are 1.0-1.8:1 against
the bar in every theme, light and dark included, because a red icon on a red bar
is a red icon on a red bar. The fix is not a better colour: severity has to
stay distinguishable from the bar's text as well as from itself, and a
monochrome theme has no third brightness, so it has to stop being a hue. That
is a redesign, and the note now sits beside the residue in navColors.ts rather
than only in a PR description. The gallery draws the indicators as the bar
draws them when nothing is wrong; it does not stage a fake overheating Pi to
exhibit a fault nobody has agreed how to fix.
Also documented: re-measurement is triggered by `data-theme`, so a future
custom-theme editor patching custom properties in place would leave the bar on
the values it last measured. There is no event for "a custom property was
assigned" to observe instead, so the note says what such an editor must do.
Nits: "Eleven" in a comment where the assertion locks ten (and a stale 2.91:1
beside it, now 3.27:1), and a missing space in `const wrolpiIcon =<img`.
Six new unit cases, planted: dropping the fallback reddens two.
1121 jest / 62 suites, 196 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:57:17 -06:00
|
|
|
const wrolpiIcon = <img src='/icon.svg' height='32px' width='32px' alt='WROLPi Home Icon'/>;
|
2024-05-18 17:51:06 -06:00
|
|
|
const name = <i>{NAME || wrolpiIcon}</i>;
|
2026-07-30 13:15:43 -06:00
|
|
|
const topNavText = wrolModeEnabled ? <>{name} <Icon name='lock'/></> : name;
|
2022-08-06 05:22:07 +00:00
|
|
|
|
2026-07-30 13:15:43 -06:00
|
|
|
const homeLink = <NavLink className='wrolpi-navbar-link' to='/' style={{paddingTop: 0, paddingBottom: 0}}>
|
2023-02-09 13:47:25 -07:00
|
|
|
{topNavText}
|
|
|
|
|
</NavLink>;
|
2023-10-06 12:48:20 -06:00
|
|
|
|
2025-01-10 11:33:21 -07:00
|
|
|
// Red/Yellow colors will blend in to some navbar colors, swap the colors for high contrast.
|
|
|
|
|
const conflictingColors = ['red', 'orange', 'yellow', 'olive', 'pink'];
|
2025-01-18 10:08:11 -07:00
|
|
|
const [lowWarningColor, highWarningColor] = conflictingColors.includes(navColor)
|
|
|
|
|
? [null, 'black']
|
|
|
|
|
: ['yellow', 'red'];
|
2025-01-10 11:33:21 -07:00
|
|
|
|
|
|
|
|
// Generic system load, the least important warning.
|
|
|
|
|
const {minute_1, mediumLoad, highLoad} = useLoad();
|
|
|
|
|
let systemLoadIcon;
|
|
|
|
|
if (mediumLoad || highLoad) {
|
|
|
|
|
// System load is high, display a warning icon.
|
|
|
|
|
const color = highLoad ? highWarningColor : lowWarningColor;
|
|
|
|
|
const icon = <Link to='/admin/status'>
|
2026-07-30 13:15:43 -06:00
|
|
|
<Icon name='tachometer alternate' size='large' style={{color: colorVar(color)}}
|
|
|
|
|
label='System load warning'/>
|
2025-01-10 11:33:21 -07:00
|
|
|
</Link>;
|
2026-07-30 13:15:43 -06:00
|
|
|
systemLoadIcon = <Tooltip label={`Load: ${minute_1}`}>{icon}</Tooltip>
|
2025-01-10 11:33:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// RAM consumption.
|
|
|
|
|
const {percent: memoryPercent} = useMemoryStats();
|
|
|
|
|
let memoryIcon;
|
|
|
|
|
if (memoryPercent > 80) {
|
|
|
|
|
const color = memoryPercent > 90 ? highWarningColor : lowWarningColor;
|
ui: Nav off Semantic, and the memory warning starts working
The navigation bar was the last visibly-Semantic surface, so this finishes the
visual migration. Its two fragile features survive intact: the navbar colour
still comes from the user's `nav_color` setting, now as `var(--<name>)` since
our token tables define all fourteen Semantic colour names, with text taking
`--btn-text` so every theme stays legible; and the warning-icon contrast swap
is unchanged, including the case where `lowWarningColor` is null and must mean
"no override" rather than `var(--null)`.
Fixed a pre-existing bug the migration exposed: the memory indicator passed its
colour to `Link`, which ignores it, so that icon never changed colour -- 81% and
95% RAM looked identical. Every sibling indicator colours the Icon; now this
one does too.
The agent that migrated this file also gave names to the warning indicators,
which were unlabelled icons inside links, so a screen reader now announces what
each one is. The three data-testid hooks are unchanged.
Baseline 15 -> 2. Only ControllerPage and Theme.tsx remain; Theme.tsx is last
by design, since it can only go once nothing imports its Semantic wrappers.
2026-07-30 13:18:12 -06:00
|
|
|
{/*
|
|
|
|
|
The colour goes on the Icon, as it does for every other indicator. It used to
|
|
|
|
|
be passed to `Link`, which ignores it, so the memory warning never actually
|
|
|
|
|
changed colour -- 81% and 95% looked identical.
|
|
|
|
|
*/}
|
|
|
|
|
const icon = <Link to='/admin/status'>
|
|
|
|
|
<Icon name='microchip' size='large' label='Memory usage warning'
|
|
|
|
|
style={{color: colorVar(color)}}/>
|
2025-01-10 11:33:21 -07:00
|
|
|
</Link>;
|
2026-07-30 13:15:43 -06:00
|
|
|
memoryIcon = <Tooltip label={`System Memory: ${memoryPercent.toFixed()}%`}>{icon}</Tooltip>
|
2025-01-10 11:33:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Any disk is busy and processes are waiting.
|
|
|
|
|
const {percentIOWait} = useIOStats();
|
|
|
|
|
let diskWaitIcon;
|
|
|
|
|
if (percentIOWait >= 50) {
|
|
|
|
|
// Processes are waiting on disk, display a warning icon.
|
|
|
|
|
const color = percentIOWait > 75 ? highWarningColor : lowWarningColor;
|
2025-01-22 17:18:16 -07:00
|
|
|
const icon = <Link to='/admin/status'>
|
2026-07-30 13:15:43 -06:00
|
|
|
<Icon name='disk' size='large' style={{color: colorVar(color)}} label='Disk I/O wait warning'/>
|
2025-01-10 11:33:21 -07:00
|
|
|
</Link>;
|
2026-07-30 13:15:43 -06:00
|
|
|
diskWaitIcon = <Tooltip label={`Processes waiting on disk: ${percentIOWait.toFixed()}%`}>{icon}</Tooltip>
|
2025-01-10 11:33:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CPU temperature.
|
|
|
|
|
const {temperature, highTemperature, criticalTemperature} = useCPUTemperature();
|
|
|
|
|
let temperatureIcon;
|
|
|
|
|
if (temperature && temperature >= highTemperature) {
|
|
|
|
|
// CPU temperature is high, display a warning icon.
|
|
|
|
|
const color = temperature >= criticalTemperature ? highWarningColor : lowWarningColor;
|
2026-07-30 13:15:43 -06:00
|
|
|
const temperatureComponent = temperature >= criticalTemperature ? IconTemperaturePlus : IconTemperature;
|
|
|
|
|
const icon = <Icon data-testid='cpuTemperatureIcon' component={temperatureComponent} size='large'
|
|
|
|
|
style={{color: colorVar(color)}} label='CPU temperature warning'/>
|
2025-01-10 11:33:21 -07:00
|
|
|
const link = <Link to='/admin/status'>{icon}</Link>;
|
2026-07-30 13:15:43 -06:00
|
|
|
temperatureIcon = <Tooltip label={`CPU: ${temperature.toFixed()}°C`}>{link}</Tooltip>;
|
2025-01-10 11:33:21 -07:00
|
|
|
}
|
|
|
|
|
|
2026-06-03 18:46:29 -06:00
|
|
|
// Hard-drive temperature. An overheating drive risks data loss.
|
|
|
|
|
const {
|
|
|
|
|
device: hotDrive,
|
|
|
|
|
temperature: driveTemperature,
|
|
|
|
|
highTemperature: driveHighTemperature,
|
|
|
|
|
criticalTemperature: driveCriticalTemperature,
|
|
|
|
|
} = useDriveTemperature();
|
|
|
|
|
let driveTemperatureIcon;
|
|
|
|
|
if (driveTemperature && driveTemperature >= driveHighTemperature) {
|
|
|
|
|
const color = driveTemperature >= driveCriticalTemperature ? highWarningColor : lowWarningColor;
|
2026-07-30 13:15:43 -06:00
|
|
|
const icon = <Icon data-testid='driveTemperatureIcon' name='hdd' size='large'
|
|
|
|
|
style={{color: colorVar(color)}} label='Drive temperature warning'/>
|
2026-06-24 15:59:34 -06:00
|
|
|
const link = <Link to='/admin/controller'>{icon}</Link>;
|
2026-07-30 13:15:43 -06:00
|
|
|
driveTemperatureIcon = <Tooltip label={`${hotDrive}: ${driveTemperature.toFixed()}°C`}>{link}</Tooltip>;
|
2026-06-03 18:46:29 -06:00
|
|
|
}
|
|
|
|
|
|
2026-06-24 15:59:34 -06:00
|
|
|
// A drive's SMART health is degraded. FAIL is an imminent failure (back
|
|
|
|
|
// up now); WARN means unreadable/pending sectors are accumulating. Always
|
|
|
|
|
// displayed (like power); too important to hide behind a transient warning
|
|
|
|
|
// in the priority chain. Links to the Controller page, which shows the
|
|
|
|
|
// SMART detail (the Status page does not).
|
|
|
|
|
const {failingDevices, failing: driveFailing, warningDevices, warning: driveWarning} = useDriveHealth();
|
2026-06-03 20:02:59 -06:00
|
|
|
let driveHealthIcon;
|
|
|
|
|
if (driveFailing) {
|
2026-07-30 13:15:43 -06:00
|
|
|
const icon = <Icon data-testid='driveHealthIcon' name='warning sign' size='large'
|
|
|
|
|
style={{color: colorVar(highWarningColor)}} label='Drive health failing'/>;
|
2026-06-24 15:59:34 -06:00
|
|
|
const link = <Link to='/admin/controller'>{icon}</Link>;
|
2026-06-03 20:02:59 -06:00
|
|
|
const message = failingDevices.length === 1
|
|
|
|
|
? `Drive ${failingDevices[0]} is failing its SMART health check! Back up your data.`
|
|
|
|
|
: `Drives failing SMART health check: ${failingDevices.join(', ')}. Back up your data.`;
|
2026-07-30 13:15:43 -06:00
|
|
|
driveHealthIcon = <Tooltip label={message}>{link}</Tooltip>;
|
2026-06-24 15:59:34 -06:00
|
|
|
} else if (driveWarning) {
|
2026-07-30 13:15:43 -06:00
|
|
|
const icon = <Icon data-testid='driveHealthIcon' name='warning sign' size='large'
|
|
|
|
|
style={{color: colorVar(lowWarningColor)}} label='Drive health warning'/>;
|
2026-06-24 15:59:34 -06:00
|
|
|
const link = <Link to='/admin/controller'>{icon}</Link>;
|
|
|
|
|
const message = warningDevices.length === 1
|
|
|
|
|
? `Drive ${warningDevices[0]} has unreadable or pending sectors — check its SMART health.`
|
|
|
|
|
: `Drives with unreadable or pending sectors: ${warningDevices.join(', ')}. Check their SMART health.`;
|
2026-07-30 13:15:43 -06:00
|
|
|
driveHealthIcon = <Tooltip label={message}>{link}</Tooltip>;
|
2026-06-03 20:02:59 -06:00
|
|
|
}
|
|
|
|
|
|
2025-01-10 11:33:21 -07:00
|
|
|
// Power issues, this is always displayed if detected.
|
|
|
|
|
const {underVoltage, overCurrent} = usePowerStats();
|
|
|
|
|
let powerIcon;
|
|
|
|
|
if (underVoltage || overCurrent) {
|
2026-07-30 13:15:43 -06:00
|
|
|
const icon = underVoltage
|
|
|
|
|
? <Icon component={IconPlugOff} size='large' style={{color: colorVar(highWarningColor)}}
|
|
|
|
|
label='Under-voltage warning'/>
|
|
|
|
|
: <Icon name='lightning' size='large' style={{color: colorVar(highWarningColor)}}
|
|
|
|
|
label='Over-current warning'/>;
|
2025-01-10 11:33:21 -07:00
|
|
|
const message = underVoltage
|
|
|
|
|
? 'Under-voltage detected! Your power supply is insufficient!'
|
|
|
|
|
: 'Over-current detected! Your peripherals are using too much power!';
|
2026-07-30 13:15:43 -06:00
|
|
|
powerIcon = <Tooltip label={message}><span>{icon}</span></Tooltip>;
|
2025-01-10 11:33:21 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Display the temperature icon first because it can cause the system to throttle. The rest are in order of effects
|
|
|
|
|
// that will slow down the system and the user should address. Generic load is last because it is probably not an
|
|
|
|
|
// issue.
|
2026-06-03 18:46:29 -06:00
|
|
|
const warningIcon = temperatureIcon || driveTemperatureIcon || diskWaitIcon || memoryIcon || systemLoadIcon;
|
2024-08-15 21:45:06 -06:00
|
|
|
|
2026-01-23 19:51:02 -07:00
|
|
|
const {isReorganizing, taskType, collectionId, collectionKind} = useReorganizationStatus();
|
|
|
|
|
|
2024-12-18 16:39:50 -07:00
|
|
|
let processingLink;
|
|
|
|
|
if (status && status.flags) {
|
2026-01-09 14:01:25 -07:00
|
|
|
if (status.flags.file_worker_busy) {
|
2026-01-23 19:51:02 -07:00
|
|
|
// Smart navigation based on what the file worker is doing
|
|
|
|
|
if (isReorganizing && collectionId && collectionKind) {
|
|
|
|
|
// Single collection reorganization - navigate to that collection
|
|
|
|
|
if (collectionKind === 'channel') {
|
|
|
|
|
processingLink = `/videos/channel/${collectionId}/edit`;
|
|
|
|
|
} else if (collectionKind === 'domain') {
|
2026-03-20 15:38:32 -06:00
|
|
|
processingLink = `/archives/domain/${collectionId}/edit`;
|
2026-01-23 19:51:02 -07:00
|
|
|
} else {
|
|
|
|
|
processingLink = '/files';
|
|
|
|
|
}
|
|
|
|
|
} else if (isReorganizing && taskType === 'batch_reorganize' && collectionKind) {
|
|
|
|
|
// Batch reorganization - navigate to settings page for that kind
|
|
|
|
|
if (collectionKind === 'channel') {
|
|
|
|
|
processingLink = '/videos/settings';
|
|
|
|
|
} else if (collectionKind === 'domain') {
|
2026-03-20 15:38:32 -06:00
|
|
|
processingLink = '/archives/settings';
|
2026-01-23 19:51:02 -07:00
|
|
|
} else {
|
|
|
|
|
processingLink = '/files';
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
processingLink = '/files';
|
|
|
|
|
}
|
2024-12-18 16:39:50 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const processingIcon = processingLink &&
|
|
|
|
|
<Link to={processingLink}>
|
2026-07-30 13:15:43 -06:00
|
|
|
<Icon loading name='circle notch' size='large' label='File worker busy'/>
|
2024-12-18 16:39:50 -07:00
|
|
|
</Link>;
|
2023-10-06 12:48:20 -06:00
|
|
|
|
2025-01-24 15:35:26 -07:00
|
|
|
let apiDownIcon;
|
|
|
|
|
if (window.apiDown) {
|
2026-07-30 13:15:43 -06:00
|
|
|
apiDownIcon = <Tooltip label='API is not responding'>
|
|
|
|
|
<span><Icon name='plug' style={{color: colorVar(highWarningColor)}} label='API is not responding'/></span>
|
|
|
|
|
</Tooltip>
|
2025-01-24 15:35:26 -07:00
|
|
|
}
|
|
|
|
|
|
2025-12-06 14:47:52 -07:00
|
|
|
// Upgrade available notification - only show on native (non-Docker) installs and when WROL Mode is disabled
|
2025-10-29 22:16:33 -06:00
|
|
|
let upgradeIcon;
|
2025-12-06 14:47:52 -07:00
|
|
|
if (status?.update_available && !status?.dockerized && !wrolModeEnabled) {
|
2025-10-29 22:16:33 -06:00
|
|
|
const commitsBehind = status.commits_behind || 0;
|
|
|
|
|
const branch = status.git_branch || 'unknown';
|
2025-12-07 10:53:49 -07:00
|
|
|
const icon = <Link to='/admin/settings#upgrade'>
|
2026-07-30 13:15:43 -06:00
|
|
|
<Icon name='arrow alternate circle up' size='large' style={{color: 'var(--green)'}}
|
|
|
|
|
label='Upgrade available'/>
|
2025-10-29 22:16:33 -06:00
|
|
|
</Link>;
|
2026-07-30 13:15:43 -06:00
|
|
|
upgradeIcon = <Tooltip label={`Upgrade available: ${commitsBehind} commit(s) behind on ${branch}`}>
|
|
|
|
|
{icon}
|
|
|
|
|
</Tooltip>;
|
2025-10-29 22:16:33 -06:00
|
|
|
}
|
|
|
|
|
|
2023-01-07 18:31:39 -07:00
|
|
|
const icons = <React.Fragment>
|
2025-01-24 15:35:26 -07:00
|
|
|
<NavIconWrapper>{apiDownIcon}</NavIconWrapper>
|
2025-01-10 11:33:21 -07:00
|
|
|
<NavIconWrapper>{processingIcon}</NavIconWrapper>
|
2025-10-29 22:16:33 -06:00
|
|
|
<NavIconWrapper>{upgradeIcon}</NavIconWrapper>
|
2026-06-03 20:02:59 -06:00
|
|
|
<NavIconWrapper>{driveHealthIcon}</NavIconWrapper>
|
2025-01-10 11:33:21 -07:00
|
|
|
<NavIconWrapper>{powerIcon}</NavIconWrapper>
|
|
|
|
|
<NavIconWrapper>{warningIcon}</NavIconWrapper>
|
|
|
|
|
<NavIconWrapper><ShareButton/></NavIconWrapper>
|
|
|
|
|
<NavIconWrapper><HotspotStatusIcon/></NavIconWrapper>
|
|
|
|
|
<NavIconWrapper><DarkModeToggle/></NavIconWrapper>
|
2023-01-07 18:31:39 -07:00
|
|
|
</React.Fragment>;
|
2021-11-01 16:42:52 -06:00
|
|
|
|
2023-01-07 18:31:39 -07:00
|
|
|
return <>
|
2026-04-09 16:01:59 -06:00
|
|
|
<Media between={['mobile', 'tablet']}>
|
ui: the navbar measures its foreground instead of assuming one
The bar's background is the one surface a user picks -- twelve colour names,
which each theme resolves to twelve of its own colours. Forty-eight
backgrounds, and the links and status icons were drawn on all of them in a
single token, `--btn-text`, which is near-black in three of the four themes.
Night's `--brown` is #451212. A near-black glyph on it is 1.33:1. Nine of
night's twelve colours and seven of amber's sat below 4.5:1, and twelve of the
forty-eight below 3:1 -- icons the same colour as the bar behind them.
So the foreground is measured against the background the theme actually
resolved, choosing between that theme's own `--btn-text`, `--black` and
`--white`. Its own, not literal ones: a white pixel in night mode undoes the
dark adaptation the theme exists to protect, so night's "white" is #ff8a8a.
Measuring at runtime rather than shipping an `--on-red` token per colour also
means the custom YAML themes still ahead get this for free.
Nothing is below 3:1 any more and the worst case is 3.27:1, up from 1.33:1.
No combination is worse than it was.
Ten of the forty-eight are still under 4.5:1 and no foreground will lift them:
a monochrome theme resolves all twelve names onto one ramp, and a mid-tone of a
hue cannot carry text of that same hue. That shortfall is in the palette, so
/theme-sample now draws all twelve bars with the measured ratio printed beside
each one, calling out the ten -- it is a decision to make while looking at them.
The WCAG primitives move to themes/contrast so theme code can measure a colour
without importing Common.js, which pulls in half the component library.
Common.js forwards `contrastRatio` with a delegating function rather than a bare
re-export: six specs mock it with `{...jest.requireActual('./Common')}`, the
spread invokes every getter, and those spreads run re-entrantly while the module
is still evaluating -- a re-export getter fires before its import binding exists
and takes the whole suite down.
Tested: navColors.test.js measures all forty-eight against the palette parsed
out of tokens.css, and holds Nav.js to the call by source since neither bar is
reachable from a test that could measure it. ui-layout.cy.js measures the
painted result in a real browser in all four themes and holds it against the
number the component reports. Reverting to the fixed foreground reddens four
jest cases and three cypress ones.
1115 jest / 62 suites, 177 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:07:19 -06:00
|
|
|
<nav className='wrolpi-navbar' id='global_navbar' style={navBarStyle(navColors)}>
|
2023-01-07 18:31:39 -07:00
|
|
|
{homeLink}
|
2026-07-30 13:15:43 -06:00
|
|
|
<div className='wrolpi-navbar-right'>
|
2023-01-07 18:31:39 -07:00
|
|
|
{icons}
|
2024-12-18 16:39:50 -07:00
|
|
|
<SearchIconButton/>
|
2026-07-30 13:15:43 -06:00
|
|
|
<MobileMenu links={[...allLinks, ...rightLinks]}/>
|
|
|
|
|
</div>
|
|
|
|
|
</nav>
|
2023-01-07 18:31:39 -07:00
|
|
|
</Media>
|
2026-04-09 16:01:59 -06:00
|
|
|
<Media greaterThanOrEqual='tablet'>
|
ui: the navbar measures its foreground instead of assuming one
The bar's background is the one surface a user picks -- twelve colour names,
which each theme resolves to twelve of its own colours. Forty-eight
backgrounds, and the links and status icons were drawn on all of them in a
single token, `--btn-text`, which is near-black in three of the four themes.
Night's `--brown` is #451212. A near-black glyph on it is 1.33:1. Nine of
night's twelve colours and seven of amber's sat below 4.5:1, and twelve of the
forty-eight below 3:1 -- icons the same colour as the bar behind them.
So the foreground is measured against the background the theme actually
resolved, choosing between that theme's own `--btn-text`, `--black` and
`--white`. Its own, not literal ones: a white pixel in night mode undoes the
dark adaptation the theme exists to protect, so night's "white" is #ff8a8a.
Measuring at runtime rather than shipping an `--on-red` token per colour also
means the custom YAML themes still ahead get this for free.
Nothing is below 3:1 any more and the worst case is 3.27:1, up from 1.33:1.
No combination is worse than it was.
Ten of the forty-eight are still under 4.5:1 and no foreground will lift them:
a monochrome theme resolves all twelve names onto one ramp, and a mid-tone of a
hue cannot carry text of that same hue. That shortfall is in the palette, so
/theme-sample now draws all twelve bars with the measured ratio printed beside
each one, calling out the ten -- it is a decision to make while looking at them.
The WCAG primitives move to themes/contrast so theme code can measure a colour
without importing Common.js, which pulls in half the component library.
Common.js forwards `contrastRatio` with a delegating function rather than a bare
re-export: six specs mock it with `{...jest.requireActual('./Common')}`, the
spread invokes every getter, and those spreads run re-entrantly while the module
is still evaluating -- a re-export getter fires before its import binding exists
and takes the whole suite down.
Tested: navColors.test.js measures all forty-eight against the palette parsed
out of tokens.css, and holds Nav.js to the call by source since neither bar is
reachable from a test that could measure it. ui-layout.cy.js measures the
painted result in a real browser in all four themes and holds it against the
number the component reports. Reverting to the fixed foreground reddens four
jest cases and three cypress ones.
1115 jest / 62 suites, 177 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:07:19 -06:00
|
|
|
<DesktopNav navColors={navColors} homeLink={homeLink} icons={icons}/>
|
2026-04-09 16:01:59 -06:00
|
|
|
</Media>
|
|
|
|
|
</>
|
|
|
|
|
}
|
2021-11-01 16:42:52 -06:00
|
|
|
|
ui: the navbar corner was nudged rather than laid out, and it showed
Three faults in the bar, all reproduced by measurement before being fixed.
The indicators sat low. The slot carried `marginTop: 0.8em`, a nudge left over
from Semantic's menu; the corner centres its children, and a top margin is part
of the margin box being centred, so it applied as a ~6px downward shift. It
read as an error on the hotspot and the theme picker but not on share or search,
which is why it survived: an IconButton is a square ActionIcon that centres its
glyph exactly, while a bare-icon anchor sits high inside a line box that
reserves descender space for text that is not there. The nudge cancelled that
out on one shape and was pure error on the other. Both are laid out now --
flex, centred, no nudge -- and the anchors get `display: flex` so they hug their
glyph instead of a text line.
Help and Admin highlighted only a box around their text while Videos and
Statistics highlighted the full height. Same class, same rules, different
parent: the bar stretches its children, but the corner is a nested flex
container that centres its own, so a link inside it was sized to its content.
The hover background is painted on the link box, so that box IS the affordance.
The bar broke onto a second line at certain widths. Two measurement errors that
only overlap in a narrow band, which is why it appeared while resizing rather
than always. useOverflowNav measured the WRAPPER's offsetWidth and subtracted
only the home link and the corner, missing the bar's own `padding: 0 0.25em` --
about 8px it believed it had. And the hidden "More" placeholder it measured was
a plain button with no dropdown caret, about 21px narrower than the button that
eventually rendered. The placeholder is now the same component as the real
trigger, so the two cannot drift again.
Tested in ui-layout.cy.js against the real <DesktopNav/>, which takes its
colours, home link and indicators as props and so needs none of NavBar's polling
hooks. Indicator centres are measured against the bar's centre rather than each
other, because three things can be equally and consistently wrong and were. The
wrap case sweeps 1180px down to 640px in 6px steps -- a spot check steps over a
band that narrow. All three failed first: share 3.4px high, Help 24.8px against
a 54.4px bar, and two rows at 1156px.
Confirmed on the running app: every indicator at 0.0px from the bar's centre,
Help and Admin at the full 54.4px, and no wrap anywhere from 1500px to 780px.
1115 jest / 62 suites, 182 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:25:04 -06:00
|
|
|
export function DesktopNav({navColors, homeLink, icons}) {
|
2026-04-09 16:01:59 -06:00
|
|
|
const containerRef = React.useRef(null);
|
|
|
|
|
const homeRef = React.useRef(null);
|
|
|
|
|
const rightMenuRef = React.useRef(null);
|
|
|
|
|
const moreRef = React.useRef(null);
|
|
|
|
|
const {visibleLinks, overflowLinks, itemRefCallback, isReady} = useOverflowNav({
|
|
|
|
|
links: allLinks,
|
|
|
|
|
containerRef,
|
|
|
|
|
homeRef,
|
|
|
|
|
rightMenuRef,
|
|
|
|
|
moreRef,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div ref={containerRef}>
|
ui: the navbar measures its foreground instead of assuming one
The bar's background is the one surface a user picks -- twelve colour names,
which each theme resolves to twelve of its own colours. Forty-eight
backgrounds, and the links and status icons were drawn on all of them in a
single token, `--btn-text`, which is near-black in three of the four themes.
Night's `--brown` is #451212. A near-black glyph on it is 1.33:1. Nine of
night's twelve colours and seven of amber's sat below 4.5:1, and twelve of the
forty-eight below 3:1 -- icons the same colour as the bar behind them.
So the foreground is measured against the background the theme actually
resolved, choosing between that theme's own `--btn-text`, `--black` and
`--white`. Its own, not literal ones: a white pixel in night mode undoes the
dark adaptation the theme exists to protect, so night's "white" is #ff8a8a.
Measuring at runtime rather than shipping an `--on-red` token per colour also
means the custom YAML themes still ahead get this for free.
Nothing is below 3:1 any more and the worst case is 3.27:1, up from 1.33:1.
No combination is worse than it was.
Ten of the forty-eight are still under 4.5:1 and no foreground will lift them:
a monochrome theme resolves all twelve names onto one ramp, and a mid-tone of a
hue cannot carry text of that same hue. That shortfall is in the palette, so
/theme-sample now draws all twelve bars with the measured ratio printed beside
each one, calling out the ten -- it is a decision to make while looking at them.
The WCAG primitives move to themes/contrast so theme code can measure a colour
without importing Common.js, which pulls in half the component library.
Common.js forwards `contrastRatio` with a delegating function rather than a bare
re-export: six specs mock it with `{...jest.requireActual('./Common')}`, the
spread invokes every getter, and those spreads run re-entrantly while the module
is still evaluating -- a re-export getter fires before its import binding exists
and takes the whole suite down.
Tested: navColors.test.js measures all forty-eight against the palette parsed
out of tokens.css, and holds Nav.js to the call by source since neither bar is
reachable from a test that could measure it. ui-layout.cy.js measures the
painted result in a real browser in all four themes and holds it against the
number the component reports. Reverting to the fixed foreground reddens four
jest cases and three cypress ones.
1115 jest / 62 suites, 177 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:07:19 -06:00
|
|
|
<nav className='wrolpi-navbar' id='global_navbar' style={navBarStyle(navColors)}>
|
2026-04-09 16:01:59 -06:00
|
|
|
<span ref={homeRef} style={{display: 'contents'}}>{homeLink}</span>
|
|
|
|
|
{(isReady ? visibleLinks : allLinks).map((link, idx) => (
|
|
|
|
|
<span
|
|
|
|
|
key={link.key}
|
|
|
|
|
ref={itemRefCallback(idx)}
|
2026-04-10 15:27:15 -06:00
|
|
|
style={isReady ? {display: 'contents'} : {visibility: 'hidden', flexShrink: 0}}
|
2026-04-09 16:01:59 -06:00
|
|
|
>
|
|
|
|
|
<MenuLink link={link}/>
|
|
|
|
|
</span>
|
|
|
|
|
))}
|
2026-04-10 15:27:15 -06:00
|
|
|
{!isReady && <span ref={moreRef} style={{visibility: 'hidden', flexShrink: 0}}>
|
ui: the navbar corner was nudged rather than laid out, and it showed
Three faults in the bar, all reproduced by measurement before being fixed.
The indicators sat low. The slot carried `marginTop: 0.8em`, a nudge left over
from Semantic's menu; the corner centres its children, and a top margin is part
of the margin box being centred, so it applied as a ~6px downward shift. It
read as an error on the hotspot and the theme picker but not on share or search,
which is why it survived: an IconButton is a square ActionIcon that centres its
glyph exactly, while a bare-icon anchor sits high inside a line box that
reserves descender space for text that is not there. The nudge cancelled that
out on one shape and was pure error on the other. Both are laid out now --
flex, centred, no nudge -- and the anchors get `display: flex` so they hug their
glyph instead of a text line.
Help and Admin highlighted only a box around their text while Videos and
Statistics highlighted the full height. Same class, same rules, different
parent: the bar stretches its children, but the corner is a nested flex
container that centres its own, so a link inside it was sized to its content.
The hover background is painted on the link box, so that box IS the affordance.
The bar broke onto a second line at certain widths. Two measurement errors that
only overlap in a narrow band, which is why it appeared while resizing rather
than always. useOverflowNav measured the WRAPPER's offsetWidth and subtracted
only the home link and the corner, missing the bar's own `padding: 0 0.25em` --
about 8px it believed it had. And the hidden "More" placeholder it measured was
a plain button with no dropdown caret, about 21px narrower than the button that
eventually rendered. The placeholder is now the same component as the real
trigger, so the two cannot drift again.
Tested in ui-layout.cy.js against the real <DesktopNav/>, which takes its
colours, home link and indicators as props and so needs none of NavBar's polling
hooks. Indicator centres are measured against the bar's centre rather than each
other, because three things can be equally and consistently wrong and were. The
wrap case sweeps 1180px down to 640px in 6px steps -- a spot check steps over a
band that narrow. All three failed first: share 3.4px high, Help 24.8px against
a 54.4px bar, and two rows at 1156px.
Confirmed on the running app: every indicator at 0.0px from the bar's centre,
Help and Admin at the full 54.4px, and no wrap anywhere from 1500px to 780px.
1115 jest / 62 suites, 182 in ui-layout.cy.js, clean npm run build.
2026-08-02 14:25:04 -06:00
|
|
|
<NavDropdownTrigger text='More'/>
|
2026-04-09 16:01:59 -06:00
|
|
|
</span>}
|
|
|
|
|
{isReady && overflowLinks.length > 0 &&
|
|
|
|
|
<DropdownLinks link={{text: 'More', key: 'more', links: overflowLinks}}/>}
|
2026-07-30 13:15:43 -06:00
|
|
|
<div ref={rightMenuRef} className='wrolpi-navbar-right'>
|
2023-01-07 18:31:39 -07:00
|
|
|
{icons}
|
2024-12-18 16:39:50 -07:00
|
|
|
<SearchIconButton/>
|
2023-01-07 18:31:39 -07:00
|
|
|
{rightLinks.map(i => <MenuLink link={i} key={i.key}/>)}
|
2026-04-09 16:01:59 -06:00
|
|
|
</div>
|
2026-07-30 13:15:43 -06:00
|
|
|
</nav>
|
2026-04-09 16:01:59 -06:00
|
|
|
</div>
|
|
|
|
|
);
|
2021-11-01 16:42:52 -06:00
|
|
|
}
|