Files
DeepTutor/web/app/layout.tsx
Antonio-Faure 75636f0735 perf(web): improve knowledge-base and settings accessibility and payload (#3139)
* fix(web): refine knowledge and settings accessibility and layout

Name row controls from their visible titles, portal tooltip descriptions out of tablists, and make the knowledge tabs keyboard-complete. Also stack the KB master-detail on phones, add a section-scroll hint, demote the indexing diagnostic to its detail tab, and consolidate the knowledge type scale.

* perf(web): cut knowledge and settings payload

Serve raster engine marks through next/image, stop preloading the serif face on pages that do not use it, and prefetch settings routes only on hover or keyboard focus instead of on first paint.

* docs(perf): record knowledge and settings audit

Document the protocol, baseline and after medians, payload and accessibility results, limits, and reproduction commands, with mobile before/after screenshots.

* test(web): match the model row's visible accessible name

The row no longer overrides its name with a provider-first aria-label; select it by the model-first text a screen reader now reads, which also contains the visible default/task badge.

* fix(web): keep the MinerU download-type name in the locale catalog

Reuse the existing Download models and Type strings instead of introducing a new t() literal, so the strict i18n audit stays green.

* docs(perf): link the UI audit from the handbook index

The docs contract requires every guide under docs-for-dev to be reachable from README.md.

* docs(perf): record the isolated knowledge-detail LCP

Re-measured the detail route with the host pinned away from unrelated work; the 668 ms row was contention, while the isolated median is 568 ms and the stable repeats overlap the baseline.

---------

Co-authored-by: Antonio-Faure <209759495+Antonio-Faure@users.noreply.github.com>
2026-12-01 17:12:12 +08:00

76 lines
2.3 KiB
TypeScript

import type { Metadata, Viewport } from "next";
import { Geist, Lora } from "next/font/google";
import "./globals.css";
import "@/features/ui-layout/classic/classic.css";
import "@/features/ui-layout/modern/modern.css";
import ThemeScript from "@/components/ThemeScript";
import ToastViewport from "@/components/common/ToastViewport";
import MotionProvider from "@/components/common/MotionProvider";
import SettingsReturnTracker from "@/components/settings/SettingsReturnTracker";
import { WorkspaceNavigation } from "@/components/workspaces/WorkspaceNavigation";
import { AppShellProvider } from "@/context/AppShellContext";
import { I18nClientBridge } from "@/i18n/I18nClientBridge";
// Geist matches the public site (deeptutor.info) and stays crisp at the
// small UI sizes the composer/toolbars use, unlike the rounder Jakarta.
const fontSans = Geist({
subsets: ["latin"],
display: "swap",
variable: "--font-sans",
});
const fontSerif = Lora({
subsets: ["latin"],
display: "swap",
variable: "--font-serif",
// Only the few editorial surfaces use it; preloading it on every route
// charged ~37 KB to the knowledge and settings pages that never render it.
preload: false,
});
export const viewport: Viewport = { interactiveWidget: "resizes-content" };
export const metadata: Metadata = {
title: "DeepTutor",
description: "Agent-native intelligent learning companion",
icons: {
icon: [
{ url: "/brand/favicon-16x16.png", sizes: "16x16", type: "image/png" },
{ url: "/brand/favicon-32x32.png", sizes: "32x32", type: "image/png" },
],
apple: "/brand/apple-touch-icon.png",
},
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html
lang="en"
suppressHydrationWarning
data-scroll-behavior="smooth"
className={`${fontSans.variable} ${fontSerif.variable}`}
>
<head>
<ThemeScript />
</head>
<body
className="font-sans bg-[var(--background)] text-[var(--foreground)]"
suppressHydrationWarning
>
<AppShellProvider>
<SettingsReturnTracker />
<WorkspaceNavigation />
<MotionProvider>
<I18nClientBridge>{children}</I18nClientBridge>
</MotionProvider>
<ToastViewport />
</AppShellProvider>
</body>
</html>
);
}