fix: resolve #167 #168 #169 #170 (flex/block conflict, color-only badges, hydration flash, logout race) - #286
Merged
Conversation
dupdab#167 - Remove conflicting block class from scope checkbox labels - src/app/dashboard/settings/page.tsx: strip redundant `block` from the scope-selection label; `flex` is the correct display value. dupdab#168 - Add per-status icons so state is not color-only (WCAG 1.4.1) - src/lib/utils.ts: export STATUS_ICONS (LucideIcon map) alongside STATUS_COLORS with a unique icon per status value. - src/app/dashboard/settlements/page.tsx: render icon inside every status badge (mobile card + table row). - src/app/dashboard/admin/settlements/page.tsx: consolidate local statusIcons onto the shared STATUS_ICONS from utils.ts. dupdab#169 - Prevent blank flash / premature logout on hard refresh - src/lib/store.ts: add hasHydrated flag, set to true via persist onRehydrateStorage callback. - src/app/dashboard/layout.tsx: show a loading spinner until hasHydrated is true; only evaluate the auth guard afterwards. dupdab#170 - Remove duplicate localStorage write path for auth token - src/lib/store.ts: drop the manual localStorage.setItem / removeItem calls; Zustand persist's single write path via the dupdub-auth key is sufficient and avoids transient two-key disagreement on logout.
|
@Darkdruce Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Fixes four independent bugs and accessibility issues reported in issues #167–#170.
Changes
#167 — Conflicting
flex/blockclasses on scope checkboxesFile:
src/app/dashboard/settings/page.tsxRemoved the redundant
blockTailwind class from the scope-selection<label>elements.flexis the correct and only display value; having both caused unpredictable cascade behaviour across browsers and Tailwind builds.#168 — Status conveyed by color alone (WCAG 1.4.1)
Files:
src/lib/utils.ts,src/app/dashboard/settlements/page.tsx,src/app/dashboard/admin/settlements/page.tsxSTATUS_ICONSexport toutils.ts— aRecord<string, LucideIcon>with a unique, distinguishing icon for every status value (Clock,AlertCircle,CheckCircle,RefreshCw,XCircle,HelpCircle).settlements/page.tsx(mobile card + table row) to render the icon alongside the text label.statusIconsmap inadmin/settlements/page.tsxonto the sharedSTATUS_ICONS, giving all three surfaces a consistent icon set.#169 — Blank page flash / premature logout on hard refresh
Files:
src/lib/store.ts,src/app/dashboard/layout.tsxhasHydrated: booleanflag to the Zustand auth store, set totrueinside thepersistmiddleware'sonRehydrateStoragecallback (the only reliable point at which localStorage has been read).hasHydrated === true, and only then evaluates the auth guard. This eliminates both the blank flash and the edge-case premature redirect that could occur iftokenwas read asnullbefore hydration completed.#170 — Duplicate
localStoragewrite paths on login/logoutFile:
src/lib/store.tsRemoved the explicit
localStorage.setItem('access_token', token)insetAuthandlocalStorage.removeItem('access_token')inlogout. The Zustandpersistmiddleware already owns a single, consistent write path via thedupdub-authkey; the manual calls created a second, decoupled key that could transiently disagree with the store state immediately after logout.What was verified
mainpre-date this branch (unrelatedmetadata/generateMetadatause clientconflicts and a JSX syntax error inpayments/page.tsx).Closes #167
Closes #168
Closes #169
Closes #170