DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.
Python ai-agentsai-tutorclawbotcli-tooldeepresearchinteractive-learninglearningmulti-agent-systemsrag
feat: unify page chrome and refine DeepTutor navigation
Bingxi Zhao (Frank)1c735c75ead7
diff --git a/artifacts/dito-preview/dt-exp-page-chrome-home.png b/artifacts/dito-preview/dt-exp-page-chrome-home.pngnew file mode 100644index 000000000..74f9ff23fBinary files /dev/null and b/artifacts/dito-preview/dt-exp-page-chrome-home.png differdiff --git a/artifacts/dito-preview/dt-exp-page-chrome-learning.png b/artifacts/dito-preview/dt-exp-page-chrome-learning.pngnew file mode 100644index 000000000..5518388dcBinary files /dev/null and b/artifacts/dito-preview/dt-exp-page-chrome-learning.png differdiff --git a/artifacts/dito-preview/dt-exp-page-chrome-writer.png b/artifacts/dito-preview/dt-exp-page-chrome-writer.pngnew file mode 100644index 000000000..d3bb44ff2Binary files /dev/null and b/artifacts/dito-preview/dt-exp-page-chrome-writer.png differdiff --git a/artifacts/dito-preview/dt-exp-qa.md b/artifacts/dito-preview/dt-exp-qa.mdindex f174e0e20..e583ce3b5 100644--- a/artifacts/dito-preview/dt-exp-qa.md+++ b/artifacts/dito-preview/dt-exp-qa.md@@ -65,3 +65,13 @@ Model-backed generation, external channels and integrations require their normal- Recent navigation snapshots remain visible during background refresh and are cleared on authentication changes. A regression verifies that an in-flight response cannot restore the previous account cache after invalidation.- Validation: 152 Vitest files / 671 tests and 1,303 Node tests pass. Production build, type checking, i18n, dependency architecture and all existing route budgets pass. Targeted ESLint has no errors (existing logo-alt warnings remain).- Evidence: dt-exp-learning-navigation.png and dt-exp-partner-navigation.png. Test records remain isolated under /tmp/deeptutor-dt-exp-runtime; no production data schema or records were changed.++## Navigation identity and shared page chrome, 2026-10-13++- Added Projects above workspace folders, matching Recent's visual hierarchy. Folder ordering, collapse, move/rename actions and five-row conversation limits remain intact.+- Replaced the expanding, icon-only category pills with four stable, labelled destinations. Active state uses the selected DeepTutor theme color, a quiet tint and an animated position marker. Keyboard navigation, search, collapsed rail and retained category state are unchanged.+- Added shared PageToolbar chrome: 52px minimum height, 20px desktop gutters, compact identity/breadcrumbs on the left and contextual actions on the right. FeaturePage/Settings page headers render their actual actions into a stable slot outside the scrollport, retaining React context and handlers. Secondary section headings stay with their content.+- Applied the toolbar to chat, reading, mastery, writing, partner/group conversations, books, notebooks, knowledge-base details and Whisper. Partner local views now use a separate row. Settings, libraries, task board and other FeaturePage consumers inherit the same frame. Reader/editor pane controls stay local.+- Browser QA: 1280 × 720 desktop and 1280 × 600 with a 220px sidebar. All four category labels fit; partner, group and session sections remain visible. Learning creation opens its original modal; notebook creation opens its original form; existing partner transcript and saved writing document display correctly; Settings retains its sections. Resource-page toolbar stays at y=0 / height=52 while content scrolls. A fresh tab against the final production build has no console errors.+- Validation: 153 Vitest files / 672 tests; 1,303 Node tests; production build/type checking, i18n checks, dependency architecture and existing route budgets pass. Targeted ESLint reports no errors; five pre-existing warnings remain. Regression coverage checks that moved page actions keep their providers/state and unmount cleanly during page changes.+- Evidence: dt-exp-page-chrome-home.png, dt-exp-page-chrome-learning.png, dt-exp-page-chrome-writer.png. Three empty projects were added only to the isolated /tmp runtime to exercise the section heading. No storage format, backend contract or real user records changed.diff --git a/web/app/(workspace)/learning/books/BooksRoute.tsx b/web/app/(workspace)/learning/books/BooksRoute.tsxindex 37ac603c2..9b2ecc07b 100644--- a/web/app/(workspace)/learning/books/BooksRoute.tsx+++ b/web/app/(workspace)/learning/books/BooksRoute.tsx@@ -1,5 +1,6 @@'use client'+import { PageToolbar } from '@/components/layout/PageToolbar'import { Suspense, useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react'import { useParams, useRouter } from 'next/navigation'import { ArrowLeft, Loader2, MessageSquare } from 'lucide-react'@@ -1007,7 +1008,26 @@ function BookPageInner() {? 'opening' : viewreturn (- <div className="flex h-full w-full">+ <div className="flex h-full min-h-0 w-full flex-col">+ {!['list', 'creator'].includes(displayView) && (+ <PageToolbar>+ <div className="dt-toolbar-identity">+ <button type="button" onClick={() => void handleSelectBook(null)} className="inline-flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground">+ <ArrowLeft size={14} />{t('All books')}+ </button>+ <span className="dt-toolbar-separator" aria-hidden>/</span>+ <span className="dt-toolbar-title">{detail?.book.title || pendingBook?.title || t('Books')}</span>+ </div>+ {displayView === 'reader' && (+ <div className="dt-toolbar-actions">+ <button type="button" aria-pressed={chatOpen} onClick={() => setChatOpen(value => !value)} className="inline-flex items-center gap-1.5 px-2 text-xs text-muted-foreground hover:bg-muted hover:text-foreground">+ <MessageSquare size={16} />{t('Chat')}+ </button>+ </div>+ )}+ </PageToolbar>+ )}+ <div className="flex min-h-0 flex-1">{displayView !== 'list' && displayView !== 'creator' && displayView !== 'opening' && (<BookSidebarbook={detail?.book || pendingBook || null}@@ -1222,16 +1242,6 @@ function BookPageInner() {</div></div>- {displayView === 'reader' && !chatOpen && (- <button- onClick={() => setChatOpen(true)}- className="absolute bottom-4 right-4 inline-flex items-center gap-2 rounded-full bg-[var(--primary)] px-4 py-2 text-sm font-medium text-[var(--primary-foreground)] shadow-lg hover:opacity-90"- >- <MessageSquare className="h-4 w-4" />- {t('Chat')}- </button>- )}-{displayView === 'reader' && chatOpen && (<BookChatPanelbook={detail?.book || null}@@ -1243,6 +1253,7 @@ function BookPageInner() {/>)}</main>+ </div></div>)}diff --git a/web/app/(workspace)/learning/books/components/BookCreator.tsx b/web/app/(workspace)/learning/books/components/BookCreator.tsxindex 58d90cd3b..9346196a8 100644--- a/web/app/(workspace)/learning/books/components/BookCreator.tsx+++ b/web/app/(workspace)/learning/books/components/BookCreator.tsx@@ -1,6 +1,6 @@'use client'-import { PageContainer, PageHeader } from '@/components/layout/FeaturePage'+import { FeaturePage, PageHeader } from '@/components/layout/FeaturePage'import { useEffect, useRef, useState, type ReactNode } from 'react'import { ChevronUp, Database, Loader2, Pencil, Sparkles } from 'lucide-react'import { useTranslation } from 'react-i18next'@@ -161,8 +161,7 @@ export default function BookCreator({: []return (- <PageContainer>- {back && <div className="mb-5">{back}</div>}+ <FeaturePage breadcrumb={back}><PageHeader title={t('Create a new book')} description={t('Describe what you want to learn, then pick the knowledge sources to fuse into a structured, interactive book.')} /><div className="space-y-5">@@ -335,7 +334,7 @@ export default function BookCreator({</div>)}</div>- </PageContainer>+ </FeaturePage>)}diff --git a/web/app/(workspace)/learning/mastery/[pathId]/page.tsx b/web/app/(workspace)/learning/mastery/[pathId]/page.tsxindex 5b4336758..5e07f9c1a 100644--- a/web/app/(workspace)/learning/mastery/[pathId]/page.tsx+++ b/web/app/(workspace)/learning/mastery/[pathId]/page.tsx@@ -1,5 +1,6 @@"use client";+import { PageToolbar } from '@/components/layout/PageToolbar'import { PageContainer, PAGE_DESCRIPTION_CLASS } from '@/components/layout/FeaturePage'import { scopedUrl } from "@/lib/workspace-scope";import { MASTERY_HOME, masterySessionRoute as existingMasterySessionRoute, masterySessionsRoute } from "@/lib/learning-routes";@@ -319,8 +320,9 @@ export default function MasteryTopicPage() {// no second column to balance, and a fixed-height stack there would just// be three tiny scrollers.<main className="mastery-shell flex h-full flex-col overflow-y-auto [scrollbar-gutter:stable]">- <PageContainer className="flex min-h-0 flex-1 flex-col pb-40 sm:pb-10">- <div className="flex items-center justify-between gap-3">++ <PageToolbar className="sticky top-0 z-20">+ <div className="dt-toolbar-identity"><Linkhref={scopedUrl(MASTERY_HOME)}className="inline-flex items-center gap-1.5 text-xs font-medium text-[var(--muted-foreground)] hover:text-[var(--foreground)]"@@ -328,7 +330,10 @@ export default function MasteryTopicPage() {<ArrowLeft className="h-3.5 w-3.5" />{t("Learning topics")}</Link>- <div className="flex items-center gap-2">+ <span className="dt-toolbar-separator" aria-hidden>/</span>+ <span className="dt-toolbar-title">{displayName}</span>+ </div>+ <div className="dt-toolbar-actions"><buttontype="button"onClick={(event) => openEditor(event.currentTarget)}@@ -364,8 +369,9 @@ export default function MasteryTopicPage() {</div></details></div>- </div>+ </PageToolbar>+ <PageContainer className="flex min-h-0 flex-1 flex-col pb-40 sm:pb-10"><header className="dt-page-header mt-5 mb-6 flex flex-col gap-4"><div className="min-w-0"><div className="flex items-center gap-3">diff --git a/web/app/(workspace)/partners/[partnerId]/page.tsx b/web/app/(workspace)/partners/[partnerId]/page.tsxindex 6b9292ec9..ceba825ce 100644--- a/web/app/(workspace)/partners/[partnerId]/page.tsx+++ b/web/app/(workspace)/partners/[partnerId]/page.tsx@@ -5,6 +5,7 @@* Header carries identity + run state; everything else lives in the tabs.*/+import { PageToolbar } from '@/components/layout/PageToolbar'import { Suspense, useCallback, useEffect, useMemo, useRef, useState } from "react";import Link from "next/link";import { useParams, useRouter, useSearchParams } from "next/navigation";@@ -501,8 +502,8 @@ function PartnerDetail() {return (<div className="flex h-full flex-col">{/* Header */}- <div className="grid min-h-[64px] grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 border-b border-[var(--border)] px-5 py-3">- <div className="flex min-w-0 items-center gap-3">+ <PageToolbar>+ <div className="dt-toolbar-identity"><Linkhref="/partners"aria-label={t("Back to Partners")}@@ -540,25 +541,9 @@ function PartnerDetail() {</div></div>- <nav className="flex justify-self-center gap-0.5 rounded-lg bg-[var(--muted)] p-0.5">- {tabs.map(({ key, label, icon: Icon }) => (- <button- key={key}- type="button"- onClick={() => setTab(key)}- className={`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] transition-colors ${- activeTab === key- ? "bg-[var(--background)] font-medium text-[var(--foreground)] shadow-sm"- : "text-[var(--muted-foreground)] hover:text-[var(--foreground)]"- }`}- >- <Icon className="h-3.5 w-3.5" />- {label}- </button>- ))}- </nav>- <div className="flex min-w-0 items-center justify-end gap-0.5">++ <div className="dt-toolbar-actions"><Tooltip label={t("Share this conversation across browsers")}><label className="mr-1 inline-flex cursor-pointer items-center gap-1.5 text-[11px] text-[var(--muted-foreground)]"><input@@ -659,7 +644,24 @@ function PartnerDetail() {</>) : null}</div>- </div>+ </PageToolbar>+ <nav className="dt-page-view-tabs">+ {tabs.map(({ key, label, icon: Icon }) => (+ <button+ key={key}+ type="button"+ onClick={() => setTab(key)}+ className={`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-[12px] transition-colors ${+ activeTab === key+ ? "bg-[var(--background)] font-medium text-[var(--foreground)] shadow-sm"+ : "text-[var(--muted-foreground)] hover:text-[var(--foreground)]"+ }`}+ >+ <Icon className="h-3.5 w-3.5" />+ {label}+ </button>+ ))}+ </nav>{showLinkModal ? (<PartnerLinkModaldiff --git a/web/app/(workspace)/partners/groups/[groupId]/page.tsx b/web/app/(workspace)/partners/groups/[groupId]/page.tsxindex 26a069de0..98caa22ff 100644--- a/web/app/(workspace)/partners/groups/[groupId]/page.tsx+++ b/web/app/(workspace)/partners/groups/[groupId]/page.tsx@@ -1,5 +1,6 @@"use client";+import { PageToolbar } from '@/components/layout/PageToolbar'import { useCallback, useEffect, useMemo, useState } from "react";import Link from "next/link";import { useParams, useRouter, useSearchParams } from "next/navigation";@@ -124,7 +125,7 @@ export default function PartnerGroupPage() {return (<div className="flex h-full min-h-0 flex-col">{selectionError && <div role="alert" className="border-b border-border px-6 py-2 text-xs text-destructive">{selectionError}</div>}- <header className="flex shrink-0 items-center justify-between gap-4 border-b border-[var(--border)] px-4 py-3 sm:px-6">+ <PageToolbar><div className="flex min-w-0 items-center gap-3"><Linkhref="/partners"@@ -166,7 +167,7 @@ export default function PartnerGroupPage() {</div></div>- <div className="flex shrink-0 items-center gap-1.5">+ <div className="dt-toolbar-actions">{sessionKey ? (<GroupSessionPickergroupId={groupId}@@ -216,7 +217,7 @@ export default function PartnerGroupPage() {{t("Manage")}</button></div>- </header>+ </PageToolbar><PartnerGroupChatgroup={group}diff --git a/web/app/(workspace)/partners/groups/new/page.tsx b/web/app/(workspace)/partners/groups/new/page.tsxindex 84082a7c6..7ca594f49 100644--- a/web/app/(workspace)/partners/groups/new/page.tsx+++ b/web/app/(workspace)/partners/groups/new/page.tsx@@ -74,14 +74,13 @@ export default function NewPartnerGroupPage() {};return (- <FeaturePage>+ <FeaturePage breadcrumb={<Linkhref="/partners"- className="mb-5 inline-flex items-center gap-1.5 text-[12px] text-[var(--muted-foreground)] transition-colors hover:text-[var(--foreground)]"+ className="inline-flex items-center gap-1.5 text-[12px] text-[var(--muted-foreground)] transition-colors hover:text-[var(--foreground)]"><ArrowLeft size={14} /> {t("Partners")}- </Link>-+ </Link>}><PageHeader title={t("Create a Partner Group")} description={t("Choose at least two Partners, then how they should discuss.")} />{/* A live card of the thing being made: emoji, colour and name only meandiff --git a/web/app/(workspace)/whisper/page.tsx b/web/app/(workspace)/whisper/page.tsxindex 2eeb19230..172df42d0 100644--- a/web/app/(workspace)/whisper/page.tsx+++ b/web/app/(workspace)/whisper/page.tsx@@ -1,5 +1,6 @@"use client";+import { PageToolbar } from '@/components/layout/PageToolbar'import { useCallback, useEffect, useMemo, useRef, useState } from "react";import { useTranslation } from "react-i18next";import { Ear, Loader2 } from "lucide-react";@@ -310,7 +311,7 @@ export default function WhisperPage() {return (<div className="flex h-full min-h-0 flex-col">- <header className="flex flex-wrap items-center justify-between gap-3 border-b border-[var(--border)] px-4 py-3">+ <PageToolbar><div className="min-w-0"><div className="flex items-center gap-2 text-sm font-medium text-[var(--foreground)]"><Ear className="h-4 w-4 text-[var(--primary)]" aria-hidden />@@ -368,7 +369,7 @@ export default function WhisperPage() {</span>)}</div>- </header>+ </PageToolbar>{(crisisHit || roomClosed) && (<divdiff --git a/web/app/globals.css b/web/app/globals.cssindex 4bde67a17..9157b29cb 100644--- a/web/app/globals.css+++ b/web/app/globals.css@@ -1457,21 +1457,23 @@ a[href^="#dt-locator-"]:hover {/* dt-exp: the same application, with four contextual navigation shelves. */.dt-product-sidebar { container-type: inline-size; border-right: 1px solid var(--border); }-.dt-product-sidebar .dt-category-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 10px 10px; flex-shrink: 0; }-.dt-category-bar [role="tablist"] { display: flex; flex: 1; align-items: center; min-width: 0; gap: 1px; }-.dt-category-bar [role="tab"] { position: relative; display: flex; align-items: center; justify-content: center; flex: 1; min-width: 30px; height: 36px; gap: 7px; padding: 0 7px; color: var(--muted-foreground); border-radius: 20px; transition: color 140ms, background-color 140ms; }-.dt-category-bar [role="tab"] > svg, .dt-category-bar [role="tab"] > span:not(.dt-category-pill) { position: relative; z-index: 1; flex-shrink: 0; }-.dt-category-bar [role="tab"] > span:not(.dt-category-pill) { display: none; font-size: 13px; font-weight: 600; white-space: nowrap; }-.dt-category-bar [role="tab"].is-active { flex: 1.9; color: var(--foreground); }-.dt-category-bar [role="tab"].is-active > span:not(.dt-category-pill) { display: inline; }-.dt-category-pill { position: absolute; inset: 0; border-radius: 20px; background: var(--accent); }+/* Stable, labelled destinations with a theme-colored position marker. */+.dt-product-sidebar .dt-category-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 3px 10px 9px; flex-shrink: 0; }+.dt-category-bar [role="tablist"] { display: flex; flex: 1; align-items: center; min-width: 0; gap: 3px; }+.dt-category-tab-wrap { flex: 1; min-width: 0; }+.dt-category-bar [role="tab"] { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-width: 0; height: 54px; gap: 5px; padding: 6px 2px 8px; color: var(--muted-foreground); border-radius: 8px; transition: color 140ms, background-color 140ms; }+.dt-category-label { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11px; line-height: 15px; font-weight: 500; white-space: nowrap; }+.dt-category-bar [role="tab"].is-active { color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); }+.dt-category-bar [role="tab"].is-active .dt-category-label { font-weight: 600; }+.dt-category-indicator { position: absolute; bottom: 0; left: calc(50% - 10px); width: 20px; height: 2px; border-radius: 2px; background: var(--primary); }.dt-category-bar [role="tab"]:not(.is-active):hover, .dt-nav-icon:hover { background: var(--accent); color: var(--foreground); }.dt-nav-icon { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: var(--muted-foreground); transition: background-color 140ms, color 140ms; }.dt-category-bar button:focus-visible, .dt-navigation-row:focus-visible, .dt-nav-icon:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }.dt-product-sidebar .dt-category-bar.is-collapsed { flex-direction: column; padding: 4px; }.dt-category-bar.is-collapsed [role="tablist"] { flex-direction: column; gap: 5px; }-.dt-category-bar.is-collapsed [role="tab"] { width: 38px; height: 38px; flex: none; }-.dt-category-bar.is-collapsed [role="tab"] > span:not(.dt-category-pill) { display: none; }+.dt-category-bar.is-collapsed [role="tab"] { width: 38px; height: 38px; padding: 0; }+.dt-category-bar.is-collapsed .dt-category-label { display: none; }+.dt-category-bar.is-collapsed .dt-category-indicator { top: calc(50% - 8px); bottom: auto; left: 0; width: 2px; height: 16px; }.dt-nav-search { width: 100%; margin-top: 8px; height: 32px; background: var(--background); border: 1px solid var(--border); border-radius: 7px; padding: 0 9px; font-size: 12px; outline: none; }.dt-nav-search:focus { border-color: var(--ring); }.dt-category-content { padding: 0 8px 16px; }@@ -1507,7 +1509,7 @@ a[href^="#dt-locator-"]:hover {.dt-navigation-view-all:focus-visible, .dt-partner-roster-item:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }.dt-new-conversation { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; margin: 4px 3px 8px; border: 1px solid var(--border); border-radius: 22px; background: var(--background); font-size: 13px; font-weight: 500; box-shadow: 0 2px 5px rgb(0 0 0 / .025); transition: background-color 140ms, box-shadow 140ms; }.dt-new-conversation:hover { background: var(--accent); box-shadow: 0 2px 8px rgb(0 0 0 / .045); }-@container (max-width: 240px) { .dt-category-bar [role="tab"] { padding: 0 4px; gap: 4px; } .dt-category-bar [role="tab"] > span:not(.dt-category-pill) { font-size: 12px; } }+@media (prefers-reduced-motion: reduce) { .dt-category-content { animation: none; } .dt-product-sidebar * { transition-duration: 0ms !important; } }@@ -1529,3 +1531,28 @@ a[href^="#dt-locator-"]:hover {.dt-learning-time-group > h2 { padding: 8px 9px 5px; font-size: 11px; font-weight: 500; color: var(--muted-foreground); }.dt-learning-time-group .dt-navigation-row { min-height: 38px; gap: 8px; }.dt-record-time { flex-shrink: 0; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 400; color: var(--muted-foreground); opacity: .75; }++/* A shared, viewport-aligned page header across libraries and workspaces. */+.dt-page-toolbar-host { min-height: 52px; flex-shrink: 0; position: relative; z-index: 20; }+.dt-page-toolbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; min-width: 0; min-height: 52px; gap: 12px; padding: 7px 20px; border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent); background: var(--background); color: var(--foreground); font-size: 13px; }+.dt-toolbar-identity { display: flex; align-items: center; flex: 1; min-width: 0; gap: 8px; }+.dt-toolbar-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; font-size: 14px; line-height: 22px; font-weight: 600; letter-spacing: -.01em; }+.dt-toolbar-breadcrumb { flex-shrink: 0; max-width: 40%; }+.dt-toolbar-breadcrumb > a { max-width: 100%; white-space: nowrap; }+.dt-toolbar-separator { flex-shrink: 0; color: var(--muted-foreground); opacity: .35; }+.dt-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; gap: 4px; }+.dt-toolbar-actions > div { display: flex; align-items: center; gap: 4px; }+.dt-page-toolbar [data-page-actions] > button,+.dt-page-toolbar [data-page-actions] > a,+.dt-page-toolbar [data-page-actions] > div > button,+.dt-page-toolbar [data-page-actions] > div > a,+.dt-page-toolbar .dt-page-action { min-height: 32px; padding-top: 5px; padding-bottom: 5px; }+.dt-toolbar-actions > button,+.dt-toolbar-actions > a,+.dt-toolbar-actions > span > button { min-width: 32px; min-height: 32px; border-radius: 6px; }+.dt-page-toolbar button:focus-visible, .dt-page-toolbar a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }+@media (max-width: 767px) {+ .dt-page-toolbar { padding: 7px 12px; flex-wrap: wrap; gap: 8px; }+ .dt-toolbar-actions { flex-wrap: wrap; max-width: 100%; }+}+.dt-page-view-tabs { display: flex; flex-shrink: 0; align-items: center; gap: 4px; min-height: 40px; padding: 4px 20px; border-bottom: 1px solid var(--border); overflow-x: auto; }diff --git a/web/components/courses/OrganizedSessionList.tsx b/web/components/courses/OrganizedSessionList.tsxindex efa774ef6..ad33846a8 100644--- a/web/components/courses/OrganizedSessionList.tsx+++ b/web/components/courses/OrganizedSessionList.tsx@@ -736,6 +736,11 @@ export default function OrganizedSessionList({return (<div className="py-0.5">{workspaceMoveError && <p role="alert" className="px-2 py-1 text-xs text-[var(--destructive)]">{workspaceMoveError}</p>}+ {groupWorkspaces && entries.some(entry => entry.kind === "group" && entry.group === "workspace") && (+ <h2 className="mb-1 px-1.5 py-1 text-[12.5px] font-medium text-[var(--foreground)]">+ {t("navigation.projects")}+ </h2>+ )}{entries.map((entry) =>entry.kind === "group"? renderGroup(entry)diff --git a/web/components/knowledge/KnowledgeBaseDetail.tsx b/web/components/knowledge/KnowledgeBaseDetail.tsxindex 8c79ae53e..bc7ad4e8c 100644--- a/web/components/knowledge/KnowledgeBaseDetail.tsx+++ b/web/components/knowledge/KnowledgeBaseDetail.tsx@@ -1,5 +1,6 @@"use client";+import { PageToolbar } from '@/components/layout/PageToolbar'import Tooltip from "@/shared/ui/Tooltip";import { knowledgeBaseRef } from "@/lib/knowledge-helpers";import type { EmbeddingModelSelection } from "@/features/knowledge/model/types";@@ -206,63 +207,49 @@ export default function KnowledgeBaseDetail({return (<main className="flex h-full flex-1 flex-col overflow-hidden bg-[var(--background)]">{/* Header */}- <div className="border-b border-[var(--border)] bg-[var(--card)] px-6 py-4">- <div className="flex items-start justify-between gap-3">- <div className="flex min-w-0 flex-1 items-start gap-3">+ <PageToolbar>+ <div className="dt-toolbar-identity"><KnowledgeEngineIconengine={knowledgeSourceIconId({provider: kbProvider(kb),type: kb.metadata?.type,})}- size={36}- className="mt-0.5"+ size={20}+ className="shrink-0"/>- <div className="min-w-0 flex-1">+ <div className="dt-toolbar-identity">{onBack && (<buttontype="button"onClick={onBack}- className="mb-1.5 inline-flex items-center gap-1 text-[11.5px] font-medium text-[var(--muted-foreground)] transition-colors hover:text-[var(--foreground)]"+ className="shrink-0 inline-flex items-center gap-1 text-[11.5px] font-medium text-[var(--muted-foreground)] transition-colors hover:text-[var(--foreground)]"><ArrowLeft className="h-3.5 w-3.5" />- {t("Knowledge bases")}+ {t('Knowledge bases')}</button>)}- <div className="flex flex-wrap items-center gap-2">- <h1 className="truncate font-serif text-[18px] font-semibold tracking-tight text-[var(--foreground)]">- {kb.name}- </h1>+ <div className="flex min-w-0 items-center gap-2">+ <h1 className="dt-toolbar-title">{kb.name}</h1>{kb.is_default && (<span className="inline-flex items-center gap-1 rounded-full bg-amber-100 px-2 py-0.5 text-[10px] font-medium text-amber-700 dark:bg-amber-950/30 dark:text-amber-300"><Star className="h-3 w-3" fill="currentColor" />- {t("Default")}+ {t('Default')}</span>)}{(kb.assigned || kb.provenance_label) && (<span className="inline-flex items-center rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-700 dark:text-emerald-300">- {kb.provenance_label || t("Assigned by admin")}+ {kb.provenance_label || t('Assigned by admin')}</span>)}- <KbStatusBadge- kb={kb}- isReindexingLocally={isReindexingLocally}- />+ <KbStatusBadge kb={kb} isReindexingLocally={isReindexingLocally} /></div>- <p className="mt-1 text-[12px] text-[var(--muted-foreground)]">- {provider}- {!pageIndexProvider ? ` · ${embeddingLabel}` : ""} ·{" "}- {t("Updated")} {updatedLabel}- {lastIndexedLabel- ? ` · ${t("Last indexed")} ${lastIndexedLabel}`- : ""}- </p>- <LightRagEmbeddingWarning kb={kb} /></div></div>{canRetry && (- <Tooltip label={t(- "Retry indexing from the documents already stored in this knowledge base.",- )} side="top">+ <Tooltip+ label={t('Retry indexing from the documents already stored in this knowledge base.')}+ side="top"+ ><buttontype="button"onClick={handleRetry}@@ -275,17 +262,20 @@ export default function KnowledgeBaseDetail({<RefreshCw className="h-3 w-3" />)}{retrySubmitting || isReindexingLocally- ? t("Retrying…")- : t(- kbProvider(kb) === "lightrag"- ? "Review rebuild"- : "Retry indexing",- )}+ ? t('Retrying…')+ : t(kbProvider(kb) === 'lightrag' ? 'Review rebuild' : 'Retry indexing')}</button></Tooltip>)}- </div>+ </PageToolbar>+ <div className="border-b border-[var(--border)] px-5 py-3">+ <p className="mt-1 text-[12px] text-[var(--muted-foreground)]">+ {provider}+ {!pageIndexProvider ? ` · ${embeddingLabel}` : ''} · {t('Updated')} {updatedLabel}+ {lastIndexedLabel ? ` · ${t('Last indexed')} ${lastIndexedLabel}` : ''}+ </p>+ <LightRagEmbeddingWarning kb={kb} />{/* Section nav */}<nav className="-mb-3 mt-3 flex gap-1 overflow-x-auto">{sections.map((key) => {diff --git a/web/components/layout/FeaturePage.tsx b/web/components/layout/FeaturePage.tsxindex a4c973576..c1fff4532 100644--- a/web/components/layout/FeaturePage.tsx+++ b/web/components/layout/FeaturePage.tsx@@ -1,13 +1,52 @@-import type { ComponentPropsWithRef, ReactNode, Ref, UIEventHandler } from 'react'+'use client'++import {+ createContext,+ useContext,+ useState,+ type ComponentPropsWithRef,+ type ReactNode,+ type Ref,+ type UIEventHandler,+} from 'react'+import { createPortal } from 'react-dom'+import { PageToolbar } from './PageToolbar'++const PageChromeContext = createContext<{+ host: HTMLDivElement | null+ breadcrumb?: ReactNode+} | null>(null)++/** A stable toolbar slot outside the page's scrollport. A portal preserves the+ * page's state/providers while placing its real actions at the same screen edge.+ * The reserved height also prevents a layout jump while the slot mounts. */+export function PageFrame({+ children,+ breadcrumb,+}: {+ children: ReactNode+ breadcrumb?: ReactNode+}) {+ const [host, setHost] = useState<HTMLDivElement | null>(null)+ return (+ <PageChromeContext.Provider value={{ host, breadcrumb }}>+ <div className="flex h-full min-h-0 min-w-0 flex-1 flex-col">+ <div ref={setHost} className="dt-page-toolbar-host" />+ {children}+ </div>+ </PageChromeContext.Provider>+ )+}/** Feature page standard, based on Personalized Learning:* - Centered 1180px outer box; horizontal gutters 24px, 36px from 768px.* - Vertical padding 28px, 36px from 1024px; 24px from header to content.- * - Sans page title 27px / 30px at 640px of usable content; no title icon.+ * - Compact 14px identity in the toolbar; standalone headings remain 27px / 30px.* - Sans description 12.5px, section label 13.5px; one h1 per page.- * - Actions stack below the title under 640px of content and wrap in order.+ * - Page actions align right; secondary section actions stay with their section.* - Grids share 520 / 800 / 1040px container breakpoints and a 12px gap.- * - Readers, editors and chats retain pane-specific working toolbars.+ * - Page identity/actions use the fixed toolbar slot; descriptions stay in the body.+ * - Readers, editors and chats share PageToolbar and retain their working tools.* Use FeaturePage once per scrolling page, or PageContainer inside an* existing scroller. Child components must not add another page gutter.*/@@ -33,26 +72,32 @@ export function FeaturePage({className = '',scrollRef,onScroll,+ breadcrumb,}: {children: ReactNodeclassName?: stringscrollRef?: Ref<HTMLElement>onScroll?: UIEventHandler<HTMLElement>+ breadcrumb?: ReactNode}) {return (- <section- ref={scrollRef}- onScroll={onScroll}- data-feature-page- className={`h-full min-h-0 w-full min-w-0 overflow-y-auto bg-[var(--background)] text-[var(--foreground)] [scrollbar-gutter:stable] ${className}`}- >- <PageContainer>{children}</PageContainer>- </section>+ <PageFrame breadcrumb={breadcrumb}>+ <section+ ref={scrollRef}+ onScroll={onScroll}+ data-feature-page+ className={`flex-1 min-h-0 w-full min-w-0 overflow-y-auto bg-[var(--background)] text-[var(--foreground)] [scrollbar-gutter:stable] ${className}`}+ >+ <PageContainer>{children}</PageContainer>+ </section>+ </PageFrame>)}-export const PAGE_TITLE_CLASS = 'dt-page-title min-w-0 break-words font-sans font-semibold leading-normal tracking-[-0.02em] text-[var(--foreground)]'-export const PAGE_DESCRIPTION_CLASS = 'mt-1.5 max-w-2xl text-[12.5px] leading-relaxed text-[var(--muted-foreground)]'+export const PAGE_TITLE_CLASS =+ 'dt-page-title min-w-0 break-words font-sans font-semibold leading-normal tracking-[-0.02em] text-[var(--foreground)]'+export const PAGE_DESCRIPTION_CLASS =+ 'mt-1.5 max-w-2xl text-[12.5px] leading-relaxed text-[var(--muted-foreground)]'export const PAGE_SECTION_TITLE_CLASS = 'text-[13.5px] font-semibold text-[var(--foreground)]'/** No decorative title icon or divider. Icons belong to cards and actions.@@ -66,6 +111,7 @@ export function PageHeader({level = 1,titleId,headingTour,+ breadcrumb,}: {title: ReactNodedescription?: ReactNode@@ -74,20 +120,66 @@ export function PageHeader({level?: 1 | 2titleId?: stringheadingTour?: string+ breadcrumb?: ReactNode}) {+ const chrome = useContext(PageChromeContext)const Heading = level === 1 ? 'h1' : 'h2'+ if (level === 1 && chrome) {+ const trail = breadcrumb ?? chrome.breadcrumb+ return (+ <>+ {chrome.host &&+ createPortal(+ <PageToolbar>+ <div className="dt-toolbar-identity">+ {trail && (+ <>+ <div className="dt-toolbar-breadcrumb">{trail}</div>+ <span aria-hidden className="dt-toolbar-separator">+ /+ </span>+ </>+ )}+ <h1 id={titleId} data-tour={headingTour} className="dt-toolbar-title">+ {title}+ </h1>+ {meta}+ </div>+ {action && (+ <div data-page-actions className="dt-toolbar-actions">+ {action}+ </div>+ )}+ </PageToolbar>,+ chrome.host+ )}+ {description && <p className={`${PAGE_DESCRIPTION_CLASS} mb-6 !mt-0`}>{description}</p>}+ </>+ )+ }return (<header data-page-header className="dt-page-header mb-6 flex min-w-0 flex-col gap-4"><div className="min-w-0"><div className="flex flex-wrap items-center gap-2.5">- <Heading id={titleId} data-tour={headingTour} className={level === 1 ? PAGE_TITLE_CLASS : PAGE_SECTION_TITLE_CLASS}>+ <Heading+ id={titleId}+ data-tour={headingTour}+ className={level === 1 ? PAGE_TITLE_CLASS : PAGE_SECTION_TITLE_CLASS}+ >{title}</Heading>{meta}</div>{description && <p className={PAGE_DESCRIPTION_CLASS}>{description}</p>}</div>- {action && <div data-page-actions className="flex max-w-full shrink-0 flex-wrap items-center gap-2 [&>div]:max-w-full [&>div]:flex-wrap">{action}</div>}+ {action && (+ <div+ data-page-actions+ className="flex max-w-full shrink-0 flex-wrap items-center gap-2 [&>div]:max-w-full [&>div]:flex-wrap"+ >+ {action}+ </div>+ )}</header>)}diff --git a/web/components/layout/PageToolbar.tsx b/web/components/layout/PageToolbar.tsxnew file mode 100644index 000000000..d82d1658b--- /dev/null+++ b/web/components/layout/PageToolbar.tsx@@ -0,0 +1,14 @@+import type { ComponentPropsWithoutRef } from 'react'++/** Shared page chrome; pane-specific editing tools belong below this bar. */+export function PageToolbar({+ children,+ className = '',+ ...props+}: ComponentPropsWithoutRef<'header'>) {+ return (+ <header {...props} data-page-toolbar className={`dt-page-toolbar ${className}`}>+ {children}+ </header>+ )+}diff --git a/web/components/learning/LearningShell.tsx b/web/components/learning/LearningShell.tsxindex 8d5d6c9ff..d994a4a5f 100644--- a/web/components/learning/LearningShell.tsx+++ b/web/components/learning/LearningShell.tsx@@ -37,16 +37,16 @@ export function LearningShell({scrollRef={scrollRef}onScroll={onScroll}className={className}- >- {back && (+ breadcrumb={back && (<Linkhref={LEARNING_HUB}- className="mb-5 inline-flex items-center gap-1.5 text-xs text-[var(--muted-foreground)] hover:text-[var(--foreground)]"+ className="inline-flex items-center gap-1.5 text-xs text-[var(--muted-foreground)] hover:text-[var(--foreground)]"><ArrowLeft size={14} />- {t('Personalized Learning')}+ {t('navigation.learning')}</Link>)}+ ><PageHeader title={title} description={subtitle} action={action} meta={scopeChip} />{tabs}<div className={tabs ? 'mt-6' : ''}>{children}</div>diff --git a/web/components/notebook/NotebookConsole.tsx b/web/components/notebook/NotebookConsole.tsxindex ab7cba871..2b3a0ed24 100644--- a/web/components/notebook/NotebookConsole.tsx+++ b/web/components/notebook/NotebookConsole.tsx@@ -1,5 +1,6 @@"use client";+import { PageToolbar } from '@/components/layout/PageToolbar'import Link from "next/link";import { useRouter } from "next/navigation";import { useCallback, useEffect, useMemo, useState } from "react";@@ -249,10 +250,9 @@ export default function NotebookConsole({}return (- <div className="flex h-full min-h-0 bg-[var(--background)]">- {/* ── Notebook rail ─────────────────────────────────── */}- <aside className="flex w-[250px] shrink-0 flex-col border-r border-[var(--border)]">- <div className="flex flex-col gap-2.5 px-3 pb-2.5 pt-3">+ <div className="flex h-full min-h-0 flex-col bg-[var(--background)]">+ <PageToolbar>+ <div className="dt-toolbar-identity"><Linkhref="/space"className="group inline-flex w-fit items-center gap-1.5 text-[12px] text-[var(--muted-foreground)] transition-colors hover:text-[var(--foreground)]"@@ -262,22 +262,19 @@ export default function NotebookConsole({strokeWidth={1.8}className="transition-transform group-hover:-translate-x-0.5"/>- {t("Learning Space")}+ {t('navigation.resources')}</Link>-- <div className="flex items-center justify-between">- <h1 className="flex items-center gap-1.5 font-serif text-[15px] font-semibold tracking-tight text-[var(--foreground)]">- <NotebookPen size={14} strokeWidth={1.7} />- {t("Notebooks")}- <span className="rounded-full bg-[var(--muted)] px-1.5 py-0.5 text-[10px] font-normal tabular-nums text-[var(--muted-foreground)]">- {scopedNotebooks.length}+ <span className="dt-toolbar-separator" aria-hidden>+ /</span>- </h1>- <Tooltip label={t("New notebook")} side="top">+ <h1 className="dt-toolbar-title">{t('Notebooks')}</h1>+ </div>+ <div className="dt-toolbar-actions">+ <Tooltip label={t('New notebook')} side="top"><buttontype="button"- onClick={() => setCreating((v) => !v)}- aria-label={t("New notebook")}+ onClick={() => setCreating(v => !v)}+ aria-label={t('New notebook')}aria-expanded={creating}className="rounded-md p-1.5 text-[var(--muted-foreground)] transition-colors hover:bg-[var(--muted)] hover:text-[var(--foreground)]">@@ -285,6 +282,20 @@ export default function NotebookConsole({</button></Tooltip></div>+ </PageToolbar>+ <div className="flex min-h-0 flex-1">+ {/* ── Notebook rail ─────────────────────────────────── */}+ <aside className="flex w-[250px] shrink-0 flex-col border-r border-[var(--border)]">+ <div className="flex flex-col gap-2.5 px-3 pb-2.5 pt-3">+ <div className="flex items-center justify-between">+ <h2 className="flex items-center gap-1.5 font-sans text-[13px] font-semibold tracking-tight text-[var(--foreground)]">+ <NotebookPen size={14} strokeWidth={1.7} />+ {t('Notebooks')}+ <span className="rounded-full bg-[var(--muted)] px-1.5 py-0.5 text-[10px] font-normal tabular-nums text-[var(--muted-foreground)]">+ {scopedNotebooks.length}+ </span>+ </h2>+ </div>{creating && (<div className="flex flex-col gap-1.5 rounded-lg border border-[var(--border)] bg-[var(--card)] p-2">@@ -669,6 +680,7 @@ export default function NotebookConsole({)}</section>+ </div><ConfirmDialogopen={confirmingDelete && Boolean(selected)}title={t("Delete this notebook?")}diff --git a/web/components/reading/workspace/ReadingWorkspace.tsx b/web/components/reading/workspace/ReadingWorkspace.tsxindex 7dd46348b..6c72dd85b 100644--- a/web/components/reading/workspace/ReadingWorkspace.tsx+++ b/web/components/reading/workspace/ReadingWorkspace.tsx@@ -1,5 +1,6 @@"use client";+import { PageToolbar } from '@/components/layout/PageToolbar'import { scopedUrl } from "@/lib/workspace-scope";import { READING_HOME, readingFolderRoute, readingSessionIdFromPath } from "@/lib/learning-routes";@@ -448,7 +449,7 @@ export function ReadingWorkspacePage() {data-reading-workspace=""className="reading-v2 flex h-full min-h-0 flex-col overflow-hidden bg-[var(--background)] text-[var(--foreground)] dark:bg-[var(--background)] dark:text-[var(--foreground)]">- <header className="flex h-11 shrink-0 items-center gap-1.5 border-b border-[var(--border)] bg-[var(--card)] px-2.5">+ <PageToolbar><Linkhref={readingFolderRoute(workspace.workspace_id)}className="flex size-7 shrink-0 items-center justify-center rounded-md text-[var(--muted-foreground)] transition hover:bg-[var(--muted)]"@@ -481,7 +482,7 @@ export function ReadingWorkspacePage() {<buttontype="button"onClick={() => setShowRename(true)}- className="min-w-0 max-w-[240px] truncate font-serif text-[13.5px] font-semibold tracking-[-0.01em] transition hover:text-[var(--primary)]"+ className="min-w-0 max-w-[240px] truncate font-sans text-[14px] font-semibold tracking-[-0.01em] transition hover:text-[var(--primary)]">{workspace.title}</button>@@ -498,7 +499,7 @@ export function ReadingWorkspacePage() {</button></Tooltip>- <div className="ml-auto flex shrink-0 items-center gap-0.5">+ <div className="dt-toolbar-actions ml-auto">{notice && (<span className="hidden max-w-[220px] truncate px-2 text-[10px] text-[var(--muted-foreground)] 2xl:inline">{notice}@@ -585,7 +586,7 @@ export function ReadingWorkspacePage() {</Tooltip>)}</div>- </header>+ </PageToolbar><divref={gridRef}diff --git a/web/components/settings/SettingsMain.tsx b/web/components/settings/SettingsMain.tsxindex f97533573..8c95dc1ea 100644--- a/web/components/settings/SettingsMain.tsx+++ b/web/components/settings/SettingsMain.tsx@@ -1,6 +1,6 @@'use client'-import { PageContainer } from '@/components/layout/FeaturePage'+import { PageContainer, PageFrame } from '@/components/layout/FeaturePage'import { useEffect, useRef, useState } from 'react'import { browserStorage } from '@/shared/storage'import { usePathname, useRouter } from 'next/navigation'@@ -77,6 +77,7 @@ export default function SettingsMain({ children }: { children: React.ReactNode }<Menu size={20} /></button></div>+ <PageFrame><divref={scroller}data-settings-scroll@@ -92,6 +93,7 @@ export default function SettingsMain({ children }: { children: React.ReactNode }</PageContainer></div><SettingsToolbar />+ </PageFrame></main><ModalisOpen={mobileOpen}diff --git a/web/components/sidebar/CategoryNavigation.tsx b/web/components/sidebar/CategoryNavigation.tsxindex e4d6b5aac..25ce6c761 100644--- a/web/components/sidebar/CategoryNavigation.tsx+++ b/web/components/sidebar/CategoryNavigation.tsx@@ -93,7 +93,7 @@ export function CategoryTabs({ nav, collapsed }: { nav: Navigation; collapsed: baria-orientation={collapsed ? 'vertical' : 'horizontal'}>{nav.categories.map((item, index) => (- <Tooltip key={item.id} label={t(item.label)} side={collapsed ? 'right' : 'bottom'}>+ <Tooltip key={item.id} label={t(item.label)} side={collapsed ? 'right' : 'bottom'} className="dt-category-tab-wrap"><buttonid={`category-${item.id}`}type="button"@@ -127,13 +127,14 @@ export function CategoryTabs({ nav, collapsed }: { nav: Navigation; collapsed: b>{nav.category === item.id && (<m.span- layoutId={`category-pill-${id}`}- className="dt-category-pill"+ layoutId={`category-indicator-${id}`}+ className="dt-category-indicator"+ aria-hidden="true"transition={{ duration: reduced ? 0 : 0.22, ease: [0.22, 1, 0.36, 1] }}/>)}- <item.icon size={20} strokeWidth={1.65} />- <span>{t(item.label)}</span>+ <item.icon size={18} strokeWidth={nav.category === item.id ? 1.9 : 1.65} aria-hidden="true" />+ <span className="dt-category-label">{t(item.label)}</span></button></Tooltip>))}diff --git a/web/components/space/SpaceMain.tsx b/web/components/space/SpaceMain.tsxindex fab86d471..becf30b5b 100644--- a/web/components/space/SpaceMain.tsx+++ b/web/components/space/SpaceMain.tsx@@ -34,12 +34,7 @@ export default function SpaceMain({const isDashboard = pathname === "/space";return (- <FeaturePage>- {!isDashboard && (- <div className="mb-5">- <BackToHub />- </div>- )}+ <FeaturePage breadcrumb={!isDashboard && <BackToHub />}>{['/space/skills', '/space/mcp'].includes(pathname) && (<div className="mb-5 rounded-lg border border-[var(--border)] p-3 text-sm text-[var(--muted-foreground)]"><ResourceLibraryNote />diff --git a/web/components/space/learning/MasteryStudy.tsx b/web/components/space/learning/MasteryStudy.tsxindex ffdb96c57..5ea3a774e 100644--- a/web/components/space/learning/MasteryStudy.tsx+++ b/web/components/space/learning/MasteryStudy.tsx@@ -1,5 +1,6 @@"use client";+import { PageToolbar } from '@/components/layout/PageToolbar'import { scopedUrl } from "@/lib/workspace-scope";import { MASTERY_HOME, masterySessionsRoute, masteryTopicRoute } from "@/lib/learning-routes";@@ -574,7 +575,7 @@ export function MasteryStudy({as a single "where am I" statement, and the ring + count are oneunit rather than a ring on the left and its own number on theright saying the same thing twice. */}- <header className="flex h-[56px] shrink-0 items-center gap-1 border-b border-[var(--border)] bg-[var(--background)]/95 px-3 backdrop-blur sm:px-4">+ <PageToolbar><Tooltip label={t("Learning topics")} side="bottom"><Linkhref={masteryTopicRoute(pathId)}@@ -613,7 +614,7 @@ export function MasteryStudy({className="hidden shrink-0 sm:flex"/>- <div className="flex shrink-0 items-center gap-1.5 pl-2">+ <div className="dt-toolbar-actions"><Tooltip label={t("Save to Notebook")}><buttontype="button"@@ -644,7 +645,7 @@ export function MasteryStudy({{completed}/{total}</span></div>- </header>+ </PageToolbar><div className="flex min-h-0 flex-1"><asidediff --git a/web/features/chat/components/ChatWorkspace.tsx b/web/features/chat/components/ChatWorkspace.tsxindex 35f607b66..b97882073 100644--- a/web/features/chat/components/ChatWorkspace.tsx+++ b/web/features/chat/components/ChatWorkspace.tsx@@ -1,5 +1,6 @@"use client";+import { PageToolbar } from '@/components/layout/PageToolbar'import { COMMAND_CONFIRMATION_FAILED } from "@/features/chat/transport/command-delivery";import { ResourceReuseContext, useResourceReusePolicy } from "@/components/chat/home/ResourceReuse";@@ -2393,7 +2394,7 @@ export default function ChatWorkspace() {data-viewer-open={viewerPanelOpen ? "true" : "false"}className="chat-preview-shell flex h-full flex-col overflow-hidden bg-[var(--background)]">- <div className="mx-auto flex w-full max-w-[960px] flex-wrap items-center justify-between gap-x-3 gap-y-1.5 px-6 pt-3 pb-0">+ <PageToolbar><div className="group/title min-w-0 flex flex-1 items-center gap-2">{/* Where this conversation lives, ahead of its title — the samebreadcrumb the composer pill writes, so an opened@@ -2428,7 +2429,7 @@ export default function ChatWorkspace() {onKeyDown={handleSessionTitleKeyDown}disabled={sessionTitleSaving}aria-label={t("Session title")}- className="min-w-0 flex-1 rounded-xl border border-[var(--border)] bg-[var(--background)] px-3 py-1.5 font-serif text-[17px] font-semibold tracking-[-0.01em] text-[var(--foreground)] shadow-sm outline-none transition focus:border-[var(--ring)] focus:ring-2 focus:ring-[var(--ring)]/20 disabled:opacity-60"+ className="min-w-0 flex-1 rounded-xl border border-[var(--border)] bg-[var(--background)] px-3 py-1.5 font-sans text-[14px] font-semibold tracking-[-0.01em] text-[var(--foreground)] shadow-sm outline-none transition focus:border-[var(--ring)] focus:ring-2 focus:ring-[var(--ring)]/20 disabled:opacity-60"maxLength={100}/>) : (@@ -2442,7 +2443,7 @@ export default function ChatWorkspace() {type="button"onClick={startSessionTitleEdit}disabled={!canRenameSession}- className="inline-flex min-w-0 max-w-full items-center gap-2 rounded-xl px-2 py-1 text-left font-serif text-[17px] font-semibold tracking-[-0.01em] text-[var(--foreground)] transition hover:bg-[var(--muted)]/55 disabled:cursor-default disabled:hover:bg-transparent"+ className="inline-flex min-w-0 max-w-full items-center gap-2 rounded-xl px-2 py-1 text-left font-sans text-[14px] font-semibold tracking-[-0.01em] text-[var(--foreground)] transition hover:bg-[var(--muted)]/55 disabled:cursor-default disabled:hover:bg-transparent"><span className="truncate">{displaySessionTitle}</span>{canRenameSession ? (@@ -2462,7 +2463,7 @@ export default function ChatWorkspace() {</span>) : null}</div>- <div className="flex shrink-0 items-center gap-0.5">+ <div className="dt-toolbar-actions"><HeaderActionButtononClick={() => setShowSaveModal(true)}disabled={!chatSavePayload}@@ -2490,7 +2491,7 @@ export default function ChatWorkspace() {title={t("Session activity, attachments & previews")}/></div>- </div>+ </PageToolbar><div className="flex w-full flex-1 min-h-0 flex-col">{sessionLoading || sessionLoadFailed ? (<div className="flex w-full flex-1 min-h-0 justify-center px-6">diff --git a/web/features/co-writer/components/CoWriterWorkspace.tsx b/web/features/co-writer/components/CoWriterWorkspace.tsxindex 9fdeb93f0..30236f76c 100644--- a/web/features/co-writer/components/CoWriterWorkspace.tsx+++ b/web/features/co-writer/components/CoWriterWorkspace.tsx@@ -1,5 +1,6 @@"use client";+import { PageToolbar } from '@/components/layout/PageToolbar'import { knowledgeBaseRef } from "@/lib/knowledge-helpers";import dynamic from "next/dynamic";import { useCallback, useEffect, useMemo, useRef, useState } from "react";@@ -1701,7 +1702,7 @@ export default function CoWriterWorkspace({ docId, onBack }: CoWriterWorkspacePrreturn (<div className="flex h-full min-h-full flex-col overflow-hidden bg-[var(--background)]">{/* ── Top bar ── */}- <header className="flex shrink-0 items-center justify-between border-b border-[var(--border)] px-4 py-1.5">+ <PageToolbar><div className="flex min-w-0 items-center gap-3 text-sm text-[var(--muted-foreground)]"><Tooltip label={t("Back to documents")}><button@@ -1772,7 +1773,7 @@ export default function CoWriterWorkspace({ docId, onBack }: CoWriterWorkspacePr</span>) : null}</div>- <div className="flex items-center gap-2">+ <div className="dt-toolbar-actions"><ToolbarIconBtntitle={t("Clear")}onClick={requestClearDocument}@@ -1827,7 +1828,7 @@ export default function CoWriterWorkspace({ docId, onBack }: CoWriterWorkspacePr{t("Full Draft")}</button></div>- </header>+ </PageToolbar>{/* ── Toolbar ── */}<div className="flex shrink-0 items-center gap-0.5 overflow-x-auto border-b border-[var(--border)] px-3 py-1">diff --git a/web/features/settings/sections/DataMigrationSettingsSection.tsx b/web/features/settings/sections/DataMigrationSettingsSection.tsxindex d68da0a62..b5fadbc97 100644--- a/web/features/settings/sections/DataMigrationSettingsSection.tsx+++ b/web/features/settings/sections/DataMigrationSettingsSection.tsx@@ -6,6 +6,7 @@ import { Download, FolderInput, RefreshCw } from 'lucide-react'import { apiFetch, apiUrl } from '@/lib/api'import { useChatWorkspaces } from '@/hooks/useChatWorkspaces'import { activeWorkspaceId } from '@/lib/workspace-scope'+import { SettingsPageHeader } from '@/components/settings/shared'type Feature = {feature: string@@ -186,7 +187,7 @@ export default function DataMigrationSettingsSection() {)return (<section className="space-y-5">- <h2 className="text-lg font-semibold">{text('Data migration', '数据迁移')}</h2>+ <SettingsPageHeader title={text('Data migration', '数据迁移')} /><p className="text-sm leading-relaxed text-[var(--muted-foreground)]">{text('Discover stored learning data, move it with its related conversations, or download an archive. Verified recovery copies are retained after migration.',diff --git a/web/features/settings/sections/GuardianSettingsSection.tsx b/web/features/settings/sections/GuardianSettingsSection.tsxindex 215a33709..bc5c64f17 100644--- a/web/features/settings/sections/GuardianSettingsSection.tsx+++ b/web/features/settings/sections/GuardianSettingsSection.tsx@@ -1,5 +1,6 @@"use client";+import { SettingsPageHeader } from '@/components/settings/shared'import { useStagedSettings } from "@/features/settings/store/useStagedSettings";import { useEffect, useState } from "react";import {@@ -175,11 +176,8 @@ export default function GuardianSettingsPage() {};return (- <main className="mx-auto max-w-3xl px-6 py-8">- <h1 className="text-xl font-semibold">{t("Guardian management")}</h1>- <p className="mt-1 text-sm text-[var(--muted-foreground)]">- {t("Review authorized learners and their approved learning materials.")}- </p>+ <main className="max-w-3xl">+ <SettingsPageHeader title={t("Guardian management")} description={t("Review authorized learners and their approved learning materials.")} />{error && (<p className="mt-4 rounded-lg bg-red-500/10 px-3 py-2 text-sm text-red-600">diff --git a/web/features/settings/sections/LearnerProfileSettingsSection.tsx b/web/features/settings/sections/LearnerProfileSettingsSection.tsxindex 898c1050c..f4cb70465 100644--- a/web/features/settings/sections/LearnerProfileSettingsSection.tsx+++ b/web/features/settings/sections/LearnerProfileSettingsSection.tsx@@ -1,5 +1,6 @@"use client";+import { SettingsPageHeader } from '@/components/settings/shared'import { useSettings } from "@/features/settings/store/SettingsStore";import { useStagedSettings } from "@/features/settings/store/useStagedSettings";import { useEffect, useState } from "react";@@ -50,11 +51,8 @@ export default function LearnerProfileSettingsPage() {};return (- <main className="mx-auto max-w-2xl px-6 py-8">- <h1 className="text-xl font-semibold">{t("Learner profile")}</h1>- <p className="mt-1 text-sm text-[var(--muted-foreground)]">- {t("Personalize explanations and reading support for your account.")}- </p>+ <main className="max-w-2xl">+ <SettingsPageHeader title={t("Learner profile")} description={t("Personalize explanations and reading support for your account.")} /><div className="mt-6 grid gap-4 sm:grid-cols-2">{fields.map(([key, label]) => (<label key={key} className="grid gap-1 text-sm">diff --git a/web/locales/de/app.json b/web/locales/de/app.jsonindex b71a14770..768c9e2ff 100644--- a/web/locales/de/app.json+++ b/web/locales/de/app.json@@ -5513,6 +5513,7 @@"Clear instructions": "Anweisungen leeren","{{used}} / {{limit}} characters": "{{used}} / {{limit}} Zeichen","contextBudget.segment.workspace_instructions": "Arbeitsbereichsanweisungen",+ "navigation.projects": "Projekte","navigation.home": "Start","navigation.partners": "Partner","navigation.learning": "Lernen",diff --git a/web/locales/en/app.json b/web/locales/en/app.jsonindex e71c67ae3..8a20b97ee 100644--- a/web/locales/en/app.json+++ b/web/locales/en/app.json@@ -5513,6 +5513,7 @@"Clear instructions": "Clear instructions","{{used}} / {{limit}} characters": "{{used}} / {{limit}} characters","contextBudget.segment.workspace_instructions": "Workspace instructions",+ "navigation.projects": "Projects","navigation.home": "Home","navigation.partners": "Partners","navigation.learning": "Learning",diff --git a/web/locales/fr/app.json b/web/locales/fr/app.jsonindex 305840078..cb0ca479f 100644--- a/web/locales/fr/app.json+++ b/web/locales/fr/app.json@@ -5893,6 +5893,7 @@"Clear instructions": "Effacer les instructions","{{used}} / {{limit}} characters": "{{used}} / {{limit}} caractères","contextBudget.segment.workspace_instructions": "Instructions de l’espace de travail",+ "navigation.projects": "Projets","navigation.home": "Accueil","navigation.partners": "Partenaires","navigation.learning": "Apprentissage",diff --git a/web/locales/pl/app.json b/web/locales/pl/app.jsonindex 78a57e9c2..81ba69b74 100644--- a/web/locales/pl/app.json+++ b/web/locales/pl/app.json@@ -5529,6 +5529,7 @@"Clear instructions": "Wyczyść instrukcje","{{used}} / {{limit}} characters": "{{used}} / {{limit}} znaków","contextBudget.segment.workspace_instructions": "Instrukcje obszaru roboczego",+ "navigation.projects": "Projekty","navigation.home": "Strona główna","navigation.partners": "Partnerzy","navigation.learning": "Nauka",diff --git a/web/locales/uk/app.json b/web/locales/uk/app.jsonindex 7346ced7d..a8ab8730b 100644--- a/web/locales/uk/app.json+++ b/web/locales/uk/app.json@@ -5529,6 +5529,7 @@"Clear instructions": "Очистити інструкції","{{used}} / {{limit}} characters": "{{used}} / {{limit}} символів","contextBudget.segment.workspace_instructions": "Інструкції робочого простору",+ "navigation.projects": "Проєкти","navigation.home": "Головна","navigation.partners": "Партнери","navigation.learning": "Навчання",diff --git a/web/locales/zh/app.json b/web/locales/zh/app.jsonindex 142aba5c0..0f5f60d89 100644--- a/web/locales/zh/app.json+++ b/web/locales/zh/app.json@@ -5513,6 +5513,7 @@"Clear instructions": "清空提示词","{{used}} / {{limit}} characters": "{{used}} / {{limit}} 字符","contextBudget.segment.workspace_instructions": "工作区提示词",+ "navigation.projects": "项目","navigation.home": "主页","navigation.partners": "伙伴","navigation.learning": "学习",diff --git a/web/tests/page-chrome.spec.tsx b/web/tests/page-chrome.spec.tsxnew file mode 100644index 000000000..758b68636--- /dev/null+++ b/web/tests/page-chrome.spec.tsx@@ -0,0 +1,45 @@+import { createContext, useContext, useState } from 'react'+import { fireEvent, render, screen, within } from '@testing-library/react'+import { expect, it } from 'vitest'+import { FeaturePage, PageHeader } from '@/components/layout/FeaturePage'++const DraftContext = createContext('')++function DraftActions() {+ const draft = useContext(DraftContext)+ const [saved, setSaved] = useState(false)+ return <button onClick={() => setSaved(true)}>{saved ? draft : 'Save draft'}</button>+}++it('keeps live page actions and their providers in the toolbar, outside the scrollport', () => {+ const view = render(+ <FeaturePage breadcrumb={<a href="/learning">Learning</a>}>+ <DraftContext.Provider value="Draft saved">+ <PageHeader title="My book" description="A learning project" action={<DraftActions />} />+ <PageHeader level={2} title="Chapters" action={<button>Add chapter</button>} />+ </DraftContext.Provider>+ </FeaturePage>+ )+ const toolbar = screen.getByRole('heading', { name: 'My book' }).closest('header')!+ expect(within(toolbar).getByRole('heading', { name: 'My book' })).toBeVisible()+ expect(within(toolbar).getByRole('link', { name: 'Learning' })).toHaveAttribute(+ 'href',+ '/learning'+ )+ expect(toolbar.closest('[data-feature-page]')).toBeNull()+ expect(screen.getByText('A learning project').closest('[data-feature-page]')).not.toBeNull()+ expect(within(toolbar).queryByRole('button', { name: 'Add chapter' })).toBeNull()+ fireEvent.click(within(toolbar).getByRole('button', { name: 'Save draft' }))+ expect(screen.getAllByRole('button', { name: 'Draft saved' })).toHaveLength(1)++ // Changing pages removes the previous page's controls instead of leaving a+ // stale save/delete handler in a persistent shell.+ view.rerender(+ <FeaturePage>+ <PageHeader title="Library" action={<button>New book</button>} />+ </FeaturePage>+ )+ expect(screen.queryByRole('button', { name: 'Draft saved' })).toBeNull()+ expect(screen.getAllByRole('banner')).toHaveLength(1)+ expect(within(screen.getByRole('banner')).getByRole('button', { name: 'New book' })).toBeVisible()+})diff --git a/web/tests/partner-direct-chat.test.ts b/web/tests/partner-direct-chat.test.tsindex c31b347ad..e90d5146c 100644--- a/web/tests/partner-direct-chat.test.ts+++ b/web/tests/partner-direct-chat.test.ts@@ -23,12 +23,11 @@ test("partner web chat waits for runtime readiness, not channel running state",assert.doesNotMatch(chatSource, /disabled=\{!connected \|\| !running\}/);});-test("partner tabs use a stable centered header column", () => {- assert.match(- pageSource,- /grid-cols-\[minmax\(0,1fr\)_auto_minmax\(0,1fr\)\]/,- );- assert.match(pageSource, /<nav className="flex justify-self-center/);+test("partner views stay separate from page actions", () => {+ const toolbarEnd = pageSource.indexOf("</PageToolbar>");+ const localViews = pageSource.indexOf('<nav className="dt-page-view-tabs">');+ assert.ok(toolbarEnd >= 0 && localViews > toolbarEnd);+ assert.match(pageSource, /className="dt-toolbar-actions"/);});test("partner chat keeps old active and archived conversations reachable", () => {diff --git a/web/tests/workspace-sidebar-grouping.spec.tsx b/web/tests/workspace-sidebar-grouping.spec.tsxindex 07da4544f..14eb00bd4 100644--- a/web/tests/workspace-sidebar-grouping.spec.tsx+++ b/web/tests/workspace-sidebar-grouping.spec.tsx@@ -63,6 +63,7 @@ it('keeps unassigned chats in a peer Recent section with independent five-row liactiveSessionId={null} onSelect={vi.fn()} onRename={vi.fn()} onDelete={vi.fn()} onOrganize={vi.fn()} />)const workspaceGroup = view.container.querySelector('[data-group-id="workspace:physics"]')! as HTMLElementconst recentGroup = view.container.querySelector('[data-group-id="recent:unassigned"]')! as HTMLElement+ expect(screen.getByRole('heading', { name: 'navigation.projects' }).nextElementSibling).toBe(workspaceGroup)expect(workspaceGroup.parentElement).toBe(recentGroup.parentElement)expect(workspaceGroup.nextElementSibling).toBe(recentGroup)expect(within(recentGroup).queryByText('Lesson 0')).toBeNull()