-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: docs tab in main menu #642
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
WalkthroughThis change updates navigation options related to documentation in the dashboard UI. The MainMenu now features a "Documentation" button linking to an external docs site, while the NavBar removes its "Docs" menu item from the user dropdown. No other functionality or exported entities were modified. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MainMenu
participant ExternalDocs
User->>MainMenu: Clicks "Documentation" button
MainMenu->>ExternalDocs: Opens https://docs.maxun.dev in new tab
Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches
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 (1)
src/components/dashboard/MainMenu.tsx (1)
7-7
: Consider importing icons individually to improve tree-shakingImporting from the root
@mui/icons-material
barrel can prevent dead-code elimination and pull the whole icon set into the bundle in some build setups. Switching to per-icon imports keeps the production bundle lean.-import { AutoAwesome, FormatListBulleted, VpnKey, Usb, CloudQueue, Description } from "@mui/icons-material"; +import AutoAwesome from '@mui/icons-material/AutoAwesome'; +import FormatListBulleted from '@mui/icons-material/FormatListBulleted'; +import VpnKey from '@mui/icons-material/VpnKey'; +import Usb from '@mui/icons-material/Usb'; +import CloudQueue from '@mui/icons-material/CloudQueue'; +import Description from '@mui/icons-material/Description';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/dashboard/MainMenu.tsx
(2 hunks)src/components/dashboard/NavBar.tsx
(0 hunks)
💤 Files with no reviewable changes (1)
- src/components/dashboard/NavBar.tsx
<Button href='https://docs.maxun.dev' target="_blank" rel="noopener noreferrer" sx={buttonStyles} startIcon={<Description />}> | ||
Documentation | ||
</Button> |
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.
🛠️ Refactor suggestion
Hard-coded label and URL bypass i18n & environment configuration
The new “Documentation” button is helpful, but:
• The label is not run through t(…)
, breaking translation consistency.
• A fixed URL forces code changes for staging/enterprise deployments.
- <Button href='https://docs.maxun.dev' target="_blank" rel="noopener noreferrer" sx={buttonStyles} startIcon={<Description />}>
- Documentation
- </Button>
+ <Button
+ href={process.env.REACT_APP_DOCS_URL ?? 'https://docs.maxun.dev'}
+ target="_blank"
+ rel="noopener noreferrer"
+ sx={buttonStyles}
+ startIcon={<Description />}
+ >
+ {t('mainmenu.documentation')}
+ </Button>
Add mainmenu.documentation
to your i18n resource files and expose REACT_APP_DOCS_URL
(or equivalent) via CI/CD to keep the link configurable.
📝 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.
<Button href='https://docs.maxun.dev' target="_blank" rel="noopener noreferrer" sx={buttonStyles} startIcon={<Description />}> | |
Documentation | |
</Button> | |
<Button | |
href={process.env.REACT_APP_DOCS_URL ?? 'https://docs.maxun.dev'} | |
target="_blank" | |
rel="noopener noreferrer" | |
sx={buttonStyles} | |
startIcon={<Description />} | |
> | |
{t('mainmenu.documentation')} | |
</Button> |
🤖 Prompt for AI Agents
In src/components/dashboard/MainMenu.tsx around lines 114 to 116, the
"Documentation" button label is hard-coded and not internationalized, and the
URL is fixed, which prevents translation and environment-specific configuration.
To fix this, replace the label string with a call to the translation function
t('mainmenu.documentation') and replace the hard-coded URL with a configurable
environment variable like process.env.REACT_APP_DOCS_URL. Ensure the environment
variable is exposed via CI/CD and add the key mainmenu.documentation to the i18n
resource files.
Summary by CodeRabbit
New Features
Refactor