refactor: address review findings #51-54, #59#92
Merged
Conversation
- App.svelte: collapse dieColor/customDieColor into one derived; the else branch was dead code (#54) - App.svelte: latch the iOS PWA scroll-nudge so it fires once per session, not on every account swap (#59) - RollScreen + store: drop the {#key} block + setlistViewVersion; Svelte 5 reactivity already handles fresh-roll updates without a forced subtree remount (#51) - accounts.js: make scopedKey module-private; accountSlot is the public API now (#53) - utils.js: extract parseHex shared helper, drop the recursive fallback in each formatter (#52)
1168dd8 to
efb56bc
Compare
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.
Summary
Five small, independent cleanups from the comprehensive review.
App.svelte: collapsedieColor/customDieColorderives into one. Theelsebranch on the CSS-variable effect was dead code (the--accent*properties are never set whencustomDieColoris null in the first place).App.svelte: latch the iOS-PWA scroll-nudge so it only fires the first timeinitialSyncCompleteflips to true. Account swaps re-flip it true → false → true, so each swap was triggering another (harmless but wasted) nudge.RollScreen.svelte+stores/app.svelte.js: drop the{#key store.setlistViewVersion}wrapper and the matchingsetlistViewVersionstate. Svelte 5's reactivity already updates the keyed{#each}cleanly whengeneratedSetlistchanges — no need to tear down and rebuild the whole result subtree on every roll. Audit notes:SetlistSongCard'sexpandedstate now persists across rolls when the same song happens to repeat (keyed bysong.id). Reasonable UX..result-section'spop-inanimation now only runs the first time the section mounts (i.e., the first roll after an empty state). The dice button'slandedbounce + confetti still gives feedback on every subsequent roll.accounts.js: makescopedKeymodule-private.accountSlot(address).key(base)is the public API. Tests rewritten to exercise the same behavior throughaccountSlot.utils.js: extract aparseHex(hex) → [r, g, b]helper that internalizes the validate-and-fallback pattern, drop the recursive fallback in each formatter, and add atoHexBytehelper fordarkenHex.Closes #51, #52, #53, #54, #59 once merged.
Test plan
npm run lint— cleannpm test— 276/276 passnpm run build— succeedsnpm run test:e2e— 136/136 pass