chore: post-merge review nits (#2409 #2413 #2403 #2417 #2418) - #2420
Conversation
- 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
# Conflicts: # app/lib/mock-trade-data.ts
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) lackedrelative, so the.bg-gridoverlay anchored to the root layout and jumped under the sticky header after the route-transition animation. Addedrelative.feat(positions-bar): show on every route + horizontal scroll affordance #2417 — stale comments:
OtherMarketPositions.tsx's header referenced the deletedHIDDEN_ROUTESand claimed "usePortfolio has no cross-instance dedup" (false —loadPortfolioSharedhas a 12s TTL cache + in-flight join).usePortfolio.ts'senabledJSDoc and the 30s-interval comment described the deleted hidden-route behavior. All rewritten to describe current reality (PositionsBar renders on every route;enabledgates 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/hasExternalDataand theMIN_PERC_BARScomparison counted RAW candle arrays, so an all-non-finite / mostly-corrupt Percolator feed would win source selection, collapse to nothing afterfiniteCandles, defeat the Pyth/Gecko fallback, and mislabel the source badge. Gates now count finite-filtered arrays, memoized once and reused by thecandleDatamemo (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;_plotMinMaxskips NaN → null autoscale range →ensureNotNull('Value is null')on paint paths.fix(portfolio): make liquidation distance direction-aware #2413 — direction-unaware liq distance:
PositionPanel.tsxandPositionsDock.tsxusedMath.abs(cur-liq)/curfor 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-awarecomputeLiquidationDistancePct(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/resolveresponse silently fell back to admin oracle with adminPrice1.000000— a transient 503 could create a market at a wrong hardcoded price with no warning.useQuickLaunchnow exposesoracleResolveFailed(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/publishersnow normalizes the cache key (lowercase, strip0xprefix) so case/prefix variants of the same feed share one bounded-cache entry, and no longer caches error-sentinel results (publisherCount: nullfrom a Pythnet blip / bridge outage) — those return withCache-Control: no-storeso a transient failure isn't pinned as "no publishers" for 5 minutes.Verification
npx tsc --noEmit: 0 errorsvitest run: identical results on this branch and pristineorigin/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