+ {/* Only the body scrolls; header + footer stay pinned so the
+ Acknowledge / Cancel CTAs are always reachable without
+ scrolling on small viewports (the previous markup scrolled
+ the entire DialogContent, pushing the footer below the
+ fold on iPhone-class heights). */}
+
= [
},
];
-export function goalsStorageKey(userId: string): string {
- return `${ONBOARDING_GOALS_STORAGE_PREFIX}:${userId}`;
-}
-
-function readGoalsFromStorage(
- storageKey: string,
-): Set {
- if (typeof window === "undefined") return new Set();
- try {
- const raw = window.localStorage.getItem(storageKey);
- if (!raw) return new Set();
- const parsed = JSON.parse(raw) as unknown;
- if (!Array.isArray(parsed)) return new Set();
- const allowed = new Set(GOAL_OPTIONS.map((o) => o.slug));
- const out = new Set();
- for (const v of parsed) {
- if (typeof v === "string" && allowed.has(v)) {
- out.add(v as OnboardingGoalSlug);
- }
- }
- return out;
- } catch {
- /* corrupt entry — ignore */
- return new Set();
- }
-}
-
export interface GoalsChipPickerProps {
/**
* The current user's id. Threaded in from the server step page
- * (`getSession().user.id`) so the localStorage hydration can run
- * synchronously in the state initializer and avoid the
- * `react-hooks/set-state-in-effect` cascading-render anti-pattern.
+ * (`getSession().user.id`) so the v1.4.26 column write can reuse
+ * the same call site without a prop reshuffle.
*/
userId: string;
}
-export function GoalsChipPicker({ userId }: GoalsChipPickerProps) {
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+export function GoalsChipPicker({ userId: _userId }: GoalsChipPickerProps) {
const { t } = useTranslations();
const router = useRouter();
const queryClient = useQueryClient();
- const storageKey = goalsStorageKey(userId);
-
- const [selected, setSelected] = useState>(() =>
- readGoalsFromStorage(storageKey),
+ const [selected, setSelected] = useState>(
+ () => new Set(),
);
const [advancing, setAdvancing] = useState(false);
@@ -149,20 +117,6 @@ export function GoalsChipPicker({ userId }: GoalsChipPickerProps) {
});
}, []);
- // Persist on every change. localStorage is cheap and the goal set is
- // tiny — no need for a debounced effect here.
- useEffect(() => {
- if (typeof window === "undefined") return;
- try {
- window.localStorage.setItem(
- storageKey,
- JSON.stringify(Array.from(selected)),
- );
- } catch {
- /* quota or disabled — best-effort */
- }
- }, [storageKey, selected]);
-
async function advance() {
if (advancing) return;
setAdvancing(true);