Fix the mode-choice redundancy: standardized names, deep links, compact switch
Terminology (lib/i18n-dict.ts) - One name per mode everywhere: "Study Deck" / "Studijní balíček" and "Homework Solver" / "Řešitel úkolů". The library empty-state cards and the /create switcher now read the same, so the choice no longer changes name between screens. Deep links - Library quick actions carry the mode: /create?mode=deck and /homework?mode=homework. - Both pages canonicalize: /create?mode=homework redirects to the homework flow and /homework?mode=deck redirects to /create, so a mode link always opens that mode directly. /create - The two bulky square cards (106px tall, wrapping/clipping "Study Deck & Qu…" on phones) are replaced by a compact segmented control (52px) placed directly above "1. Add your notes": ice pill, snowflake/sparkles icons, 44px segments and one-line labels at 360px. The pill slides to the chosen segment and the route follows ~190ms later, so toggling reads as one smooth transition (immediate under prefers-reduced-motion). Service worker: freezmo-v9. Verified: mode-switch suite 26/26 (deep links, cross-mode redirects, 52px control, 44px segments, no clipping/wrapping at 360px, "1. Add your notes" at y=394 of 740 with the upload controls above the fold, pill slide, axe contrast, en+cs, phone+desktop), mobile 49/49, i18n 27/27, desktop regression 73/73. Lint + build clean.
This commit is contained in:
parent
22af888ec0
commit
461dd2ffcf
7 changed files with 118 additions and 46 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import { redirect } from "next/navigation";
|
||||
|
||||
import { ApiKeyGate } from "@/components/ApiKeyGate";
|
||||
import { AppHeader } from "@/components/AppHeader";
|
||||
import { HomeworkScreen } from "@/components/homework/HomeworkScreen";
|
||||
|
|
@ -8,7 +10,16 @@ export const metadata = {
|
|||
title: "Make my homework",
|
||||
};
|
||||
|
||||
export default function HomeworkPage() {
|
||||
export default async function HomeworkPage({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
|
||||
}) {
|
||||
const { mode } = await searchParams;
|
||||
// The mode switch and the library quick actions deep-link into a mode; a
|
||||
// link that points at the Study Deck side is handed back to /create.
|
||||
if (mode === "deck") redirect("/create?mode=deck");
|
||||
|
||||
return (
|
||||
<ApiKeyGate>
|
||||
<div className="flex min-h-dvh">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue