Skip to content

fix(flame): hide mobile toc controls when sections are empty - #501

Merged
gitfromwildan merged 1 commit into
mainfrom
fix/flame-empty-mobile-toc
Nov 7, 2026
Merged

gitfromwildan merged 1 commit into
mainfrom
fix/flame-empty-mobile-toc

Conversation

@gitfromwildan

Copy link
Copy Markdown
Member

Mobile pages with no TOC entries still offered an expandable title that opened a “No headings on this page” panel. Render the page title as static text in that case, removing the empty panel, chevron, and keyboard stop. Pages with sections retain the TOC toggle and progress indicator, with aria-expanded exposing the open state. Includes a patch changeset for @docubook/flame.

Verification

  • Forced production build of four fixture pages: passed.
  • Existing TOC progress and list-scroll tests: 19 passed across two files.
  • Chromium checks: pages without headings, H1-only pages, and H6-only pages have a static title and no TOC controls/panel; keyboard navigation skips the title; search and drawer still work.
  • Pages with sections retain keyboard expansion, section navigation, automatic collapse, active title updates, and desktop TOC.
  • Inspected mobile screenshots in light/dark themes; long title fits at 320px without horizontal overflow.
  • Prettier, targeted Oxlint, git diff --check, and pre-push workspace lint/build (7 tasks) and commitlint: passed.
  • Temporary preview server and browser closed after verification.

Agent Context

  • owner/repo: DocuBook/docubook
  • branch: fix/flame-empty-mobile-toc | base: main
  • created-by: Codex
  • commit: e34daad
  • evidence-ref: local .tmp/flame-mobile-toc/build.log, /tmp/flame-mobile-toc-check.mjs, /tmp/flame-empty-mobile-toc-push.log

@vercel

vercel Bot commented Nov 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Nov 7, 2026 10:51am UTC

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Mode: standard. Verdict: READY.

Reviewed changes

I reviewed the MobileBar change in @docubook/flame that shows a static title, not an expandable empty panel, on pages that have no TOC entries.

  • Static title when tocs is empty: the toggle button, progress circle, chevron, and "No headings on this page" panel are swapped for a plain truncating <span>. It keeps the -ml-1/pl-1/flex-1 layout, so Search and the drawer button stay in place and the title no longer takes a keyboard stop.
  • Accessibility on the toggle: aria-expanded={tocExpanded} is added, and the aria-label always includes the sections-read percentage. This is safe because the button now renders only when tocs is non-empty.
  • Dead code removal: the empty-state branch and the unused FileText import are gone.
  • Changeset: a patch changeset for @docubook/flame is included.

tocs comes from data-tocs on each full page load (createRoot in node/client.ts), so a page can't go from having TOC entries to having none while the panel is open. The hasToc && tocExpanded guard just makes that explicit.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@gitfromwildan gitfromwildan self-assigned this Nov 7, 2026
@gitfromwildan
gitfromwildan merged commit 0d8c42f into main Nov 7, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the fix/flame-empty-mobile-toc branch November 7, 2026 10:54
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