From f956ab07f3608987148d002ba5ef5c938321cc40 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 24 Oct 2026 13:54:49 +0200 Subject: [PATCH] fix(studio): tidy the head row, the layouts tab and the theme panel Every piece of the head row is one raised tile of one height: the format picker moved beside the tools, the assistant and help stand alone, the close button is square like the rest, and the beta mark is gone. The layouts tab lays the book's own and the built-in layouts out in sections and in the same grid as the designed pages. In the theme panel the accent dots sit in the sheet's corner, the three accents share one name, a font keeps its name ahead of its kind, a doubled rule is gone, and the inspector's empty hint is shorter. --- client/scripts/eslint-baseline.json | 2 +- .../Studio/StudioAssistantPanel.tsx | 6 +- .../components/Studio/StudioHeader.test.tsx | 2 +- client/src/components/Studio/StudioHeader.tsx | 39 +++--- .../components/Studio/StudioSavedLayouts.tsx | 5 +- .../Studio/templates/StudioTemplatesPanel.tsx | 11 +- .../Studio/theme/StudioThemePanel.tsx | 12 +- client/src/styles/studio-assistant.css | 14 +-- client/src/styles/studio-fonts.css | 13 ++ client/src/styles/studio-head.css | 115 ++++++++++-------- client/src/styles/studio-templates.css | 4 + client/src/styles/studio-theme.css | 40 +++++- client/src/styles/studio.css | 22 +--- shared/src/i18n/ar/journey.ts | 3 +- shared/src/i18n/ar/studioThemes.ts | 1 + shared/src/i18n/az/journey.ts | 3 +- shared/src/i18n/az/studioThemes.ts | 1 + shared/src/i18n/br/journey.ts | 3 +- shared/src/i18n/br/studioThemes.ts | 1 + shared/src/i18n/ca/journey.ts | 3 +- shared/src/i18n/ca/studioThemes.ts | 1 + shared/src/i18n/cs/journey.ts | 3 +- shared/src/i18n/cs/studioThemes.ts | 1 + shared/src/i18n/de/journey.ts | 3 +- shared/src/i18n/de/studioThemes.ts | 1 + shared/src/i18n/en/journey.ts | 3 +- shared/src/i18n/en/studioThemes.ts | 1 + shared/src/i18n/es/journey.ts | 3 +- shared/src/i18n/es/studioThemes.ts | 1 + shared/src/i18n/et/journey.ts | 3 +- shared/src/i18n/et/studioThemes.ts | 1 + shared/src/i18n/fr/journey.ts | 3 +- shared/src/i18n/fr/studioThemes.ts | 1 + shared/src/i18n/gr/journey.ts | 3 +- shared/src/i18n/gr/studioThemes.ts | 1 + shared/src/i18n/hu/journey.ts | 3 +- shared/src/i18n/hu/studioThemes.ts | 1 + shared/src/i18n/id/journey.ts | 3 +- shared/src/i18n/id/studioThemes.ts | 1 + shared/src/i18n/it/journey.ts | 3 +- shared/src/i18n/it/studioThemes.ts | 1 + shared/src/i18n/ja/journey.ts | 3 +- shared/src/i18n/ja/studioThemes.ts | 1 + shared/src/i18n/ko/journey.ts | 3 +- shared/src/i18n/ko/studioThemes.ts | 1 + shared/src/i18n/nl/journey.ts | 3 +- shared/src/i18n/nl/studioThemes.ts | 1 + shared/src/i18n/pl/journey.ts | 3 +- shared/src/i18n/pl/studioThemes.ts | 1 + shared/src/i18n/ru/journey.ts | 3 +- shared/src/i18n/ru/studioThemes.ts | 1 + shared/src/i18n/sk/journey.ts | 3 +- shared/src/i18n/sk/studioThemes.ts | 1 + shared/src/i18n/sv/journey.ts | 3 +- shared/src/i18n/sv/studioThemes.ts | 1 + shared/src/i18n/th/journey.ts | 3 +- shared/src/i18n/th/studioThemes.ts | 1 + shared/src/i18n/tr/journey.ts | 3 +- shared/src/i18n/tr/studioThemes.ts | 1 + shared/src/i18n/uk/journey.ts | 3 +- shared/src/i18n/uk/studioThemes.ts | 1 + shared/src/i18n/vi/journey.ts | 3 +- shared/src/i18n/vi/studioThemes.ts | 1 + shared/src/i18n/zh-TW/journey.ts | 3 +- shared/src/i18n/zh-TW/studioThemes.ts | 1 + shared/src/i18n/zh/journey.ts | 3 +- shared/src/i18n/zh/studioThemes.ts | 1 + 67 files changed, 219 insertions(+), 174 deletions(-) diff --git a/client/scripts/eslint-baseline.json b/client/scripts/eslint-baseline.json index 75287f41a..817dfe275 100644 --- a/client/scripts/eslint-baseline.json +++ b/client/scripts/eslint-baseline.json @@ -8,7 +8,7 @@ "trek/no-swallowed-catch": 130, "max-params": 32, "trek/store-without-selector": 67, - "react-hooks/refs": 556, + "react-hooks/refs": 555, "react-hooks/set-state-in-effect": 194, "@typescript-eslint/no-floating-promises": 165, "react-hooks/exhaustive-deps": 116, diff --git a/client/src/components/Studio/StudioAssistantPanel.tsx b/client/src/components/Studio/StudioAssistantPanel.tsx index df1fd0770..134199504 100644 --- a/client/src/components/Studio/StudioAssistantPanel.tsx +++ b/client/src/components/Studio/StudioAssistantPanel.tsx @@ -215,13 +215,13 @@ export function StudioAssistantToggle({ assistant }: { assistant: StudioAssistan return ( ); } diff --git a/client/src/components/Studio/StudioHeader.test.tsx b/client/src/components/Studio/StudioHeader.test.tsx index eb2f79239..003d5a9c4 100644 --- a/client/src/components/Studio/StudioHeader.test.tsx +++ b/client/src/components/Studio/StudioHeader.test.tsx @@ -53,7 +53,7 @@ describe('StudioHeader', () => { it("FE-STUDIO-HEAD-001: names the journey under the Studio's mark, with its cover as the tile", () => { head(); expect(screen.getByRole('heading', { name: 'Japan 2026' })).toBeInTheDocument(); - expect(screen.getByText('journey.studio.beta')).toBeInTheDocument(); + expect(screen.getByRole('img', { name: 'TREK Studio' })).toBeInTheDocument(); expect(document.querySelector('.st-head-tile img')?.getAttribute('src')).toBe('/uploads/cover.jpg'); }); diff --git a/client/src/components/Studio/StudioHeader.tsx b/client/src/components/Studio/StudioHeader.tsx index a3e34b0bc..390d17a6a 100644 --- a/client/src/components/Studio/StudioHeader.tsx +++ b/client/src/components/Studio/StudioHeader.tsx @@ -15,14 +15,15 @@ import type { StudioAssistant } from './useStudioAssistant'; /** * The Studio's head band, in the shape every TREK dialog has: a raised tile on - * the left, a small line above the title, the title, a line under it, and the - * round close button at the far end. + * the left, the Studio's mark above the title, the title, a line under it, and + * the close button at the far end. * * The tile is the journey's cover and the title its name, so it is always clear - * whose book this is. What the book is printed as and whether it is saved sit - * under the title, because they describe it. The tools on the right are grouped - * by what they do: who else is here, editing (undo, redo, paste), making - * (auto layout, the assistant), and getting the book out (help, export). How + * whose book this is. Whether it is saved sits under the title, because it + * describes it. The tools on the right are grouped by what they do: who else + * is here, what the book is printed as, editing (undo, redo, paste), auto + * layout, the assistant, help, and getting the book out. Every piece of + * the row is one raised tile of one height, export alone in the accent. How * the page is looked at, the book view, lives with the zoom under the page. */ export function StudioHeader({ @@ -41,11 +42,9 @@ export function StudioHeader({
- {s.t('journey.studio.beta')}

