feat: add portal console admin routing split - #5098
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (121)
WalkthroughThis PR reorganizes the authenticated application into three primary workspaces (admin, console, chat) by moving routes from flat paths to nested namespaces, introducing workspace-aware navigation, comprehensive route guards, and legacy path redirects to maintain backward compatibility during the transition. ChangesMulti-Workspace Route Reorganization
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a “portal / chat / console / admin” routing split in the web frontend, migrating many previously top-level authenticated routes into dedicated /console (user) and /admin (operator) namespaces while adding legacy redirects to preserve old entry points.
Changes:
- Update authentication/OAuth and navigation defaults to route users to
/console(and admin pages to/admin/...) instead of legacy paths like/dashboard,/profile,/wallet. - Add new TanStack file-routes for
/consoleand/adminsections, plus legacy redirect routes under/_authenticated/*to keep old URLs working. - Introduce shared platform route helpers and centralized nav-group configuration for the new workspace split.
Reviewed changes
Copilot reviewed 120 out of 121 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web/default/src/routes/oauth/$provider.tsx | Redirect post-OAuth flows to /console and /console/profile. |
| web/default/src/routes/console/topup.tsx | Redirect /console/topup to /console/wallet with history flag. |
| web/default/src/routes/console/log.tsx | Redirect legacy /console/log to /console/usage-logs. |
| web/default/src/routes/(auth)/sign-in.tsx | Default authenticated redirect now goes to /console. |
| web/default/src/routes/(auth)/oauth.tsx | Default post-OAuth navigation now goes to /console. |
| web/default/src/routes/_authenticated/wallet/route.tsx | Legacy /wallet redirect to /console/wallet. |
| web/default/src/routes/_authenticated/users/route.tsx | Legacy /users redirect to /admin/users. |
| web/default/src/routes/_authenticated/usage-logs/route.tsx | Legacy /usage-logs* redirect to /console/usage-logs* (path-preserving). |
| web/default/src/routes/_authenticated/system-settings/route.tsx | Legacy /system-settings* redirect to /admin/system-settings* (path-preserving). |
| web/default/src/routes/_authenticated/subscriptions/route.tsx | Legacy /subscriptions redirect to /admin/subscriptions. |
| web/default/src/routes/_authenticated/redemption-codes/route.tsx | Legacy /redemption-codes redirect to /admin/redemption-codes. |
| web/default/src/routes/_authenticated/profile/route.tsx | Legacy /profile redirect to /console/profile. |
| web/default/src/routes/_authenticated/playground/route.tsx | Legacy /playground redirect to /console/playground. |
| web/default/src/routes/_authenticated/models/route.tsx | Legacy /models* redirect to /admin/models* (path-preserving). |
| web/default/src/routes/_authenticated/keys/route.tsx | Legacy /keys redirect to /console/keys. |
| web/default/src/routes/_authenticated/dashboard/route.tsx | Legacy /dashboard* redirect to /console/dashboard* (path-preserving). |
| web/default/src/routes/_authenticated/console/route.tsx | New console route group root. |
| web/default/src/routes/_authenticated/console/index.tsx | /console entry redirect to default dashboard section. |
| web/default/src/routes/_authenticated/console/dashboard/index.tsx | /console/dashboard redirect to default dashboard section. |
| web/default/src/routes/_authenticated/console/dashboard/$section.tsx | Console dashboard section route with section validation. |
| web/default/src/routes/_authenticated/console/keys/index.tsx | Console API keys page route + search schema. |
| web/default/src/routes/_authenticated/console/profile/index.tsx | Console profile page route. |
| web/default/src/routes/_authenticated/console/wallet/index.tsx | Console wallet page route + search schema. |
| web/default/src/routes/_authenticated/console/playground/index.tsx | Console playground route with module-enabled guard. |
| web/default/src/routes/_authenticated/console/usage-logs/index.tsx | /console/usage-logs redirect to default section. |
| web/default/src/routes/_authenticated/console/usage-logs/$section.tsx | Console usage-logs section route + search schema + redirects for invalid state. |
| web/default/src/routes/_authenticated/chat/index.tsx | New authenticated /chat placeholder route. |
| web/default/src/routes/_authenticated/chat/$chatId.tsx | Redirect invalid chat IDs to /chat and update UI strings. |
| web/default/src/routes/_authenticated/chat2link.tsx | Route “missing token” navigation updated to /console/keys. |
| web/default/src/routes/_authenticated/channels/route.tsx | Legacy /channels redirect to /admin/channels. |
| web/default/src/routes/_authenticated/admin/route.tsx | New admin route group root. |
| web/default/src/routes/_authenticated/admin/index.tsx | Admin index redirect to /admin/channels. |
| web/default/src/routes/_authenticated/admin/channels/index.tsx | Admin channels page route + search schema + access guard. |
| web/default/src/routes/_authenticated/admin/models/index.tsx | Admin models index redirect to default models section + access guard. |
| web/default/src/routes/_authenticated/admin/models/$section.tsx | Admin models section route + search schema + access guard. |
| web/default/src/routes/_authenticated/admin/users/index.tsx | Admin users page route + search schema + access guard. |
| web/default/src/routes/_authenticated/admin/redemption-codes/index.tsx | Admin redemption-codes route + search schema + access guard. |
| web/default/src/routes/_authenticated/admin/subscriptions/index.tsx | Admin subscriptions route + access guard. |
| web/default/src/routes/_authenticated/admin/system-settings/route.tsx | Admin system-settings root with SUPER_ADMIN guard. |
| web/default/src/routes/_authenticated/admin/system-settings/index.tsx | Admin system-settings index redirect to site settings. |
| web/default/src/routes/_authenticated/admin/system-settings/site/index.tsx | Redirect to default site settings section. |
| web/default/src/routes/_authenticated/admin/system-settings/site/$section.tsx | Site settings section route with section validation. |
| web/default/src/routes/_authenticated/admin/system-settings/security/index.tsx | Redirect to default security settings section. |
| web/default/src/routes/_authenticated/admin/system-settings/security/$section.tsx | Security settings section route with section validation. |
| web/default/src/routes/_authenticated/admin/system-settings/operations/index.tsx | Redirect to default operations settings section. |
| web/default/src/routes/_authenticated/admin/system-settings/operations/$section.tsx | Operations settings section route with section validation. |
| web/default/src/routes/_authenticated/admin/system-settings/models/index.tsx | Redirect to default model settings section. |
| web/default/src/routes/_authenticated/admin/system-settings/models/$section.tsx | Model settings section route with section validation. |
| web/default/src/routes/_authenticated/admin/system-settings/content/index.tsx | Redirect to default content settings section. |
| web/default/src/routes/_authenticated/admin/system-settings/content/$section.tsx | Content settings section route with section validation. |
| web/default/src/routes/_authenticated/admin/system-settings/billing/index.tsx | Redirect to default billing settings section. |
| web/default/src/routes/_authenticated/admin/system-settings/billing/$section.tsx | Billing settings section route with section validation. |
| web/default/src/routes/_authenticated/admin/system-settings/auth/index.tsx | Redirect to default auth settings section. |
| web/default/src/routes/_authenticated/admin/system-settings/auth/$section.tsx | Auth settings section route with section validation. |
| web/default/src/lib/platform-routes.ts | Add platform route constants + legacy prefix redirect helper. |
| web/default/src/hooks/use-top-nav-links.ts | Update “Console” top-nav link to /console. |
| web/default/src/hooks/use-sidebar-data.ts | Move to centralized console nav-group config. |
| web/default/src/hooks/use-sidebar-config.ts | Expand URL→module mapping for new /console and /admin paths. |
| web/default/src/components/layout/lib/workspace-registry.ts | Add workspace patterns and nav-group providers for /chat, /console, /admin. |
| web/default/src/components/layout/config/platform-nav.config.ts | Centralize console/admin/chat nav group definitions. |
| web/default/src/components/layout/components/public-header.tsx | Authenticated CTA routes to /console and updates label. |
| web/default/src/components/layout/components/mobile-drawer.tsx | Update profile/wallet links to /console/*. |
| web/default/src/components/profile-dropdown.tsx | Update profile/wallet/system-settings navigation to new paths. |
| web/default/src/features/home/index.tsx | Redesign landing page to present Chat vs Console entry points. |
| web/default/src/features/home/components/sections/hero.tsx | Update CTA destination from /dashboard to /console. |
| web/default/src/features/home/components/hero-buttons.tsx | Update CTA destination from /dashboard to /console. |
| web/default/src/features/auth/hooks/use-auth-redirect.ts | Default auth redirect now points to /console. |
| web/default/src/features/dashboard/section-registry.tsx | Update dashboard basePath to /console/dashboard. |
| web/default/src/features/dashboard/index.tsx | Update route API and navigation targets to /console/dashboard/*. |
| web/default/src/features/dashboard/components/overview/summary-cards.tsx | Update wallet deep-link to /console/wallet. |
| web/default/src/features/dashboard/components/overview/overview-dashboard.tsx | Update setup guide links to /console/* and /admin/*. |
| web/default/src/features/keys/components/api-keys-table.tsx | Update route API binding to console keys route. |
| web/default/src/features/usage-logs/section-registry.tsx | Update usage-logs basePath to /console/usage-logs. |
| web/default/src/features/usage-logs/index.tsx | Update route API and navigation targets to /console/usage-logs/*. |
| web/default/src/features/usage-logs/components/usage-logs-table.tsx | Update route API binding to console usage-logs route. |
| web/default/src/features/usage-logs/components/common-logs-filter-bar.tsx | Update navigation targets to /console/usage-logs/*. |
| web/default/src/features/usage-logs/components/task-logs-filter-bar.tsx | Update navigation targets to /console/usage-logs/*. |
| web/default/src/features/usage-logs/components/common-logs-stats.tsx | Update route API binding to console usage-logs route. |
| web/default/src/features/models/section-registry.tsx | Update admin models basePath to /admin/models. |
| web/default/src/features/models/index.tsx | Update route API and navigation targets to /admin/models/*. |
| web/default/src/features/models/components/models-table.tsx | Update route API binding to admin models route. |
| web/default/src/features/models/components/deployments-table.tsx | Update route API binding to admin models route. |
| web/default/src/features/models/components/deployment-access-guard.tsx | Update settings navigation target to /admin/system-settings/.... |
| web/default/src/features/users/components/users-table.tsx | Update route API binding to admin users route. |
| web/default/src/features/redemption-codes/components/redemptions-table.tsx | Update route API binding to admin redemption-codes route. |
| web/default/src/features/channels/components/channels-table.tsx | Update route API binding to admin channels route. |
| web/default/src/features/channels/components/channels-columns.tsx | Update deployment deep-link to /admin/models/deployments. |
| web/default/src/features/channels/components/dialogs/channel-test-dialog.tsx | Update settings deep-link to /admin/system-settings/.... |
| web/default/src/features/playground/components/message-error.tsx | Update settings deep-link to /admin/system-settings/.... |
| web/default/src/features/system-settings/utils/route-config.ts | Update docs/examples for admin system-settings routes. |
| web/default/src/features/system-settings/site/section-registry.tsx | Update basePath to /admin/system-settings/site. |
| web/default/src/features/system-settings/site/index.tsx | Update routePath to admin site settings route. |
| web/default/src/features/system-settings/security/section-registry.tsx | Update basePath to /admin/system-settings/security. |
| web/default/src/features/system-settings/security/index.tsx | Update routePath to admin security settings route. |
| web/default/src/features/system-settings/operations/section-registry.tsx | Update basePath to /admin/system-settings/operations. |
| web/default/src/features/system-settings/operations/index.tsx | Update useParams route source to admin operations settings route. |
| web/default/src/features/system-settings/models/section-registry.tsx | Update basePath to /admin/system-settings/models. |
| web/default/src/features/system-settings/models/index.tsx | Update routePath to admin models settings route. |
| web/default/src/features/system-settings/content/section-registry.tsx | Update basePath to /admin/system-settings/content. |
| web/default/src/features/system-settings/content/index.tsx | Update useParams route source to admin content settings route. |
| web/default/src/features/system-settings/billing/section-registry.tsx | Update basePath to /admin/system-settings/billing. |
| web/default/src/features/system-settings/billing/index.tsx | Update routePath to admin billing settings route. |
| web/default/src/features/system-settings/auth/section-registry.tsx | Update basePath to /admin/system-settings/auth. |
| web/default/src/features/system-settings/auth/index.tsx | Update routePath to admin auth settings route. |
| web/default/src/features/chat/app-placeholder.tsx | Add chat placeholder UI prompting users to use console for now. |
| web/default/src/i18n/locales/en.json | Add new platform strings and new validation strings. |
| web/default/src/i18n/locales/zh.json | Add new platform strings; contains corrupted placeholder values. |
| web/default/src/i18n/locales/vi.json | Add new platform strings; contains mojibake/corrupted values. |
| web/default/src/i18n/locales/ru.json | Add new platform strings; contains mojibake/corrupted values. |
| web/default/src/i18n/locales/ja.json | Add new platform strings; contains mojibake/corrupted values. |
| web/default/src/i18n/locales/fr.json | Add new platform strings; contains encoding corruption (accent replacement). |
| packages/shared-ui/README.md | Add package README. |
| packages/shared-types/README.md | Add package README. |
| packages/shared-config/README.md | Add package README. |
| packages/shared-auth/README.md | Add package README. |
| packages/shared-api/README.md | Add package README. |
| apps/portal/README.md | Add app README. |
| apps/console/README.md | Add app README. |
| apps/chat/README.md | Add app README. |
| apps/admin/README.md | Add app README. |
Comments suppressed due to low confidence (5)
web/default/src/i18n/locales/zh.json:2865
- This newly added zh translation value is corrupted ("??????? 8 ? 20 ?????"). Please replace it with a proper Chinese translation and ensure the file encoding is UTF-8.
web/default/src/i18n/locales/vi.json:2851 - This Vietnamese translation value is corrupted (mojibake). Please fix encoding (UTF-8) and update the value to proper Vietnamese so users don’t see garbled characters.
web/default/src/i18n/locales/ru.json:2851 - This newly added Russian translation value is corrupted ("?????? ..."). Please replace it with proper Cyrillic and ensure the file encoding is UTF-8.
web/default/src/i18n/locales/ja.json:2851 - This newly added Japanese translation value is corrupted (mojibake). Please replace it with a proper Japanese translation and ensure UTF-8 encoding.
web/default/src/i18n/locales/fr.json:4516 - Multiple newly added French strings in this block contain replacement characters (e.g., "associ?", "Cr?ation", "?chec"), suggesting the file wasn’t kept in UTF-8. Please restore the correct accented characters throughout this block to avoid user-facing garbled text.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "Feature in development": "功能开发中", | ||
| "Fee": "扣费", | ||
| "Fee Amount": "扣费金额", | ||
| "Fetch available models from upstream": "?????????", |
| "Feature in development": "Tính năng đang phát triển", | ||
| "Fee": "Phí", | ||
| "Fee Amount": "Số tiền phí", | ||
| "Fetch available models from upstream": "L?y c?c m? h?nh kh? d?ng t? upstream", |
| "Feature in development": "Функция в разработке", | ||
| "Fee": "Сбор", | ||
| "Fee Amount": "Сумма сбора", | ||
| "Fetch available models from upstream": "???????? ????????? ?????? ?? ???????????? ??????????", |
| "Feature in development": "開発中の機能です", | ||
| "Fee": "手数料", | ||
| "Fee Amount": "料金額", | ||
| "Fetch available models from upstream": "?????????????????????", |
| "Feature in development": "Fonctionnalité en développement", | ||
| "Fee": "Frais", | ||
| "Fee Amount": "Montant des frais", | ||
| "Fetch available models from upstream": "R?cup?rer les mod?les disponibles depuis l'amont", |
Important
📝 变更描述 / Description
(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)
Summary by CodeRabbit
New Features
Documentation
Refactor