mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
refactor(settings): merge Sources into Thresholds as "Targets & Sources"
The two former settings sections (`/settings/thresholds` and
`/settings/sources`) covered the same conceptual shelf — per-metric
configuration. Reading them together matches how users actually
think about each metric ("for this metric, which sources do I trust
AND what range counts as healthy?") and collapses two adjacent
sidebar slots into one.
`<ThresholdsSection>` now hosts both editors stacked under one page
header: the per-metric threshold ranges on top, the per-metric source
priority + two-axis device-type ladder below. The two mutation flows
(`/api/user/thresholds` and `/api/auth/me/source-priority`) stay
distinct so a save on one half never disturbs the other.
`<SourcesSection>` gained a `mode` prop. The default `"standalone"`
behaviour is preserved for any caller that still mounts it directly;
the new `"embedded"` mode drops the inner header so the assistive-tech
reading order stays one combined surface, not two.
The `sources` slug was dropped from `SETTINGS_SECTION_SLUGS` (down to
ten sections), and the Sources entry was removed from the in-shell
sidebar + mobile chip-strip. `/settings/sources` stays alive as a
`permanentRedirect` to `/settings/thresholds`, so external bookmarks
(iOS Settings deep-links, docs, anything that linked the URL) follow
through unchanged.
Tests updated: `SETTINGS_SECTION_SLUGS` size assertion drops from
eleven to ten; `<ThresholdsSection>` mount test now expects both
editor mount-points; the section title moves from "Personal
thresholds" / "Persönliche Zielwerte" to "Targets & Sources" /
"Zielwerte & Quellen".
Per `.planning/research/v1434-r-2-carryover-scope.md` §7 and
`.planning/round-v1433-audit-menu.md` §7.1 (item 3).
This commit is contained in:
1 parent
1413bc39c7
commit
fd81d3b806
9 files changed
+167
-51
No files matched your search
@@ -11,7 +11,10 @@ import { ExportSection } from "@/components/settings/export-section";
|
||||
import { IntegrationsSection } from "@/components/settings/integrations-section";
|
||||
import { NotificationsSection } from "@/components/settings/notifications-section";
|
||||
import { SectionPlaceholder } from "@/components/settings/section-placeholder";
|
||||
import { SourcesSection } from "@/components/settings/sources-section";
|
||||
// v1.4.34 IW-D — `sources` slug was retired (merged into `thresholds`).
|
||||
// The combined "Targets & Sources" component lives in
|
||||
// `thresholds-section.tsx`; `/settings/sources` is now a
|
||||
// `permanentRedirect` handled by the dedicated route file.
|
||||
import { ThresholdsSection } from "@/components/settings/thresholds-section";
|
||||
import {
|
||||
SETTINGS_SECTION_SLUGS,
|
||||
@@ -46,7 +49,6 @@ const SECTION_COMPONENTS: Record<
|
||||
notifications: NotificationsSection,
|
||||
dashboard: DashboardSection,
|
||||
thresholds: ThresholdsSection,
|
||||
sources: SourcesSection,
|
||||
api: ApiSection,
|
||||
export: ExportSection,
|
||||
advanced: AdvancedSection,
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import { permanentRedirect } from "next/navigation";
|
||||
|
||||
/**
|
||||
* v1.4.34 IW-D — `/settings/sources` permanent redirect.
|
||||
*
|
||||
* The Sources settings section was merged into `/settings/thresholds`
|
||||
* (now titled "Targets & Sources" / "Zielwerte & Quellen"). The two
|
||||
* editors share the same per-metric configuration shelf and reading
|
||||
* them side-by-side on one page matches how a user actually thinks
|
||||
* about metric configuration ("for this metric, which sources do I
|
||||
* trust AND what range counts as healthy?"). Per
|
||||
* `.planning/research/v1434-r-2-carryover-scope.md` §7 and
|
||||
* `.planning/round-v1433-audit-menu.md` §7.1 (item 3).
|
||||
*
|
||||
* 308 (`permanentRedirect`) keeps the request method intact so any
|
||||
* external system that POSTs (none today, but cheap insurance) follows
|
||||
* through with its original method. Existing bookmarks, iOS Settings
|
||||
* deep-links, and any docs that referenced `/settings/sources`
|
||||
* continue to resolve.
|
||||
*/
|
||||
export default function SettingsSourcesRedirect(): never {
|
||||
permanentRedirect("/settings/thresholds");
|
||||
}
|
||||
Reference in new issue
Block a user