Skip to content

Match chapter 05's preset text to the compiler, align its examples, and tidy chapter 04 - #19

Merged
renrenmimi merged 2 commits into
masterfrom
fix/content-structural-generics
Oct 10, 2026
Merged

renrenmimi merged 2 commits into
masterfrom
fix/content-structural-generics

Conversation

@renrenmimi

Copy link
Copy Markdown
Owner

Branches from #9 (commit 2148ad8), so it can be merged before or after it, and independently of #10–#18.

It touches chapter 04 (app/structural/page.tsx, viz.tsx) and chapter 05 (app/generics/page.tsx, viz.tsx, lib/generics-data.tsx). It does not touch the four structural presets, which #14 owns.

Summary

Fixes from the 2026-10-09 content audit (04-TSer-内容.md):

  • B7:
    • What the text said: pressing "drop the constraint" made "the two errors at the call sites disappear".
    • What the lab shows: only longest's constraint is removed.
      • In longest, TS2339 appears twice.
      • getProp(menu, "topping")'s TS2345 stays.
  • B16:
    • The Chinese erasure note said the compiler knows the type argument "before compilation" (在编译之前). The English says "while it was checking the file".
    • The three "first item" examples differed between the languages, and neither matched the code's string[], number[] and Order[].
  • B21 (quiz titles): both chapters used 通关测验.
  • B22 (register): colloquial Chinese, including 先痛一下, 填洞的两种姿势, 掰直…想岔, 一点没糊, 同形状的坑, 一声没吭 and 撞上.
  • A26 (these chapters): the segmented buttons in the compatibility, freshness and generic-call visuals did not expose their selected state.

Changes

  • Chapter 05:
    • The §04 lab text in both languages now matches the preset's real diagnostics.
    • The opening callout names the three array types the code uses.
    • The zh erasure note says 在编译(类型检查)时,也就是程序运行之前. A stray space after a comma in that note is removed.
  • Both chapters:
    • Formal Chinese.
    • 本章测验 / Chapter quiz.
    • aria-pressed on the seg-btn buttons.

Verification

  • npx tsc --noEmit --incremental false: clean.
  • npm test: 6 files, 38 tests pass, including zh-copy-spacing.
  • npm run build: succeeds.
  • The preset's diagnostics were checked with the lab worker during the audit:
    • Before the preset: 8:9 TS2345 and 17:15 TS2345.
    • After the preset: 2:12 TS2339, 2:24 TS2339 and 15:15 TS2345.
  • Headless Chrome against a local next start, in both languages: the new text is on both pages, none of the old phrases remain, and there are 0 console errors.

🤖 Generated with Claude Code

renrenmimi and others added 2 commits October 9, 2026 16:07
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>
…idy chapter 04

Chapter 05
- "Drop the constraint" only removes longest's constraint: the text now says the
  longest(10, 100) error disappears, TS2339 appears twice inside longest, and getProp's
  error stays, which is what the lab shows.
- The opening example names the three array types the code uses (string[], number[],
  Order[]) in both languages; the Chinese erasure note says type arguments are resolved
  during compilation, not "before compilation", as the English says.

Chapter 04
- Copy only: the "traps" headings and the colloquial verbs become formal Chinese.

Both chapters
- Formal Chinese register (先痛一下, 姿势, 掰直, 想岔, 糊, 坑, 一声没吭, 撞上), quiz titles
  本章测验 / Chapter quiz, and aria-pressed on the segmented buttons of the compatibility,
  freshness and generic-call visuals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 10, 2026 05:51
@vercel

vercel Bot commented Oct 10, 2026

Copy link
Copy Markdown

Deployment failed for project tser with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/renrenmimis-projects?upgradeToPro=build-rate-limit

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@renrenmimi
renrenmimi merged commit 162bf48 into master Oct 10, 2026
1 of 2 checks passed
@renrenmimi
renrenmimi deleted the fix/content-structural-generics branch October 10, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants