feat(studio): refresh environments page UI#40
Conversation
… switching Replace plain bordered list with Card components in a responsive grid layout. Each environment card shows an icon (Shield for production, GitBranch for others), human-readable dates, an Active badge for the current environment, and a Switch to button. Delete action moves to a context menu dropdown.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
📝 WalkthroughWalkthroughUpdated the environments management page component to support active environment indication and switching. Restructured environment list items from simple articles to Card layouts with status badges, default/non-default icons, and conditional actions based on environment state. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/studio/src/lib/runtime-ui/app/admin/environments-page.tsx (1)
159-182: Replace hardcoded month abbreviations with a locale-aware formatter to match codebase patterns.The hardcoded
MONTH_ABBREVarray duplicates formatting logic already used elsewhere in the codebase. Other admin pages (mock-data.ts,trash-page.tsx,page.tsx,content/[type]/page.tsx) usetoLocaleDateString("en-US", { month: "short", day: "numeric" })for consistent date display. StandardizeformatDisplayDate()to use the same pattern for consistency and better i18n support.♻️ Suggested refactor
-const MONTH_ABBREV = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", -]; - function formatDisplayDate(value: string): string { const date = new Date(value); if (Number.isNaN(date.getTime())) { return value; } - return `${MONTH_ABBREV[date.getUTCMonth()]} ${date.getUTCDate()}, ${date.getUTCFullYear()}`; + return date.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric", timeZone: "UTC" }); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/studio/src/lib/runtime-ui/app/admin/environments-page.tsx` around lines 159 - 182, The function formatDisplayDate currently uses a hardcoded MONTH_ABBREV array; replace that with a locale-aware formatter to match other admin pages: remove MONTH_ABBREV and change formatDisplayDate to parse the input into a Date, return the original value if date.getTime() is NaN, otherwise use date.toLocaleDateString("en-US", { month: "short", day: "numeric" }) and append the UTC year (e.g. `, ${date.getUTCFullYear()}`) to preserve the previous output format; update references to formatDisplayDate accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/studio/src/lib/runtime-ui/app/admin/environments-page.tsx`:
- Around line 159-182: The function formatDisplayDate currently uses a hardcoded
MONTH_ABBREV array; replace that with a locale-aware formatter to match other
admin pages: remove MONTH_ABBREV and change formatDisplayDate to parse the input
into a Date, return the original value if date.getTime() is NaN, otherwise use
date.toLocaleDateString("en-US", { month: "short", day: "numeric" }) and append
the UTC year (e.g. `, ${date.getUTCFullYear()}`) to preserve the previous output
format; update references to formatDisplayDate accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7e91a2d2-0dda-4f9a-9852-77d41871ae4b
📒 Files selected for processing (1)
packages/studio/src/lib/runtime-ui/app/admin/environments-page.tsx
Summary
Test plan
/admin/environmentsand verify card layout renders correctlySummary by CodeRabbit
New Features
UI/Style