fix: resolve issues #478-#481 (theme tokens, credit formatting, CSS validation, QueryClient defaults) - #504
Merged
ritaifeoluwa merged 1 commit intoSep 25, 2026
Conversation
- SmartDropLabs#478: Route colors that bypassed the theme through semantic tokens: add app.overlay and app.toastRetryBorder/app.toastRetryHoverBg (replacing the blackAlpha.600 / whiteAlpha.600 / blackAlpha.400 literals in OnboardingOverlay and useToast), and swap hardcoded #ff8080 / #2a1414 / #2a2412 / #f6c453 error-warning hexes for app.errorFg / app.errorBg / app.warningBg / app.warningFg in alerts, farm, pool detail, webhooks, history, UnlockModal and BoostModal - SmartDropLabs#479: Drop PlatformStats' local always-divide-by-1M credit formatter and use the shared formatCredits from src/lib/soroban.ts, which handles K/M suffixes, placeholders and non-numeric input consistently - SmartDropLabs#480: Add scripts/check-css.mjs to parse every stylesheet with PostCSS and run it as part of `pnpm build` (plus a `lint:css` script and a vitest guard), so a syntax error in globals.css fails the pipeline with a file:line diagnostic instead of silently un-styling the app - SmartDropLabs#481: Give the shared QueryClient defaultOptions.queries a baseline staleTime (30s) and gcTime (5m); hooks that need a different freshness window still override per-query, but queries without explicit options no longer fall back to React Query's staleTime: 0 Verified with `pnpm typecheck`, `vitest run`, `pnpm build` and `pnpm bundle:budget`. The test failures left in `vitest run` also fail on main (soroban.service/leaderboard/useLeaderboard timing and alerts retry flakes) and are unrelated to these changes.
|
@dev-markdavid 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! 🚀 |
❌ Deploy Preview for smart-drop failed.
|
❌ Deploy Preview for spiffy-melomakarona-eb1e8a failed.
|
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.
Closes #478, #479, #480, #481.
closes #478 — semantic tokens don't cover all Chakra color references
app.overlay,app.toastRetryBorderandapp.toastRetryHoverBgtosrc/lib/theme.ts, replacing the rawblackAlpha.600/whiteAlpha.600/blackAlpha.400/whiteAlpha.200/blackAlpha.100literals inOnboardingOverlayanduseToast(the retry tints now flip with color modevia tokens instead of
useColorModeValue, souseToastno longer reads thecolor mode itself).
#ff8080→app.errorFg,#2a1414→app.errorBg,#2a2412→app.warningBg,#f6c453→app.warningFgacrossalerts,farm,farm/[poolId],webhooks,history,UnlockModalandBoostModal.Light mode now gets the accessible variants (
#b3261eon#fdececetc.)instead of the dark-mode values hardcoded everywhere.
styling system (chart/SVG fills in
TvlChart,Sparkline,NavbarTailwindgradient) still take literal color values.
closes #479 — PlatformStats used its own credit formatter
formatRawCredits(always÷ 1_000_000) and now use theshared
formatCreditsfromsrc/lib/soroban.ts, which applies K/M suffixes,handles
-/—/non-numeric input and matches every other credit display.8500000.0M XLM).closes #480 — no CSS validation in the build pipeline
scripts/check-css.mjsparses every.cssfile undersrcwith PostCSSand reports
file:line:column - reason, exiting non-zero on any syntax error.buildnow runsnode scripts/check-css.mjs && next build(so the existing CIpnpm run buildstep is covered), plus astandalone
lint:cssscript.__tests__/css-validation.test.ts, which reuses the script'svalidateCssFiles()sopnpm testfails on invalid CSS too.closes #481 — QueryClient missing defaultOptions
src/context/index.tsxnow setsdefaultOptions.queries.{staleTime: 30_000, gcTime: 5 * 60_000}, so querieswithout explicit options (Prices/Airdrops/Webhooks/Alerts) no longer inherit
React Query's
staleTime: 0. Per-query overrides inuseSorobanQuery.ts(5s/10s/15s/60s) still win.
Verification
pnpm typecheck— cleanvitest run— new test passes; remaining failures reproduce onmain(soroban.service / leaderboard / useLeaderboard / alerts flakes)
pnpm build— CSS gate runs first and passes, build succeedspnpm bundle:budget— 715.8 / 780.0 KiB gzip, within budget