mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
feat(topics): add the Topics preview area, its navigation entry and its switch
/topics shows a tile per topic the record holds data for, and names the empty topics and the module-hidden ones once each. /topics/<topic> shows the topic today, its signals side by side over 7, 30, 90 days or a year against their usual range, how they move together, their trends, its blocks, the single-metric pages behind it and what it is missing. Every topic links into the metric pages, which stay as they are, and each page ends on a neutral note that this is a preview. Settings > System > Preview features is listed again and switches the area on for the person reading. While it is on, the sidebar carries a Topics entry with a Beta badge directly below Insights and the phone's More sheet leads with a Topics tile; the bottom bar does not change. The pages leave for Insights when the switch is off. The charts load through the shared chart runtime. The sidebar rows move into their own module and the More sheet tile into its own component, so neither shell file grows; the lab trend wording is shared between the marker page and the metabolism topic. Copy in all nine locales.
This commit is contained in:
1 parent
cc04e0944d
commit
c68e833dcc
64 files changed
+4319
-219
No files matched your search
@@ -0,0 +1,14 @@
|
||||
"use client";
|
||||
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import type { PreviewFeatures } from "@/lib/settings/preview-features";
|
||||
|
||||
/**
|
||||
* The person's own preview opt-ins, off the cached account payload, or null
|
||||
* while it has not answered. Every reader treats null as "off": a preview
|
||||
* appears only once the server has said yes, never on a guess.
|
||||
*/
|
||||
export function usePreviewFeatures(): PreviewFeatures | null {
|
||||
const { user } = useAuth();
|
||||
return user?.previewFeatures ?? null;
|
||||
}
|
||||
Reference in new issue
Block a user