Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughDocumentation adds two validation rules for liquidation history and historical rate loading signals. Market table rendering centralizes historical rate cell logic with a helper function. Metrics query hooks introduce a new liquidation presence check with fallback to handle unavailable data. Changes
Sequence Diagram(s)sequenceDiagram
participant Comp as Market Table Component
participant Hook as useEverLiquidated
participant MetricsHook as useMarketMetricsMap
participant LiqHook as useMarketLiquidationPresence
participant API as GraphQL API
Comp->>Hook: useEverLiquidated(chainId, uniqueKey)
Hook->>MetricsHook: Check metricsMap for everLiquidated
alt everLiquidated available
MetricsHook->>Hook: Return precomputed flag
Hook->>Comp: Boolean result
else Metrics still loading or unavailable
Hook->>LiqHook: useMarketLiquidationPresence(chainId, uniqueKey)
LiqHook->>API: Query MARKET_LIQUIDATION_PRESENCE_QUERY
API-->>LiqHook: Liquidation records found?
LiqHook-->>Hook: hasLiquidationPresence boolean
Hook->>Comp: everLiquidated || hasLiquidationPresence
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/features/markets/components/table/market-table-body.tsx (1)
38-54: Clean helper function. Logic correctly implements the three-state pattern from validation rule 58.Minor nit:
color="#f45f2d"is hardcoded. Consider using a CSS variable or theme token if one exists for brand orange.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/features/markets/components/table/market-table-body.tsx` around lines 38 - 54, In renderHistoricalRateCell replace the hardcoded PulseLoader color="#f45f2d" with the app's theme token or CSS variable (e.g. use theme.colors.brandOrange or a CSS var like var(--brand-orange)) so the loader uses the shared brand orange; update the PulseLoader prop to reference the token (via styled/theme hook or inline var) in the renderHistoricalRateCell function to keep styling consistent with the design system.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/features/markets/components/table/market-table-body.tsx`:
- Around line 38-54: In renderHistoricalRateCell replace the hardcoded
PulseLoader color="#f45f2d" with the app's theme token or CSS variable (e.g. use
theme.colors.brandOrange or a CSS var like var(--brand-orange)) so the loader
uses the shared brand orange; update the PulseLoader prop to reference the token
(via styled/theme hook or inline var) in the renderHistoricalRateCell function
to keep styling consistent with the design system.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d0889f80-291e-4a2e-a4b4-7ba3c0d561e2
📒 Files selected for processing (4)
AGENTS.mdsrc/features/markets/components/table/market-table-body.tsxsrc/hooks/queries/useMarketMetricsQuery.tssrc/hooks/useProcessedMarkets.ts
Summary by CodeRabbit
New Features
Bug Fixes