Skip to content

Correct chapter 06's NonNullable and type origin, calm its hero, and tidy chapter 07 - #20

Merged
renrenmimi merged 2 commits into
masterfrom
fix/content-utility-type-magic
Oct 10, 2026
Merged

renrenmimi merged 2 commits into
masterfrom
fix/content-utility-type-magic

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–#19.

It touches chapter 06 (app/utility/page.tsx, viz.tsx, lib/utility-data.tsx) and chapter 07 (app/type-magic/page.tsx, viz.tsx, lib/type-magic-data.tsx). It does not touch LAB_TYPO or LAB_GRADER_SOLVED, which #14 owns.

Summary

Fixes from the 2026-10-09 audits:

  • B17 (04-TSer-内容.md)
    • The quiz explanation called NonNullable a conditional type. It has been T & {} since TypeScript 4.8 (lib.es5.d.ts:1635).
    • The text called this chapter's Order "the tea shop type from Chapter 01". Chapter 01 has no Order, and chapter 02's Order is a different shape.
    • The Chinese title of the composition task named a single checkout DTO. The task builds three variants.
  • A28 (/utility carousel, 04-TSer-代码与体验.md): the hero carousel switched every 2.6 s forever. It ignored reduced motion and could not be paused.
  • B21 (quiz titles): the quiz sections used 通关测验.
  • B22 (register): colloquial Chinese, including 顺路认脸, 先认个脸, 一声不吭, 光秃秃 and 造一把.

Changes

  • Chapter 06
    • Quiz explanation: Exclude and Extract stay conditional types, and NonNullable is described as T & {}.
    • Order type note: it now says "this chapter's tea shop order type; its Size matches earlier chapters".
    • Task title: the Chinese title now reads 只用工具类型,组合出 Order 的三个变体.
    • Carousel: it goes round once and stops on the first tool. It does not rotate under reduced motion, and it does not advance while the page is hidden.
  • Chapter 07: copy only.
  • Both chapters: formal Chinese, and 本章测验 / Chapter quiz.

Verification

  • npx tsc --noEmit --incremental false: clean.
  • npm test: 6 files, 38 tests pass, including zh-copy-spacing.
  • npm run build: succeeds.
  • Headless Chrome against a local next start:
    • Copy: both pages and both languages show the new text, the old phrases are gone, and there are 0 console errors.
    • Carousel, default motion: it shows Partial, Readonly, Pick and Omit, then stays on Partial at 14 s and at 20 s.
    • Carousel, reducedMotion: 'reduce': it shows only Partial throughout.

🤖 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>
… chapter 07

Chapter 06
- NonNullable is not a conditional type: since TypeScript 4.8 it is T & {} (lib.es5.d.ts).
  The quiz explanation says so, while Exclude and Extract stay conditional types.
- The chapter's Order type is introduced as this chapter's type (its Size matches earlier
  chapters), not as "the type from Chapter 01", where no Order exists.
- The Chinese title of the composition task names the three Order variants the task asks
  for, as the English title and both task texts do.
- The hero tool carousel goes round once and stops, does not move under reduced motion and
  does not advance while the page is hidden.

Chapter 07
- Copy only: 光秃秃的 T and 造一把 become formal Chinese.

Both chapters
- Formal Chinese register (认脸, 一声不吭 and the like) and quiz titles 本章测验 / Chapter quiz.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 10, 2026 05:55
@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

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T05:57:21.341740Z a4b1e2e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4b1e2e784

ℹ️ 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".

Comment thread app/utility/viz.tsx
Comment on lines +50 to +53
steps += 1;
setI((v) => (v + 1) % HERO_TOOLS.length);
if (steps >= HERO_TOOLS.length) clearInterval(t);
}, 2600);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add a pause control for the carousel

For users without a reduced-motion preference who still need to pause moving or updating content, this timer changes the hero at 2.6, 5.2, 7.8, and 10.4 seconds. Because the automatic sequence lasts longer than five seconds, merely stopping after the final update does not resolve the reported inability to pause it; provide a user-visible pause mechanism or shorten the entire sequence to five seconds or less.

Useful? React with 👍 / 👎.

@renrenmimi
renrenmimi merged commit de89331 into master Oct 10, 2026
1 of 2 checks passed
@renrenmimi
renrenmimi deleted the fix/content-utility-type-magic 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