fix(pie): make hub % match weighted slice progress - #49
Merged
Conversation
Equal wedges made Basics (~25% of the deck) look like 1/8 of the wheel, so hub % captured looked higher than the filled area. Angle each slice by its question count and derive the hub from the same cleared/total math so filled area matches the center percentage. Co-authored-by: John Solly <jsolly@users.noreply.github.com>
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.
Problem
The center “% captured” is
cleared questions / all questions, but every lifecycle slice was drawn as an equal 1/8 wedge. Basics has 50 questions (~25% of the deck) while other units have 22 each (~11%). Filling Basics looked like “1/8 of the pie,” so a hub reading like 20% could look higher than the filled area when eye-averaging equal wedges.Example that matches the reported confusion: Basics at 80% with everything else empty → hub correctly shows 20% (40/204), but under equal wedges that filled area looked closer to ~10%.
Fix
cleared/total) used for radial fill.src/lib/pie-progress.tsplusscripts/verify-pie-progress.mjscovering empty, Basics-heavy ~20%, single-slice, even 50%, and full-capture scenarios.Verify
UI smoke (seeded localStorage): hub matched expected for empty 0%, userLike20 20%, basics80 20%, vehicleFull 11%, halfAll 50%, thinSpread 20%; mobile 390×844 for userLike20/halfAll. Console clean.