Repository navigation
Restore settings after a client re-render, title every page, and self-host the fonts - #10
Merged
Merged
Conversation
JSX trims each line of a text block and joins the lines with one space.
The Chinese copy is wrapped across source lines throughout the course, so
it rendered with spaces between Chinese characters and around full-width
punctuation: 1,572 of them in 36 files.
- 1,548 line breaks are joined by a script that walks the TypeScript
syntax tree and touches only JSX text and JSX attribute strings, never
code samples, template literals or comments. Breaks next to Latin
letters, digits, expressions, "——" or operators keep their space.
- 24 more spaces go: 20 after full-width punctuation, 3 between Chinese
text and a tag whose text is Chinese, and one {" "} between a
full-width mark and Chinese text.
- test/zh-copy-spacing.test.ts, the check DataData and AlgoAlgo use,
scans every TSX file and fails on any new stray space; CLAUDE.md states
the rule.
Apart from the one {" "}, the diff changes nothing but whitespace. The
text every edited file renders differs from master only by deleted
spaces, each next to Chinese text, so the English copy is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t the fonts - Move the two pre-paint scripts from <head> to the top of <body>, so the webpack runtime removing chunk scripts from <head> no longer races hydration (React error #418). - ThemeProvider, ShellProvider and LangProvider read the settings back from localStorage and write data-theme, data-sidebar, data-lang and lang back onto <html>, so even a root that React renders again on the client keeps the reader's language, theme and sidebar. - Switch the language inside startTransition; keep <meta name="theme-color"> in step with the theme; close the phone drawer when the window grows past the drawer breakpoint. - Give every chapter a server layout that exports its own metadata, keep the tab title in the reader's language on the client, and add a real 404 page in the site shell. chapterByPath returns PAGE_NOT_FOUND for a path outside the course instead of the prologue. - Self-host Syne, Space Grotesk and JetBrains Mono with next/font/local (the same files as AlgoAlgo and DataData), and load Noto Sans SC only through the Chinese font stacks, so English pages download none of it. - Show every section when scripting is off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Oct 10, 2026
Merged
Free the lab editor's keyboard, keep code readable when the compiler fails, and localise presets
#14
Merged
Merged
Merged
This was referenced Oct 10, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branches from #9 (commit
2148ad8), so it can be merged before or after it.Summary
Fixes from the 2026-10-09 audit (
04-TSer-代码与体验.md):<title>; the 404 page was Next.js's white default and highlighted the prologue.Changes
app/layout.tsx: the two pre-paint scripts move from<head>to the top of<body>, the same fix AlgoAlgo Raise contrast in both themes, stop idle repaints, show code as typed, and fix print #15 verified. Fonts come fromapp/fontsthroughnext/font/local, andmetadataBaseis set for the chapters' canonical URLs.app/theme-provider.tsx,lib/i18n.tsx: the providers read their settings from localStorage, not from<html>, and writedata-theme,data-sidebar,data-langandlangback. The theme also updates<meta name="theme-color">, the language switch runs instartTransition, and the drawer closes when the window grows past the breakpoint.app/<chapter>/layout.tsx(11 new server layouts) andapp/chapter-metadata.tsgive each chapter its own title, description and canonical URL.app/document-title.tsxkeeps the tab title in the reader's language, including after Next.js rewrites it on navigation.app/not-found.tsx: a 404 page inside the site shell, in both languages, listing every chapter. Inlib/curriculum.ts,chapterByPathreturnsPAGE_NOT_FOUNDfor a path outside the course, so the sidebar highlights nothing and the breadcrumb says "Page not found".app/fonts/: the same Syne, Space Grotesk and JetBrains Mono files as AlgoAlgo and DataData, plus DataData's Noto Sans SC slices. Inapp/globals.css, only thehtml[data-lang="zh"]font stacks name Noto Sans SC, and@media (scripting: none)shows every.revealsection.test/settings-restore.test.tsx,test/titles.test.tsx,test/fonts-and-reveal.test.ts.Verification
npx tsc --noEmit --incremental false: clean.npm test: 9 files, 52 tests pass.npm run build: succeeds with no network font fetch.next start:zh,lightandcollapsedstored. Settings were lost 0 times and #418 appeared 0 times. Before the fix the audit saw 7 of 120 on production./generics, the Chinese tab reads "泛型 · TSer"./no-such-pagereturns 404 and renders in Chinese on the dark background. Noaria-currentis set, the breadcrumb reads "页面不存在", and the page lists 12 chapter links./narrowinghas 0 of 11 sections hidden.🤖 Generated with Claude Code