Skip to content

feat(flame): show the percentage inside the mobile toc progress ring - #473

Merged
gitfromwildan merged 1 commit into
mainfrom
feat/flame-toc-progress-number
Nov 5, 2026
Merged

gitfromwildan merged 1 commit into
mainfrom
feat/flame-toc-progress-number

Conversation

@gitfromwildan

Copy link
Copy Markdown
Member

Summary

Follow-up to #472. On the live site, the mobile TOC ring read as a loading spinner when partly filled and as a radio button when empty, and its percentage was not visible. The ring now shows the percentage inside it, and the empty space before it is tightened.

Ring

  • 28px instead of 18px, which still fits the 32px bar button with 2px to spare above and below. The percentage sits in its center, without a "%" sign, which would not fit.
  • 0: a muted "0" inside the empty track, so it no longer looks like a radio button.
  • 100: a filled primary disc with a check in primary-content.
  • Flat cap on the arc, so a partial ring reads as a gauge, not a spinner.
  • Only the ring group is rotated to start at 12 o'clock, so the number stays upright.
  • Unchanged: it stays aria-hidden, the button's accessible name carries the percentage, and the fill skips its animation under prefers-reduced-motion.

Spacing before the ring

The TOC button now starts where the 32px menu trigger ends: -ml-1 cancels the row's gap-1, and pl-1 replaces the button's default left padding. The menu trigger keeps its 32×32 tap target, and the two buttons touch without overlapping.

Verification

Built flame's docs and measured docs/getting-started/introduction in Chromium, emulating a 390px phone with touch. The "before" column is the live docubook.pro, which runs main.

Before After
Menu trigger tap target 32×32px 32×32px
Dead strip between the buttons 4px 0px
Menu dots to ring 32px 20px
Ring 18px, no number 28px, number inside
  • A tap 1px left of the seam lands on the menu trigger and 1px right on the TOC button. On main, a tap in the 4px strip landed on neither.
  • At the top, middle and end of the page the ring shows "0", "50" and the check, in both the light and dark themes.
  • The ring tests cover the number inside the ring, the 28px size, the flat cap, the upright number, the muted 0, and the check at 100.
  • 814 flame tests pass. tsc, oxlint, the docs build and the pre-push hook pass.

- The ring grows from 18px to 28px, which still fits the 32px bar
  button, and shows the percentage in its center without a "%" sign.
- At 0 it shows a muted "0", so an empty ring no longer looks like a
  radio button. At 100 it becomes a filled disc with a check.
- The arc has a flat cap, so a partly filled ring no longer reads as a
  loading spinner. Only the ring group is rotated, so the number stays
  upright.

The TOC button now starts where the 32px menu trigger ends (-ml-1
cancels the row gap) and has a 4px left padding. The 4px dead strip
between the two buttons is gone and the menu dots sit 20px from the ring
instead of 32px. Both tap targets keep their size and do not overlap.
@vercel

vercel Bot commented Nov 5, 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 5, 2026 5:07pm 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.

Reviewed changes

Standard-mode review of the mobile TOC progress ring redesign and the tighter spacing in MobileBar. The ring tests (13) and oxlint on the touched files pass locally.

  • Bigger ring with a number — TocProgressCircle grows to 28px and shows the rounded percentage, without a % sign, in an upright <text>. Only the ring <g> is rotated, and the -rotate-90 class is gone from the <svg>.
  • End states — at 0 there is a muted fill-base-content/60 "0" with no arc. At 100 a separate branch draws a filled fill-primary disc with a stroke-primary-content check.
  • Flat cap — the arc uses strokeLinecap="butt", and the reduced-motion opt-out on the transition is kept.
  • Spacing — -ml-1 pl-1 on the TOC button cancels the row's gap-1, so it starts where the 32px menu trigger ends. Both tap targets stay intact.
  • Tests and changeset — tests cover size, cap, rotation scope, the 0 and 100 states, and clamping. There is a @docubook/flame patch changeset.

Overall: READY. No CRITICAL or HIGH findings, and no top priorities.

The only edge cases I found are rounding at the extremes. With 200 or more TOC entries, progress of 0.995 or more would show the check before the end, and progress under 0.005 would show a "0" next to a sliver of arc. Real docs pages don't have that many headings, so I didn't raise them as findings.

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

@gitfromwildan
gitfromwildan merged commit 29e6524 into main Nov 5, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the feat/flame-toc-progress-number branch November 5, 2026 17:11
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