Skip to content

feat(reader): fold long code blocks - #31

Open
oldwinter wants to merge 1 commit into
v5from
happy-hour/code-folding
Open

feat(reader): fold long code blocks#31
oldwinter wants to merge 1 commit into
v5from
happy-hour/code-folding

Conversation

@oldwinter

@oldwinter oldwinter commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Long syntax-highlighted code blocks now start at a compact reading height and expand in place from a localized chevron beside the existing copy control, while short blocks, Mermaid diagrams, no-JavaScript output, and print output stay untouched. It is worth merging because dense technical notes become easier to scan without sacrificing source access, keyboard accessibility, or the existing copy and horizontal-scroll workflows.

Validation

  • npx tsx --test quartz/components/scripts/codeFolding.test.ts quartz/plugins/emitters/componentResources.test.ts (15/15 passed)
  • npx tsc --noEmit
  • Scoped Prettier check and git diff --check
  • npx quartz build (314 Markdown inputs, 1912 outputs)
  • Real Chromium QA at 1280x900 and 390x844: expand/collapse, keyboard focus, copy-button coexistence, dark mode, reduced motion, responsive overflow, and SPA singleton cleanup
  • Full npm test: 241/242 passed; the sole failure is the existing undeclared jsdom import in untouched local-plugins/theme-switcher/test/themeSwitcherScript.test.ts

Impact

  • Adds a reader-only control for syntax-highlighted code blocks longer than 24 rendered lines
  • Adds localized labels for English, Simplified Chinese, and Traditional Chinese, with the existing locale fallback for other languages
  • No content, dependency, configuration, storage, network, deployment, or infrastructure changes

Rollback

Revert commit 69f9b49be3fff608f282b4caf5ae48ee57dcc0eb. Static HTML always retains the full code content, so rollback has no content migration or data cleanup.

Hosted status

Netlify deploy preview 6a93410fa2fce600089f403e failed all four contexts with an unavailable public summary, no messages, and zero GitHub annotations. Merged baseline PR #29 has the same four-context failure pattern, while this exact SHA passes the local production build and browser QA above. No deployment, configuration, authentication, or infrastructure changes were made.

@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.

@oldwinter oldwinter added the enhancement New feature or request label Aug 29, 2026
@netlify

netlify Bot commented Aug 29, 2026

Copy link
Copy Markdown

Deploy Preview for aquamarine-salamander-b041fe failed. Why did it fail? →

Name Link
🔨 Latest commit 69f9b49
🔍 Latest deploy log https://app.netlify.com/projects/aquamarine-salamander-b041fe/deploys/6a93410fa2fce600089f403e

@oldwinter

Copy link
Copy Markdown
Owner Author

Blocking DESIGN violation at exact head 69f9b49be3fff608f282b4caf5ae48ee57dcc0eb: codeFolding.scss animates border-color, while DESIGN permits only opacity, color, background-color, box-shadow or transform. Functional review is otherwise clean, but DOM lifecycle, authored-control/copy coexistence, repeated navigation cleanup, keyboard/ARIA, print/mobile/reduced-motion and RTL remain unexecuted.

Unblock action: remove the non-whitelisted transition and attach executable DOM/browser coverage for fold eligibility, focus and lifecycle before merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant