Skip to content

fix: resolve issues #478-#481 (theme tokens, credit formatting, CSS validation, QueryClient defaults) - #504

Merged
ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
dev-markdavid:fix/resolve-bounty-issues-478-481
Sep 25, 2026
Merged

ritaifeoluwa merged 1 commit into
SmartDropLabs:mainfrom
dev-markdavid:fix/resolve-bounty-issues-478-481

Conversation

@dev-markdavid

Copy link
Copy Markdown

Closes #478, #479, #480, #481.

closes #478 — semantic tokens don't cover all Chakra color references

  • Added app.overlay, app.toastRetryBorder and app.toastRetryHoverBg to
    src/lib/theme.ts, replacing the raw blackAlpha.600 / whiteAlpha.600 /
    blackAlpha.400 / whiteAlpha.200 / blackAlpha.100 literals in
    OnboardingOverlay and useToast (the retry tints now flip with color mode
    via tokens instead of useColorModeValue, so useToast no longer reads the
    color mode itself).
  • Replaced hardcoded alert/error hexes with the existing tokens they duplicate:
    #ff8080 → app.errorFg, #2a1414 → app.errorBg, #2a2412 →
    app.warningBg, #f6c453 → app.warningFg across alerts, farm,
    farm/[poolId], webhooks, history, UnlockModal and BoostModal.
    Light mode now gets the accessible variants (#b3261e on #fdecec etc.)
    instead of the dark-mode values hardcoded everywhere.
  • Out of scope by design: fixed brand constants consumed outside Chakra's
    styling system (chart/SVG fills in TvlChart, Sparkline, Navbar Tailwind
    gradient) still take literal color values.

closes #479 — PlatformStats used its own credit formatter

  • Deleted the local formatRawCredits (always ÷ 1_000_000) and now use the
    shared formatCredits from src/lib/soroban.ts, which applies K/M suffixes,
    handles -/—/non-numeric input and matches every other credit display.
  • Snapshot output for the existing fixture is unchanged (8500000.0M XLM).

closes #480 — no CSS validation in the build pipeline

  • New scripts/check-css.mjs parses every .css file under src with PostCSS
    and reports file:line:column - reason, exiting non-zero on any syntax error.
  • Wired into the pipeline: build now runs node scripts/check-css.mjs && next build (so the existing CI pnpm run build step is covered), plus a
    standalone lint:css script.
  • Added __tests__/css-validation.test.ts, which reuses the script's
    validateCssFiles() so pnpm test fails on invalid CSS too.

closes #481 — QueryClient missing defaultOptions

  • The shared client in src/context/index.tsx now sets
    defaultOptions.queries.{staleTime: 30_000, gcTime: 5 * 60_000}, so queries
    without explicit options (Prices/Airdrops/Webhooks/Alerts) no longer inherit
    React Query's staleTime: 0. Per-query overrides in useSorobanQuery.ts
    (5s/10s/15s/60s) still win.

Verification

  • pnpm typecheck — clean
  • vitest run — new test passes; remaining failures reproduce on main
    (soroban.service / leaderboard / useLeaderboard / alerts flakes)
  • pnpm build — CSS gate runs first and passes, build succeeds
  • pnpm bundle:budget — 715.8 / 780.0 KiB gzip, within budget

- 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.
@drips-wave

drips-wave Bot commented Sep 25, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@netlify

netlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for smart-drop failed.

Name Link
🔨 Latest commit 90a9cb5
🔍 Latest deploy log https://app.netlify.com/projects/smart-drop/deploys/6ab640c808c9ae0007710cc0

@netlify

netlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for spiffy-melomakarona-eb1e8a failed.

Name Link
🔨 Latest commit 90a9cb5
🔍 Latest deploy log https://app.netlify.com/projects/spiffy-melomakarona-eb1e8a/deploys/6ab640c894c5480008075576

@ritaifeoluwa
ritaifeoluwa merged commit 5d058e5 into SmartDropLabs:main Sep 25, 2026
0 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment