Skip to content

chore: post-merge review nits (#2409 #2413 #2403 #2417 #2418) - #2420

Merged
dcccrypto merged 2 commits into
playgroundfrom
chore/post-merge-review-nits
Jul 15, 2026
Merged

chore: post-merge review nits (#2409 #2413 #2403 #2417 #2418)#2420
dcccrypto merged 2 commits into
playgroundfrom
chore/post-merge-review-nits

Conversation

@dcccrypto

Copy link
Copy Markdown
Owner

Collects the verified review nits from the six PRs just squash-merged to playground (#2409, #2413, #2403, #2417, #2418, #2401 — no nit survived from #2401).

Fixes

  • fix(ui): stop .bg-grid overlay from pushing page content ~192px down #2409 — earn/[slab] grid overlay jump: the page wrapper (min-h-[calc(100dvh-48px)] animate-fade-in) lacked relative, so the .bg-grid overlay anchored to the root layout and jumped under the sticky header after the route-transition animation. Added relative.

  • feat(positions-bar): show on every route + horizontal scroll affordance #2417 — stale comments: OtherMarketPositions.tsx's header referenced the deleted HIDDEN_ROUTES and claimed "usePortfolio has no cross-instance dedup" (false — loadPortfolioShared has a 12s TTL cache + in-flight join). usePortfolio.ts's enabled JSDoc and the 30s-interval comment described the deleted hidden-route behavior. All rewritten to describe current reality (PositionsBar renders on every route; enabled gates on wallet connection).

  • fix(chart): stop "Value is null" crash from non-finite candle/price points #2403 — chart source gates count raw arrays: hasPercolatorData/hasPythData/hasExternalData and the MIN_PERC_BARS comparison counted RAW candle arrays, so an all-non-finite / mostly-corrupt Percolator feed would win source selection, collapse to nothing after finiteCandles, defeat the Pyth/Gecko fallback, and mislabel the source badge. Gates now count finite-filtered arrays, memoized once and reused by the candleData memo (identical filtering semantics, no double pass). Also corrected the wrong "demoted to a whitespace item" mechanism wording in the 4 comment sites (chart-style.ts JSDoc, two TradingChart comments, chart-style.test.ts): NaN rows are fulfilled plot rows; _plotMinMax skips NaN → null autoscale range → ensureNotNull('Value is null') on paint paths.

  • fix(portfolio): make liquidation distance direction-aware #2413 — direction-unaware liq distance: PositionPanel.tsx and PositionsDock.tsx used Math.abs(cur-liq)/cur for the liq-price color/warn thresholds, so a short whose mark had crossed ABOVE its liq price showed as "safe". Both now use the shared direction-aware computeLiquidationDistancePct (converted to the 0–1 fraction each site's thresholds consume; crossed boundary → 0 → critical red + warning banner). mock-trade-data.ts's hand-rolled equivalent also routes through the helper.

  • fix(oracle): prevent unbounded cache growth and cap resolver concurrency #2418 — silent $1.00 admin-oracle fallback: a non-ok/failed /api/oracle/resolve response silently fell back to admin oracle with adminPrice 1.000000 — a transient 503 could create a market at a wrong hardcoded price with no warning. useQuickLaunch now exposes oracleResolveFailed (set on !resp.ok/catch, reset on success/new mint), and the Quick Launch slab step shows a visible warning in the oracle-detection status area: price feed lookup failed, market will launch with admin oracle at $1.00, retry or proceed deliberately. The fallback itself is unchanged (launches are not blocked).

  • fix(oracle): prevent unbounded cache growth and cap resolver concurrency #2418 — publishers route cache: /api/oracle/publishers now normalizes the cache key (lowercase, strip 0x prefix) so case/prefix variants of the same feed share one bounded-cache entry, and no longer caches error-sentinel results (publisherCount: null from a Pythnet blip / bridge outage) — those return with Cache-Control: no-store so a transient failure isn't pinned as "no publishers" for 5 minutes.

Verification

  • npx tsc --noEmit: 0 errors
  • Targeted tests (chart-style, liquidation-distance, oracle-publishers ×2): 69/69 pass
  • Full vitest run: identical results on this branch and pristine origin/playground (aabc98b) — 2554 passed, 101 pre-existing env-dependent failures in both runs (waitlist/privy/wallet/rate-limit suites), failing-file sets byte-identical, zero new failures introduced.

🤖 Generated with Claude Code

- earn/[slab]: add `relative` to page wrapper so .bg-grid anchors locally (#2409)
- OtherMarketPositions/usePortfolio: rewrite stale comments (HIDDEN_ROUTES
  is gone; loadPortfolioShared dedup exists) to describe current reality (#2417)
- TradingChart: compute source-selection gates from finite-filtered candle
  counts so a corrupt Percolator feed can't defeat the Pyth/Gecko fallback;
  correct the "whitespace item" mechanism wording in 4 comment sites (#2403)
- PositionPanel/PositionsDock/mock-trade-data: route liq-distance through the
  direction-aware computeLiquidationDistancePct helper (#2413)
- useQuickLaunch: surface oracle-resolve failures (oracleResolveFailed) and
  warn in the wizard instead of silently launching at $1.00 admin price (#2418)
- oracle/publishers route: normalize cache key (lowercase, strip 0x) and
  return error-sentinel results with no-store instead of caching them (#2418)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
percolator-launch Ready Ready Preview, Comment Jul 15, 2026 7:19am
percolator-mainnet Ready Ready Preview, Comment Jul 15, 2026 7:19am
percolator-playground Error Error Jul 15, 2026 7:19am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9b050cc-357c-4f6f-96ee-4a2144117b79

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/post-merge-review-nits

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dcccrypto
dcccrypto merged commit f4a4623 into playground Jul 15, 2026
13 of 14 checks passed
@dcccrypto
dcccrypto deleted the chore/post-merge-review-nits branch July 15, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant