Merge branch 'release/v1.46.0' into feat/v146-questionnaires

# Conflicts:
#	src/__tests__/baselines/source-file-lines.json
#	src/__tests__/baselines/source-function-lines.json
This commit is contained in:
Marc-André Bombeck committed 2026-10-23 10:20:34 +02:00
commit 9de64cae3e
102 files changed
+8731 -260

No files matched your search

+14
View File
@@ -24,6 +24,10 @@ import { storeTimezone } from "@/lib/timezone-mirror";
import type { ModuleKey } from "@/lib/modules/registry";
import type { AiCapabilities } from "@/lib/ai/capabilities/types";
import type { CoachReasoningState } from "@/lib/ai/reasoning/resolve";
import {
resolvePreviewFeatures,
type PreviewFeatures,
} from "@/lib/settings/preview-features";
import type { ModuleAccessState } from "@/lib/sharing/module-disclosure";
import type { OnboardingStateDto } from "@/lib/onboarding/needs";
import type { TourProgress } from "@/lib/onboarding/tour-progress";
@@ -254,6 +258,14 @@ export interface AuthUser {
* server image that does not publish it.
*/
coachReasoning?: CoachReasoningState | null;
/**
* The person's own preview opt-ins, resolved on the server: every
* flag present, off unless switched on in Settings > System > Preview
* features. Read through `usePreviewFeature`. Optional so existing
* fixtures stay valid; `fetchMe` coerces an absent block (an older server)
* to every flag off.
*/
previewFeatures?: PreviewFeatures;
/**
* v1.36.0 — account sharing, resolved server-side. `accounts` is the
* switcher's menu, `active` is the record this browser is inside (null when
@@ -477,6 +489,8 @@ export async function fetchMe(): Promise<AuthUser> {
data.coachReasoning && typeof data.coachReasoning === "object"
? data.coachReasoning
: null,
// An older server publishes no opt-ins; every preview stays off.
previewFeatures: resolvePreviewFeatures(data.previewFeatures),
accountAccess,
accountAccessStatus,
};
+14
View File
@@ -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;
}