Repository navigation
fix(flame): hide mobile toc controls when sections are empty - #501
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
✅ 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
tocsis 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-1layout, soSearchand 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 whentocsis non-empty. - Dead code removal: the empty-state branch and the unused
FileTextimport are gone. - Changeset: a patch changeset for
@docubook/flameis 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.
claude-opus-5-5 | 𝕏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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-expandedexposing the open state. Includes a patch changeset for@docubook/flame.Verification
git diff --check, and pre-push workspace lint/build (7 tasks) and commitlint: passed.Agent Context
.tmp/flame-mobile-toc/build.log,/tmp/flame-mobile-toc-check.mjs,/tmp/flame-empty-mobile-toc-push.log