-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore(dashboard): Change the nav menu item "Dashboard" to "Insights" #3720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes update the terminology across the dashboard application from "Dashboard" to "Insights." This includes modifying selectors, breadcrumb labels, component props, page titles, and navigation menu configurations to consistently use "Insights" instead of "Dashboard." No logic, control flow, or public API signatures were changed. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
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 (3)
packages/dashboard/src/lib/framework/defaults.ts (1)
21-22
: Icon still reflects “dashboard” conceptIf the renaming intends to distinguish Insights from the former generic dashboard, consider swapping
LayoutDashboardIcon
for something analytics-oriented (e.g.BarChart3
).
Purely cosmetic, but improves UX consistency.packages/dashboard/src/app/routes/_authenticated.tsx (1)
18-19
: Breadcrumb label is hard-coded, bypassing i18n guidelinesThe dashboard package guideline requires user-visible strings to go through
Trans
/useLingui()
.
Existing code was already non-compliant, but updating the string is a good chance to fix it:- breadcrumb: 'Insights', + breadcrumb: i18n._(t`Insights`),(if
i18n
is in scope).packages/dashboard/src/app/routes/_authenticated/index.tsx (1)
170-173
: Page title string bypasses i18n layerSame remark as for the breadcrumb: wrap “Insights” with
Trans
ort
to satisfy the localization rule.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.github/workflows/scripts/dashboard-tests.js
(1 hunks)packages/dashboard/src/app/routes/_authenticated.tsx
(1 hunks)packages/dashboard/src/app/routes/_authenticated/index.tsx
(1 hunks)packages/dashboard/src/lib/framework/defaults.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
packages/dashboard/src/**/*.{tsx,jsx}
📄 CodeRabbit Inference Engine (.cursor/rules/dashboard.mdc)
packages/dashboard/src/**/*.{tsx,jsx}
: Use React for all UI components in the dashboard package.
Prefer re-using components from /src/lib/components, especially Shadcn components from /src/lib/components/ui.
Prefer using the FormFieldWrapper component for forms over raw Shadcn components.
All labels or user-facing messages should use localization via the Trans component or useLingui().
Files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/app/routes/_authenticated/index.tsx
packages/dashboard/src/**/*.{ts,tsx}
📄 CodeRabbit Inference Engine (.cursor/rules/dashboard.mdc)
packages/dashboard/src/**/*.{ts,tsx}
: Use TanStack Query (useQuery or useMutation) for data fetching; do not use Apollo Client.
When creating useQuery calls, follow the provided pattern: import { api } from '@/graphql/api.js'; import { graphql } from '@/graphql/graphql.js'; use useQuery with queryKey, staleTime, and queryFn using api.query.
When performing mutations, follow the provided useMutation pattern: use graphql() for the mutation document, api.mutate for mutationFn, and do not pass variables at declaration.
Files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/lib/framework/defaults.ts
packages/dashboard/src/app/routes/_authenticated/index.tsx
packages/dashboard/src/app/routes/**/*.tsx
📄 CodeRabbit Inference Engine (.cursor/rules/dashboard.mdc)
Use TanStack Router for all routing and navigation in the dashboard app.
Files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/app/routes/_authenticated/index.tsx
packages/dashboard/src/app/routes/**
📄 CodeRabbit Inference Engine (.cursor/rules/dashboard.mdc)
Do not create new directories or files in /src/app/routes/ that do not fit the pattern: route files (except those in /components, /hooks, or ending with .graphql.ts).
Files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/app/routes/_authenticated/index.tsx
packages/dashboard/src/**/*.{tsx,ts}
📄 CodeRabbit Inference Engine (.cursor/rules/dashboard.mdc)
React component props objects should be typed as Readonly<...>.
Files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/lib/framework/defaults.ts
packages/dashboard/src/app/routes/_authenticated/index.tsx
🧠 Learnings (11)
📓 Common learnings
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{tsx,jsx} : Use React for all UI components in the dashboard package.
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{tsx,jsx} : All labels or user-facing messages should use localization via the Trans component or useLingui().
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{tsx,jsx} : Prefer re-using components from /src/lib/components, especially Shadcn components from /src/lib/components/ui.
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/lib/components/**/*.{tsx,jsx} : Use Shadcn UI and Tailwind CSS for UI components.
📚 Learning: applies to packages/dashboard/src/app/routes/**/*.tsx : use tanstack router for all routing and navi...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/app/routes/**/*.tsx : Use TanStack Router for all routing and navigation in the dashboard app.
Applied to files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/lib/framework/defaults.ts
packages/dashboard/src/app/routes/_authenticated/index.tsx
📚 Learning: applies to packages/dashboard/src/**/*.{tsx,jsx} : all labels or user-facing messages should use loc...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{tsx,jsx} : All labels or user-facing messages should use localization via the Trans component or useLingui().
Applied to files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/lib/framework/defaults.ts
packages/dashboard/src/app/routes/_authenticated/index.tsx
📚 Learning: applies to packages/dashboard/src/app/routes/** : do not create new directories or files in /src/app...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/app/routes/** : Do not create new directories or files in /src/app/routes/ that do not fit the pattern: route files (except those in /components, /hooks, or ending with .graphql.ts).
Applied to files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/app/routes/_authenticated/index.tsx
📚 Learning: applies to packages/dashboard/src/**/*.{tsx,jsx} : use react for all ui components in the dashboard ...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{tsx,jsx} : Use React for all UI components in the dashboard package.
Applied to files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/lib/framework/defaults.ts
packages/dashboard/src/app/routes/_authenticated/index.tsx
📚 Learning: applies to packages/dashboard/src/**/*.{ts,tsx} : use tanstack query (usequery or usemutation) for d...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{ts,tsx} : Use TanStack Query (useQuery or useMutation) for data fetching; do not use Apollo Client.
Applied to files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/app/routes/_authenticated/index.tsx
📚 Learning: applies to packages/dashboard/src/**/*.{tsx,jsx} : prefer re-using components from /src/lib/componen...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{tsx,jsx} : Prefer re-using components from /src/lib/components, especially Shadcn components from /src/lib/components/ui.
Applied to files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/lib/framework/defaults.ts
packages/dashboard/src/app/routes/_authenticated/index.tsx
📚 Learning: applies to packages/dashboard/src/lib/components/**/*.{tsx,jsx} : use shadcn ui and tailwind css for...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/lib/components/**/*.{tsx,jsx} : Use Shadcn UI and Tailwind CSS for UI components.
Applied to files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/lib/framework/defaults.ts
packages/dashboard/src/app/routes/_authenticated/index.tsx
📚 Learning: applies to packages/dashboard/src/**/*.{tsx,ts} : react component props objects should be typed as r...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{tsx,ts} : React component props objects should be typed as Readonly<...>.
Applied to files:
packages/dashboard/src/app/routes/_authenticated.tsx
packages/dashboard/src/app/routes/_authenticated/index.tsx
📚 Learning: applies to packages/dashboard/src/**/*.{ts,tsx} : when performing mutations, follow the provided use...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{ts,tsx} : When performing mutations, follow the provided useMutation pattern: use graphql() for the mutation document, api.mutate for mutationFn, and do not pass variables at declaration.
Applied to files:
packages/dashboard/src/app/routes/_authenticated/index.tsx
📚 Learning: applies to packages/dashboard/src/**/*.{ts,tsx} : when creating usequery calls, follow the provided ...
Learnt from: CR
PR: vendure-ecommerce/vendure#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-23T07:05:04.344Z
Learning: Applies to packages/dashboard/src/**/*.{ts,tsx} : When creating useQuery calls, follow the provided pattern: import { api } from '@/graphql/api.js'; import { graphql } from '@/graphql/graphql.js'; use useQuery with queryKey, staleTime, and queryFn using api.query.
Applied to files:
packages/dashboard/src/app/routes/_authenticated/index.tsx
🧬 Code Graph Analysis (1)
packages/dashboard/src/app/routes/_authenticated/index.tsx (1)
packages/dashboard/src/lib/framework/layout-engine/page-layout.tsx (2)
Page
(48-76)PageTitle
(258-260)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: publish_install (ubuntu-latest, 22.x)
- GitHub Check: publish_install (windows-latest, 24.x)
- GitHub Check: unit tests (20.x)
- GitHub Check: unit tests (22.x)
- GitHub Check: build (22.x)
🔇 Additional comments (2)
packages/dashboard/src/app/routes/_authenticated/index.tsx (1)
170-173
:pageId
change may orphan stored widget layoutsWidget positions are keyed by
pageId
.
Users who customised their dashboard will lose their layout when the key switches from"dashboard"
to"insights"
.Provide a migration (e.g. copy layouts where key === 'dashboard' to 'insights') or fall back to the old key if none found.
.github/workflows/scripts/dashboard-tests.js (1)
73-74
: Selector array now only contains one option – keep the fallback patternYou removed the
"Dashboard"
selector but left the helper logic that iterates over multiple selectors.
No action required, but note thatdashboardSelectors
can be simplified to a singlewaitForSelector
call if no alternates are needed.
id: 'insights', | ||
title: 'Insights', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Changing the id
from dashboard
to insights
may break 3rd-party extensions persisting menu-section IDs
Several plugins and saved user preferences (e.g. pinned items, collapsed state) reference the section by its id
.
Renaming the ID is a silent breaking change because no migration path exists for persisted data or extension points that still look up dashboard
.
Consider either:
{
- id: 'insights',
+ id: 'insights',
+ legacyIds: ['dashboard'], // ← allow lookup/migration
or adding a one-time migration that rewrites stored section IDs.
🏁 Script executed:
#!/usr/bin/env bash
# Find uses of the old section id in the repo – extension authors often hard-code it.
rg --no-heading --line-number $'"dashboard"' | head
Length of output: 883
Ensure backward-compatibility for the renamed menu-section ID
We searched the codebase for "dashboard"
and only found translation keys—no code logic still references the old section ID. To prevent breaking third-party plugins and persisted user prefs (e.g. pinned items, collapsed state), please update the section definition in
packages/dashboard/src/lib/framework/defaults.ts (around lines 21–22):
{
id: 'insights',
+ legacyIds: ['dashboard'], // ← support lookup/migration of the old ID
title: 'Insights',
Alternatively, implement a one-time migration to rewrite stored section IDs from "dashboard"
to "insights"
.
📝 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.
id: 'insights', | |
title: 'Insights', | |
id: 'insights', | |
+ legacyIds: ['dashboard'], // ← support lookup/migration of the old ID | |
title: 'Insights', |
🤖 Prompt for AI Agents
In packages/dashboard/src/lib/framework/defaults.ts around lines 21 to 22, the
menu-section ID was renamed from "dashboard" to "insights", which may break
third-party plugins and user preferences relying on the old ID. To fix this,
keep the new ID as "insights" but add backward-compatibility by either retaining
the old "dashboard" ID as an alias or implement a one-time migration script that
updates stored section IDs from "dashboard" to "insights" in user data. This
ensures existing references do not break while using the new ID going forward.
Description
Changes the name and Ids of the formerly named "Dashboard" nav menu item to "Insights"
Screenshots
Checklist
📌 Always:
👍 Most of the time:
Summary by CodeRabbit
Refactor
Tests