Skip to content

fix: hide TOC toggle for single-heading documents#443

Merged
tomasz-tomczyk merged 1 commit intomainfrom
toc-hide-single-heading
May 4, 2026
Merged

fix: hide TOC toggle for single-heading documents#443
tomasz-tomczyk merged 1 commit intomainfrom
toc-hide-single-heading

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

@tomasz-tomczyk tomasz-tomczyk commented May 4, 2026

Summary

A single-entry TOC has nothing to navigate to — it just adds a noop toggle to the header. Hide it when fewer than two headings exist.

Mirrors the same change in crit-web/assets/js/document-renderer.js for parity.

Test plan

  • pre-commit hook: gofmt, golangci-lint, go test -race, ESLint, Stylelint, CSS var checker — all pass

See also: tomasz-tomczyk/crit-web#170 (main TOC fix + parity change)

🤖 Generated with Claude Code

A single-entry TOC has nothing to navigate to — it just adds a noop
toggle to the header. Hide it when fewer than two headings exist.

Mirrors the same change in crit-web's document-renderer.js for parity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.09%. Comparing base (8aba0fd) to head (018a2c9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #443      +/-   ##
==========================================
+ Coverage   68.03%   68.09%   +0.06%     
==========================================
  Files          35       35              
  Lines        9839     9839              
==========================================
+ Hits         6694     6700       +6     
+ Misses       2632     2628       -4     
+ Partials      513      511       -2     
Flag Coverage Δ
e2e 34.05% <ø> (+0.04%) ⬆️
unit 65.36% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tomasz-tomczyk tomasz-tomczyk merged commit ba55a38 into main May 4, 2026
13 of 14 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the toc-hide-single-heading branch May 4, 2026 09:25
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.

1 participant