Repository navigation
Bring CLAUDE.md up to date with the audit fixes - #23
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>
The project notes still described the course as it was before this round. They now match what the fix PRs (#9–#22) changed: - The compiler build step runs before npm test too. Only worker.js under public/tslab/ is tracked (#14); the compiler is about 11 MB unpacked and about 2 MB on first transfer (#14). - File layout: each chapter's server layout.tsx exports its metadata, app/document-title.tsx follows the reader's language, app/not-found.tsx is the 404 page, and app/fonts/ holds the self-hosted fonts (#10). - Lab presets can give their code per language (#14). While the compiler loads or after it fails, a banner sits above the editor and the code stays readable, with a retry and a Playground link that carries the code (#14). - The quiz section is called 本章测验 / Chapter quiz, as on DataData and AlgoAlgo, and the stated range is 7–12 questions, which is what the chapters deliver (7 on the prologue, 11 on chapters 02 and 09, 12 on the finale). - Fill-in answers are compared after NFKC normalisation, whitespace removal and quote folding (#13). - One rendering per term: 注解 for annotation, 悬停 for hover, 非空断言 for `!`, 动手任务 for labs, 本章测验 for the quiz (B23). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Deployment failed for project tser with the following error: Learn More: https://vercel.com/renrenmimis-projects?upgradeToPro=build-rate-limit |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e2db4b85d1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const m of raw.matchAll(/(\S)( +)(\S)/g)) { | ||
| const a = m[1], b = m[3]; | ||
| const stray = (PUNCT.test(a) || (a === "…" && closesChinese(raw, m.index!))) && ZH.test(b) && b !== "—"; | ||
| if (stray) at(start + m.index!, `space ${a} ${b}`); |
There was a problem hiding this comment.
Detect ordinary same-line Chinese gaps
When an extra space is written on the same line, this predicate only reports full-width punctuation or an ellipsis followed by Chinese; it omits the ASCII punctuation handled by breakIsStray and also omits Han-to-Han gaps. Consequently existing text such as 真名: 使用处 in app/generics/page.tsx and 删掉, 换成 in lib/generics-data.tsx passes this new test despite rendering the spacing that the documented invariant says it prevents. Extend the same-line check to cover these boundaries.
Useful? React with 👍 / 👎.
Summary
Branches from #9 (commit
2148ad8), the only other PR that touchesCLAUDE.md. Its rule on Chinese line breaks stays as it is.The project notes still described the course as it was before this round. This PR brings them in line with what #9–#22 changed, so a later session does not reintroduce what the round fixed. It changes documentation only.
Changes
scripts/prepare-tslab.mjsalso runs beforenpm test. Underpublic/tslab/, only the hand-writtenworker.jsis tracked; the compiler copies are ignored (Free the lab editor's keyboard, keep code readable when the compiler fails, and localise presets #14). The compiler is about 11 MB unpacked and about 2 MB on first transfer.app/<ch>/layout.tsx, the server layout that exports each chapter's metadata fromapp/chapter-metadata.ts;app/document-title.tsx, which makes the tab title follow the reader's language;app/not-found.tsx, the 404 page;app/fonts/, the self-hosted fonts (Restore settings after a client re-render, title every page, and self-host the fonts #10).presets[].codecan be{ en, zh }when the code carries teaching comments (Free the lab editor's keyboard, keep code readable when the compiler fails, and localise presets #14).!), 动手任务 (labs), 本章测验 (quiz).Verification
.gitignoreandlib/tslab.tsxon Free the lab editor's keyboard, keep code readable when the compiler fails, and localise presets #14, the new files on Restore settings after a client re-render, title every page, and self-host the fonts #10,normAnsweron Keep quiz focus, announce verdicts, and accept IME and single-quote answers #13. The question counts come from theQUIZarrays on the content branches (Correct the prologue and chapter 01: tsc still emits on errors, and arithmetic on any is a number #17–Correct the finale's as answer and summaries, and fix three details in chapter 10 #22).git diff --name-onlyagainst2148ad8: no other PR in this round touchesCLAUDE.md.🤖 Generated with Claude Code