mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
chore(targets): deprecate the targets page and drop it from the menu
Target editing now lives inline on the insights pages, so the standalone targets page is no longer a navigation destination. Remove its sidebar and bottom-nav (overflow) entries and add a top deprecation banner that points the user at the insights pages and notes the page will be removed in a future release. The page stays routable: the /zielwerte to /targets redirect remains and the route still renders. Removal later is UI-only because the insights panel consumes the same targets read and threshold-override write. New deprecation strings land across all six locales.
This commit is contained in:
1 parent
c72715bb62
commit
cd1eaa1a4e
13 files changed
+185
-12
No files matched your search
@@ -5,9 +5,12 @@
|
||||
* - exactly five primary links + one "More" button render in the strip
|
||||
* - the More button is keyboard-reachable as a `<button>` with
|
||||
* `aria-haspopup="dialog"`
|
||||
* - Targets + Achievements live in the More sheet (closed by default
|
||||
* under SSR), not in the always-visible strip
|
||||
* - Achievements lives in the More sheet (closed by default under SSR),
|
||||
* not in the always-visible strip
|
||||
* - WCAG 2.5.5 floor: every entry is `min-h-11 min-w-11`
|
||||
*
|
||||
* v1.8.6 — the Targets (Zielwerte) page is deprecated and dropped from
|
||||
* the menu, so it no longer appears in the strip or the overflow set.
|
||||
*/
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
@@ -60,6 +63,15 @@ describe("<BottomNav> 5+More layout", () => {
|
||||
expect(matches.length).toBeGreaterThanOrEqual(6);
|
||||
});
|
||||
|
||||
it("no longer lists the deprecated /targets entry (v1.8.6)", () => {
|
||||
// Targets was dropped from the OVERFLOW set; the strip never carried
|
||||
// it. The closed-sheet SSR render must therefore contain no /targets
|
||||
// link — a regression net against the entry creeping back into the
|
||||
// primary strip or the overflow set.
|
||||
const html = render();
|
||||
expect(html).not.toContain('href="/targets"');
|
||||
});
|
||||
|
||||
it("More button carries an accessible label", () => {
|
||||
const html = render();
|
||||
// Attribute order isn't guaranteed by React's renderer, so match
|
||||
|
||||
@@ -84,6 +84,18 @@ describe("<SidebarNav> bug-report toggle", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("<SidebarNav> targets deprecation (v1.8.6)", () => {
|
||||
it("no longer renders the deprecated /targets entry", () => {
|
||||
// The Targets (Zielwerte) page is deprecated; target editing moved
|
||||
// inline into Insights, so the sidebar drops the entry. The main nav
|
||||
// links render into the SSR markup, so asserting absence here is a
|
||||
// real regression net (Insights, the sibling that stays, still shows).
|
||||
const html = render();
|
||||
expect(html).not.toContain('href="/targets"');
|
||||
expect(html).toContain('href="/insights"');
|
||||
});
|
||||
});
|
||||
|
||||
describe("<SidebarNav> admin entry mirrors Settings (no sub-item expansion)", () => {
|
||||
// v1.4.16 A1: the maintainer reported the global sidebar expanding admin
|
||||
// sub-items on `/admin/*` was unwanted UX — the in-shell `<AdminShell>`
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
Lightbulb,
|
||||
MoreHorizontal,
|
||||
Pill,
|
||||
Target,
|
||||
Trophy,
|
||||
Waves,
|
||||
} from "lucide-react";
|
||||
@@ -35,10 +34,15 @@ interface NavLink {
|
||||
// just-pass on iPhone-13-mini-class screens. The mobile audit
|
||||
// recommended 5+More — so the four most-used surfaces stay in the
|
||||
// strip (Home, Measurements, Mood, Medications) plus Insights as
|
||||
// the fifth, and Targets + Achievements move into a "More" sheet.
|
||||
// the fifth, and Achievements moves into a "More" sheet.
|
||||
//
|
||||
// Order is preserved relative to the v1.4.15 bottom-nav so muscle
|
||||
// memory keeps working for the four core actions.
|
||||
//
|
||||
// v1.8.6 — the Targets (Zielwerte) page is deprecated: target editing
|
||||
// moved inline into Insights, so its overflow entry is gone. The page
|
||||
// stays routable (the `/zielwerte`→`/targets` proxy redirect remains)
|
||||
// but no longer appears in the menu.
|
||||
const PRIMARY: ReadonlyArray<NavLink> = [
|
||||
{ href: "/", tKey: "nav.dashboard", icon: Home },
|
||||
{ href: "/measurements", tKey: "nav.measurements", icon: Activity },
|
||||
@@ -48,7 +52,6 @@ const PRIMARY: ReadonlyArray<NavLink> = [
|
||||
];
|
||||
|
||||
const OVERFLOW: ReadonlyArray<NavLink> = [
|
||||
{ href: "/targets", tKey: "nav.targets", icon: Target },
|
||||
{ href: "/achievements", tKey: "nav.achievements", icon: Trophy },
|
||||
];
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
Settings,
|
||||
Shield,
|
||||
Sun,
|
||||
Target,
|
||||
Trophy,
|
||||
Waves,
|
||||
} from "lucide-react";
|
||||
@@ -73,12 +72,6 @@ const navItems = [
|
||||
icon: Lightbulb,
|
||||
tourId: "nav-insights",
|
||||
},
|
||||
{
|
||||
href: "/targets",
|
||||
tKey: "nav.targets",
|
||||
icon: Target,
|
||||
tourId: "nav-targets",
|
||||
},
|
||||
{
|
||||
href: "/achievements",
|
||||
tKey: "nav.achievements",
|
||||
|
||||
Reference in new issue
Block a user