Skip to content

setup-the-dashbaord-perfectly#5

Merged
sreenandpk merged 1 commit into
developfrom
feature/FRO-4-live-stock-rate
Jul 16, 2026
Merged

setup-the-dashbaord-perfectly#5
sreenandpk merged 1 commit into
developfrom
feature/FRO-4-live-stock-rate

Conversation

@midhun123758

@midhun123758 midhun123758 commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added an Explore landing page with a live market dashboard.
    • Added market category tabs and gainers/losers lists with prices and percentage changes.
    • Added responsive layouts and loading states while market data is unavailable.
    • Added an Explore button to the globe view.
  • Navigation

    • Users now go to Explore after signing in or completing authentication.
    • Added a dedicated Explore route.

@coderabbitai

coderabbitai Bot commented Jul 16, 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 Plus

Run ID: eebdc658-be26-4cb9-9764-cf49b52c6f58

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:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/FRO-4-live-stock-rate

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
src/styles/components/live-market.css (2)

10-10: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix Stylelint font-family-name-quotes error.

Stylelint expects no quotes around the font family name "Inter" as it does not contain spaces or special characters.

🛠 Proposed fix
-  font-family: 'Inter', sans-serif;
+  font-family: Inter, sans-serif;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/styles/components/live-market.css` at line 10, Update the font-family
declaration in the live-market styles to use the unquoted Inter font name while
preserving the sans-serif fallback.

Source: Linters/SAST tools


3-3: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix Stylelint import-notation error.

Stylelint recommends using string notation instead of the url() function for @import rules.

🛠 Proposed fix
-@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
+@import 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/styles/components/live-market.css` at line 3, Update the Google Fonts
`@import` rule in live-market.css to use a quoted string import path instead of
wrapping the URL in url(), preserving the existing font query parameters.

Source: Linters/SAST tools

src/pages/LiveMarketDashboard.tsx (2)

68-68: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Avoid using any for stock items.

Please replace any with a proper interface for the stock item to benefit from TypeScript's type checking.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/LiveMarketDashboard.tsx` at line 68, Replace the any annotation on
the stock parameter in the marketData.gainers map with a dedicated stock-item
interface, defining the fields used by the rendering logic and applying that
interface consistently to the gainers data.

8-26: 🩺 Stability & Availability | 🔵 Trivial | ⚖️ Poor tradeoff

Add WebSocket reconnection logic.

The current implementation does not attempt to reconnect if the WebSocket connection drops or fails to connect initially. In a live market dashboard, connection resilience is critical. Consider adding an onclose handler with an exponential backoff retry mechanism, or using a library like react-use-websocket.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/LiveMarketDashboard.tsx` around lines 8 - 26, The WebSocket setup
in the useEffect hook lacks reconnection after connection failure or closure.
Add an onclose-driven exponential backoff retry mechanism for the dashboard
WebSocket, ensure retries are cancelled during cleanup, and preserve the
existing message parsing and setMarketData behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/LiveMarketDashboard.tsx`:
- Line 10: Update the WebSocket initialization in LiveMarketDashboard to derive
the endpoint from the current host/protocol or an approved environment variable
instead of hardcoding localhost, while preserving the existing dashboard
WebSocket path and using the appropriate ws/wss protocol for the deployment
context.

---

Nitpick comments:
In `@src/pages/LiveMarketDashboard.tsx`:
- Line 68: Replace the any annotation on the stock parameter in the
marketData.gainers map with a dedicated stock-item interface, defining the
fields used by the rendering logic and applying that interface consistently to
the gainers data.
- Around line 8-26: The WebSocket setup in the useEffect hook lacks reconnection
after connection failure or closure. Add an onclose-driven exponential backoff
retry mechanism for the dashboard WebSocket, ensure retries are cancelled during
cleanup, and preserve the existing message parsing and setMarketData behavior.

In `@src/styles/components/live-market.css`:
- Line 10: Update the font-family declaration in the live-market styles to use
the unquoted Inter font name while preserving the sans-serif fallback.
- Line 3: Update the Google Fonts `@import` rule in live-market.css to use a
quoted string import path instead of wrapping the URL in url(), preserving the
existing font query parameters.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 579a653c-81c3-4272-8505-a8a95efddfb3

📥 Commits

Reviewing files that changed from the base of the PR and between 7f3f7a8 and 9f4e20c.

📒 Files selected for processing (6)
  • src/App.tsx
  • src/components/AuthCallback.tsx
  • src/constants/routes.constants.ts
  • src/features/globe/GlobeView.tsx
  • src/pages/LiveMarketDashboard.tsx
  • src/styles/components/live-market.css


useEffect(() => {
// 1. Connect to the FastAPI WebSocket Bridge
const ws = new WebSocket("ws://localhost:8000/dashboard/ws/market");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Avoid hardcoding localhost URLs.

The WebSocket connection uses a hardcoded localhost URL, which will fail when the application is deployed to production or accessed from another device. Consider deriving the WebSocket URL from the current window location or using an environment variable.

🛠 Proposed fix

For example, using Vite environment variables:

-        const ws = new WebSocket("ws://localhost:8000/dashboard/ws/market");
+        // Fallback to localhost if the env variable is not set
+        const wsUrl = import.meta.env.VITE_WS_URL || "ws://localhost:8000";
+        const ws = new WebSocket(`${wsUrl}/dashboard/ws/market`);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const ws = new WebSocket("ws://localhost:8000/dashboard/ws/market");
// Fallback to localhost if the env variable is not set
const wsUrl = import.meta.env.VITE_WS_URL || "ws://localhost:8000";
const ws = new WebSocket(`${wsUrl}/dashboard/ws/market`);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/LiveMarketDashboard.tsx` at line 10, Update the WebSocket
initialization in LiveMarketDashboard to derive the endpoint from the current
host/protocol or an approved environment variable instead of hardcoding
localhost, while preserving the existing dashboard WebSocket path and using the
appropriate ws/wss protocol for the deployment context.

@sreenandpk
sreenandpk merged commit 76e402a into develop Jul 16, 2026
1 of 2 checks passed
@sreenandpk
sreenandpk deleted the feature/FRO-4-live-stock-rate branch July 16, 2026 13:21
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.

2 participants