{s.journey?.title || s.t('journey.title')}

- +
+ +
+
@@ -73,15 +76,15 @@ export function StudioHeader({
- {/* The book's assistant; only where it can run for this user. */} -
+ {/* The book's assistant, a tile of its own like help; only where it can run for this user. */} + {/* Studio has no navbar, so the help center's button rides on its own bar. */} - + {open && ( -
+
{PAGE_PRESET_ORDER.map((id) => { const p = PAGE_PRESETS[id]; const on = id === s.preset; diff --git a/client/src/components/Studio/StudioSavedLayouts.tsx b/client/src/components/Studio/StudioSavedLayouts.tsx index d9c621ba7..b1eab3553 100644 --- a/client/src/components/Studio/StudioSavedLayouts.tsx +++ b/client/src/components/Studio/StudioSavedLayouts.tsx @@ -35,10 +35,10 @@ export function StudioSavedLayouts({ const scale = width / (wMm * pxPerMm) return ( -
+
{t('journey.studio.myLayouts')}
{fitting.length === 0 &&

{t('journey.studio.myLayoutsEmpty')}

} -
+
{fitting.map(layout => (
-
{t('journey.studio.builtInLayouts')}
) } diff --git a/client/src/components/Studio/templates/StudioTemplatesPanel.tsx b/client/src/components/Studio/templates/StudioTemplatesPanel.tsx index 181b7f2a1..0bc8efe71 100644 --- a/client/src/components/Studio/templates/StudioTemplatesPanel.tsx +++ b/client/src/components/Studio/templates/StudioTemplatesPanel.tsx @@ -117,7 +117,7 @@ function BuiltInLayouts({ const scale = width / (page.pageWidth * (single ? 1 : 2) * pxPerMm); const templates = single ? COVER_TEMPLATES : TEMPLATES; return ( -
+
{templates.map((tpl) => (

{t('studio.templates.hint')}

- - + +
+
{t('journey.studio.builtInLayouts')}
+ +
); diff --git a/client/src/components/Studio/theme/StudioThemePanel.tsx b/client/src/components/Studio/theme/StudioThemePanel.tsx index cb7ab5ca5..d997a023f 100644 --- a/client/src/components/Studio/theme/StudioThemePanel.tsx +++ b/client/src/components/Studio/theme/StudioThemePanel.tsx @@ -67,7 +67,11 @@ function ThemeCard({ ); } -/** One palette entry: its colour, which is the picker, and its name. */ +/** + * One palette entry: its colour, which is the picker, and its name. The three + * accents share one name under them, so each shows its colour alone and says + * its own name to a screen reader and on hover. + */ function PaletteEntry({ name, hex, @@ -79,13 +83,14 @@ function PaletteEntry({ onPick: (hex: string) => void; t: StudioT; }) { + const accent = name.startsWith('accent'); const label = t(`studio.theme.token.${name}`); return ( -