mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
refactor(nav): drop Workouts from the left nav (already an Insights tab)
Workouts already surfaces as an Insights tab-strip pill (the workouts slug, gated on a logged workout row), so a parallel left-nav home was redundant. Removing it from NAV_DESTINATIONS lets the Insights nav home read active on /insights/workouts like any other /insights/* sub-route.
This commit is contained in:
1 parent
640793a3e8
commit
f0a030f1ce
4 files changed
+22
-25
No files matched your search
@@ -7,8 +7,9 @@
|
||||
* `aria-haspopup="dialog"`), not a navigation link
|
||||
* - the More button opens a hub (closed by default under SSR)
|
||||
* - the More hub is a real hub: Measurements + Mood (which left the
|
||||
* always-visible strip) stay reachable here, alongside Workouts,
|
||||
* Achievements, Notifications and Settings — nothing is orphaned
|
||||
* always-visible strip) stay reachable here, alongside Achievements,
|
||||
* Notifications and Settings — nothing is orphaned (v1.18.0 — Workouts
|
||||
* and Recovery left the nav for their Insights pills)
|
||||
* - WCAG 2.5.5 floor: every strip entry is `min-h-11 min-w-11`
|
||||
*
|
||||
* v1.8.6 — the Targets (Zielwerte) page is deprecated and dropped from
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
*
|
||||
* Pins the coherence contract the desktop sidebar and the mobile
|
||||
* bottom-nav both consume: one ordered destination list (so the two bars
|
||||
* tell one story), Workouts AND Coach as first-class destinations on both
|
||||
* tell one story), the Coach as a first-class destination on both
|
||||
* surfaces, cycle gated by the account flag, and an active-resolver that
|
||||
* prefers the most-specific sibling under `/insights`.
|
||||
* prefers the most-specific sibling under `/insights`. (v1.18.0 —
|
||||
* Workouts and Recovery left the left nav for their Insights pills.)
|
||||
*/
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
@@ -182,12 +183,13 @@ describe("isNavDestinationActive most-specific resolution", () => {
|
||||
expect(isNavDestinationActive("/insights", "/coach")).toBe(false);
|
||||
});
|
||||
|
||||
it("does not light up Insights when on its Workouts sibling", () => {
|
||||
expect(
|
||||
isNavDestinationActive("/insights/workouts", "/insights/workouts"),
|
||||
).toBe(true);
|
||||
it("lights up Insights on its Workouts sub-route (no longer a separate nav home)", () => {
|
||||
// v1.18.0 — Workouts left the left nav for its Insights pill, so it is
|
||||
// no longer a more-specific NAV_DESTINATIONS sibling. The Insights nav
|
||||
// home now reads active on `/insights/workouts`, like any other
|
||||
// `/insights/*` sub-route.
|
||||
expect(isNavDestinationActive("/insights", "/insights/workouts")).toBe(
|
||||
false,
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -133,15 +133,15 @@ describe("<SidebarNav> targets deprecation (v1.8.6)", () => {
|
||||
});
|
||||
|
||||
describe("<SidebarNav> unified destination model (v1.17.1 F-1 / F-3)", () => {
|
||||
it("surfaces Workouts and the Coach as first-class sidebar destinations", () => {
|
||||
// Pre-unify the sidebar hid Workouts entirely and had no Coach home,
|
||||
// while the mobile bar promoted Workouts and still missed Coach. Both
|
||||
// now render the one shared model, so both carry both destinations.
|
||||
it("surfaces the Coach as a first-class sidebar destination", () => {
|
||||
// Pre-unify the sidebar had no Coach home while the mobile bar missed
|
||||
// it too; both now render the one shared model so both carry it.
|
||||
// (v1.18.0 — Workouts left the left nav for its Insights pill, so it is
|
||||
// no longer a sidebar destination.)
|
||||
const html = render();
|
||||
expect(html).toContain('href="/insights/workouts"');
|
||||
expect(html).toContain('href="/coach"');
|
||||
expect(html).toContain("Workouts");
|
||||
expect(html).toContain("Coach");
|
||||
expect(html).not.toContain('href="/insights/workouts"');
|
||||
});
|
||||
|
||||
it("marks Coach active without also marking Insights active", () => {
|
||||
|
||||
@@ -3,7 +3,6 @@ import {
|
||||
Bell,
|
||||
Bug,
|
||||
Droplets,
|
||||
Dumbbell,
|
||||
FlaskConical,
|
||||
Home,
|
||||
Lightbulb,
|
||||
@@ -92,15 +91,10 @@ export const NAV_DESTINATIONS: ReadonlyArray<NavDestination> = [
|
||||
icon: Stethoscope,
|
||||
tourId: "nav-vorsorge",
|
||||
},
|
||||
{
|
||||
href: "/insights/workouts",
|
||||
tKey: "nav.workouts",
|
||||
icon: Dumbbell,
|
||||
tourId: "nav-workouts",
|
||||
},
|
||||
// v1.18.0 — Recovery left the left-nav: it surfaces as an Insights pill
|
||||
// (`/insights/recovery`) rather than a top-level destination, so it no
|
||||
// longer appears in `NAV_DESTINATIONS`.
|
||||
// v1.18.0 — Workouts and Recovery both left the left-nav: each already
|
||||
// surfaces as an Insights tab-strip pill (`/insights/workouts` gated on
|
||||
// a workout row, `/insights/recovery` always present), so neither is a
|
||||
// top-level `NAV_DESTINATIONS` entry any more.
|
||||
{
|
||||
href: "/insights",
|
||||
tKey: "nav.insights",
|
||||
|
||||
Reference in new issue
Block a user