chore: Railway deployment config for docs#171
Conversation
…move unused theme var - FormFieldContext/FormItemContext: initialize to null, move null checks before context is accessed so useFormField() throws early if used outside its providers - PopoverTitle: render <h2> instead of <div> for semantic correctness - role-selector: clear stale roles (setRoles([])) before fetching new guild's role list to prevent stale IDs from being applied - theme-toggle: remove unused 'theme' destructure from useTheme()
…variant in command.tsx - DialogHeader (with sr-only title/description) must be a descendant of DialogContent for Radix Dialog accessibility (title/description bound to the dialog role via aria-labelledby/aria-describedby) - **:data-[slot=command-input-wrapper]:h-12 was an invalid Tailwind variant; corrected to *:data-[slot=command-input-wrapper]:h-12
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (21)
✨ 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 |
There was a problem hiding this comment.
Pull request overview
Adds Railway deployment configuration intended for a Mintlify docs site, and also introduces a set of new/updated web UI components (theme support, Radix-based primitives, and dashboard config form/selector refactors).
Changes:
- Add Railway build/deploy configuration pointing to a
docs/Dockerfilefor Mintlify. - Add theme provider + theme toggle and wire it into the app header/layout.
- Add/adjust several UI primitives and dashboard config sections (switches, inputs, selectors, dialog/command/popover wrappers).
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
railway.json |
Railway build/deploy configuration (Dockerfile-based) for docs deployment. |
docs/Dockerfile |
Container definition for running Mintlify in a Railway deployment. |
web/package.json |
Adds cmdk + next-themes dependencies to support new UI/theme features. |
pnpm-lock.yaml |
Lockfile updates for newly added dependencies. |
web/src/app/layout.tsx |
Removes hard-coded dark class to allow theme provider to control theme. |
web/src/components/theme-provider.tsx |
Adds a next-themes provider wrapper. |
web/src/components/theme-toggle.tsx |
Adds theme toggle UI (light/dark/system). |
web/src/components/providers.tsx |
Wraps app with ThemeProvider in addition to session + toaster. |
web/src/components/layout/header.tsx |
Adds ThemeToggle to the header UI. |
web/src/components/ui/dialog.tsx |
Refactors dialog wrapper implementation and adds optional close controls. |
web/src/components/ui/command.tsx |
Adds CmdK-based command components and a command dialog wrapper. |
web/src/components/ui/popover.tsx |
Adds popover wrapper components. |
web/src/components/ui/switch.tsx |
Adds a switch wrapper component used by dashboard sections. |
web/src/components/ui/checkbox.tsx |
Adds a checkbox wrapper component. |
web/src/components/ui/form.tsx |
Adds react-hook-form helpers/components (FormField, FormLabel, etc.). |
web/src/components/ui/role-selector.tsx |
Adds a Discord role multi-select component with async loading. |
web/src/components/ui/channel-selector.tsx |
Adds a Discord channel multi-select component with filtering and async loading. |
web/src/components/dashboard/config-sections/WelcomeSection.tsx |
Refactors to use shared Switch, Label, Textarea UI components. |
web/src/components/dashboard/config-sections/TriageSection.tsx |
Refactors inputs/toggles to use shared UI primitives. |
web/src/components/dashboard/config-sections/ModerationSection.tsx |
Refactors inputs/toggles to use shared UI primitives. |
web/src/components/dashboard/config-sections/AiSection.tsx |
Refactors AI enabled toggle to use shared Switch + Label. |
web/src/components/dashboard/config-sections/NumberField.tsx |
Refactors numeric input to use shared Input + Label and generated ids. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (5)
web/src/components/layout/header.tsx:51
ThemeToggleis now rendered inHeader, but there are existing component tests forHeader/Providersand this new behavior isn’t covered. Please add/update tests (and any needed next-themes mocks/providers) to ensure the theme toggle renders and basic interactions work.
<div className="ml-auto flex items-center gap-4">
<ThemeToggle />
{status === 'loading' && (
web/src/components/theme-toggle.tsx:45
- The Moon icon is absolutely positioned, but the wrapping
Buttondoesn’t apply a positioning context (e.g.relative). As a result, the Moon SVG may position relative to an ancestor/page instead of the button. Add a positioning class to the button (or otherwise ensure the icon is positioned relative to the trigger).
<Button variant="ghost" size="icon">
<Sun className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</Button>
docs/Dockerfile:6
- With Railway building from the repo root and pointing at
docs/Dockerfile,COPY . .in that Dockerfile will copy the entire repository into the image (not justdocs/). That increases build time/image size and can unintentionally include unrelated files. Consider adjusting the Dockerfile (or Railway build context) to copy only the docs subtree needed to run Mintlify.
WORKDIR /app
RUN npm install -g mintlify@latest
COPY . .
EXPOSE 3000
railway.json:3
- The PR title/description focus on Railway docs deployment, but this PR also includes substantial unrelated web UI/theme changes. Please update the PR description/title to reflect the expanded scope, or split into separate PRs so the deployment config can be reviewed/reverted independently.
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
docs/Dockerfile:4
- The
RUN npm install -g mintlify@lateststep pulls a third-party CLI from npm using the mutablelatesttag, which exposes this image to a supply-chain attack if themintlifypackage or its tag is ever compromised. Because this package is installed and then executed with full privileges inside the container, a malicious update could run arbitrary code and access any secrets available at build or runtime. Pinmintlifyto a specific trusted version (and update it intentionally) instead of relying on the floatinglatesttag.
RUN npm install -g mintlify@latest
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'use client'; | ||
|
|
||
| import * as React from 'react'; | ||
| import type { Label as LabelPrimitive } from 'radix-ui'; |
There was a problem hiding this comment.
LabelPrimitive is imported with import type, but it’s later referenced via typeof LabelPrimitive.Root (which requires a value import). This will cause a TypeScript error because type-only imports can’t be used in typeof queries. Import Label as a value (or change the prop typing to use a non-Radix label type, since the component renders the local Label).
| import type { Label as LabelPrimitive } from 'radix-ui'; | |
| import { Label as LabelPrimitive } from 'radix-ui'; |
|
| Filename | Overview |
|---|---|
| docs/Dockerfile | Adds Docker container config for Mintlify dev server deployment - correctly configured |
| railway.json | Railway deployment configuration - properly structured with restart policy |
| web/src/components/ui/channel-selector.tsx | New channel selector component - well-structured with proper error handling and TypeScript types |
| web/src/components/ui/role-selector.tsx | New role selector component - includes proper abort controller cleanup and accessibility labels |
| web/src/components/theme-toggle.tsx | Theme toggle component - properly prevents hydration mismatch with mounted state |
| web/src/app/layout.tsx | Removes hardcoded dark class to allow dynamic theme switching - correct change |
Last reviewed commit: e385af3
Summary
Add Railway deployment configuration for Mintlify documentation site.
Changes
Deployment
Once merged, docs can be deployed to Railway via:
Or connect the repo in Railway dashboard and auto-deploy on push.
Note: This requires the folder with Mintlify content (from PR #154) to be present.