mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 04:50:59 +00:00
refactor(ui): correct stale comments and steady the settings-nav spacer
Drop the overstated claim that the due-reminder green button mirrors the medication card (the med take button is always the default tone), fix the module-tour anchor attribute named in a doc comment, and feed the active section title into the settings nav spacer so its heading line wraps the same way a long localized title does.
This commit is contained in:
1 parent
3ec9aca798
commit
22f588b34d
3 files changed
+20
-5
No files matched your search
@@ -9,7 +9,7 @@
|
||||
* opens the spotlight narrowed to that single module card on the
|
||||
* current page (no cross-page navigation, no completion flip).
|
||||
*
|
||||
* Anchors to the page's `data-tour="<…>-hero"` element via the launcher
|
||||
* Anchors to the page's `data-tour-id="<…>-hero"` element via the launcher
|
||||
* → overlay path. The button itself carries no anchor — it only fires
|
||||
* the event.
|
||||
*/
|
||||
|
||||
@@ -14,11 +14,18 @@
|
||||
*
|
||||
* It is only rendered on `md+` (the desktop sticky sidebar); the mobile chip
|
||||
* strip has no heading-to-align-with.
|
||||
*
|
||||
* v1.18.6 (L11) — pass the active section's resolved `title` so the h1 line
|
||||
* wraps identically when a locale's title runs to two lines, rather than
|
||||
* reserving a single ` ` line. The subtitle copy lives per-page in the
|
||||
* section frame and is not threaded up here, so the spacer reserves one
|
||||
* subtitle line; a subtitle that wraps to two lines in a given locale is the
|
||||
* residual known limitation the original comment called out.
|
||||
*/
|
||||
export function SectionNavHeadingSpacer() {
|
||||
export function SectionNavHeadingSpacer({ title }: { title?: string }) {
|
||||
return (
|
||||
<div aria-hidden="true" className="invisible mb-6 select-none">
|
||||
<h1 className="text-2xl font-bold tracking-tight"> </h1>
|
||||
<h1 className="text-2xl font-bold tracking-tight">{title || " "}</h1>
|
||||
<p className="text-muted-foreground text-sm"> </p>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -262,6 +262,9 @@ export function SettingsShell({ active, children }: SettingsShellProps) {
|
||||
const visibleSections = SETTINGS_SECTIONS.filter(
|
||||
(section) => !section.moduleGate || modules?.[section.moduleGate] !== false,
|
||||
);
|
||||
const activeSection = visibleSections.find(
|
||||
(section) => section.slug === activeSlug,
|
||||
);
|
||||
|
||||
// v1.4.33 IW4 — keep the active chip in view inside the horizontal
|
||||
// mobile strip. On a 393 CSS px viewport the strip is wider than the
|
||||
@@ -360,8 +363,13 @@ export function SettingsShell({ active, children }: SettingsShellProps) {
|
||||
<div className="sticky top-20">
|
||||
{/* v1.18.6 (W9) — push the first nav item down to the top of the
|
||||
first card (level with the page heading's following gap), so
|
||||
the menu reads symmetric with the content column. */}
|
||||
<SectionNavHeadingSpacer />
|
||||
the menu reads symmetric with the content column. Feed the
|
||||
active title so the spacer's h1 wraps the same way (L11). */}
|
||||
<SectionNavHeadingSpacer
|
||||
title={
|
||||
activeSection ? t(activeSection.titleKey) : undefined
|
||||
}
|
||||
/>
|
||||
<ul className="space-y-1">
|
||||
{visibleSections.map((section) => {
|
||||
const isActive = section.slug === activeSlug;
|
||||
|
||||
Reference in new issue
Block a user