Add public auth fallback, health-config page, and sandbox UI pages#22
Add public auth fallback, health-config page, and sandbox UI pages#22Huynhthuongg wants to merge 10 commits into
Conversation
…mux lab and tools pages
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughSummary by CodeRabbitGhi chú Phát hành
WalkthroughPR thêm auth-mode (clerk/public) và xuất cấu hình Clerk/env checklist; thêm 6 trang mới (AuthPortal, HealthConfig, MobileDashboard, ChatStatic, TermuxLab, ToolsHub); mở rộng routing/App để hỗ trợ chế độ public; cập nhật vài chú thích kiểu và tsconfig; thêm tài liệu self-healing. ChangesAuth Mode & New Pages Integration
Sequence DiagramsequenceDiagram
participant App as App Component
participant AuthMode as Auth Mode Config
participant Router as Main Router
participant PublicRouter as PublicOnlyRouter
participant Pages as Pages (Auth/Health/Mobile/Chat/Termux/Tools)
App->>AuthMode: import isAuthEnabled, clerkConfig
AuthMode-->>App: provide auth flags & config
alt isAuthEnabled true
App->>Router: render full router
Router->>Pages: mount /auth, /health-config, /mobile-dashboard, /chat-static, /termux-lab, /tools
else isAuthEnabled false
App->>PublicRouter: render PublicAppWithoutAuth
PublicRouter->>PublicRouter: redirect /sign-in,/sign-up,/chat -> / or /auth
PublicRouter->>Pages: mount public-only routes
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
✨ Simplify code
Warning Review ran into problems🔥 ProblemsLinked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped 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 |
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 412d4ff37d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Huynhthuongg
left a comment
There was a problem hiding this comment.
@Huynhthuongg @openai-code-agent @anthropic-code-agent
There was a problem hiding this comment.
5 issues found across 7 files
Confidence score: 2/5
- There is a concrete regression risk in
artifacts/sandbox-ai/src/App.tsx: public/pricingmountsPricingwhilePricingusesuseUser(), which can crash for public-mode users withoutClerkProvider. artifacts/sandbox-ai/src/pages/auth-portal.tsxcurrently points users to/sign-inand/sign-uppaths that redirect home in public mode, creating a broken authentication flow versus the page guidance.- Accessibility issues in
artifacts/sandbox-ai/src/pages/mobile-dashboard.tsx(icon-only toggle without accessible name) andartifacts/sandbox-ai/src/pages/termux-lab.tsx(input without label) introduce user-facing WCAG 2.1 AA compliance and usability risk. - Pay close attention to
artifacts/sandbox-ai/src/App.tsx,artifacts/sandbox-ai/src/pages/auth-portal.tsx,artifacts/sandbox-ai/src/pages/mobile-dashboard.tsx,artifacts/sandbox-ai/src/pages/termux-lab.tsx- prevent public-mode crashes/broken auth navigation and fix missing accessible names before merge.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
… App.tsx conflicts
Huynhthuongg
left a comment
There was a problem hiding this comment.
@Huynhthuongg @anthropic-code-agent @openai-code-agent
There was a problem hiding this comment.
2 issues found across 3 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Huynhthuongg
left a comment
There was a problem hiding this comment.
@Huynhthuongg @anthropic-code-agent @openai-code-agent
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@artifacts/sandbox-ai/src/components/chat-area.tsx`:
- Line 285: The onSuccess callback currently types its parameter as any
(onSuccess: (conv: any) => ...), losing type-safety when accessing fields like
conv.id; change the parameter type to the real payload type OpenaiConversation
(e.g., onSuccess: (conv: OpenaiConversation) => ...) and add the appropriate
import of OpenaiConversation from `@workspace/api-client-react` so the callback
uses the API client's payload type and restores type safety when reading conv.id
and other properties.
In `@artifacts/sandbox-ai/src/components/chat-sidebar.tsx`:
- Line 106: The callback types are being downcast to any; update onSuccess:
(conv: any) to onSuccess: (conv: OpenaiConversation) to match
useCreateOpenaiConversation's return type, and remove unnecessary any in the
filter from useListOpenaiConversations by using filter((c) => ...) so the
resulting array keeps its OpenaiConversation[] type and you can avoid casting
when calling groupConversations; adjust imports/types so OpenaiConversation is
available in chat-sidebar.tsx.
In `@artifacts/sandbox-ai/src/config/auth-mode.ts`:
- Around line 3-9: The isClerkConfigured check currently uses
Boolean(clerkPubKey) which treats all-whitespace strings as configured; update
the logic to normalize and trim the env value before deciding, e.g. compute
configuration presence from clerkPubKey?.trim() (or clerkPubKey &&
clerkPubKey.trim()) so isClerkConfigured becomes false for blank/whitespace keys
and isAuthEnabled (which depends on authMode and isClerkConfigured) only enables
Clerk when a non-empty trimmed key exists.
In `@artifacts/sandbox-ai/src/pages/auth-portal.tsx`:
- Around line 1-14: The AuthPortal currently always renders sign-in/sign-up CTAs
which become dead-ends when auth is disabled; update the AuthPortal component to
check an isAuthEnabled flag and only render the Link buttons to '/sign-in' and
'/sign-up' when isAuthEnabled is true. Locate the AuthPortal function and add a
conditional around the <Link ... '/sign-in'> and <Link ... '/sign-up'> elements
(or return an alternate UI) using the existing isAuthEnabled source (pass it in
as a prop or import/use the app's auth config/hook), ensuring other content
(title/description) remains visible when auth is off.
In `@artifacts/sandbox-ai/src/pages/mobile-dashboard.tsx`:
- Around line 10-12: The icon-only toggle button (the <button> using setOpen and
reading open to render <X> or <Menu>) lacks an accessible name and state; update
that button to provide a descriptive accessible label and expose its expanded
state by setting an aria-label that changes based on open (e.g., "Open menu" vs
"Close menu") and adding aria-expanded={open}; ensure the same fix is applied to
the other similar icon-only button between lines 18–22 so screen readers receive
both a name and the current open/closed state.
In `@docs_self_healing_process.md`:
- Around line 3-27: Add a blank line after each Markdown heading to satisfy
markdownlint MD022; specifically insert an empty line immediately after the
headings "## Goal", "## 1)", "## 2)", "## 3)", "## 4)", and "## 5)" so each
heading is followed by a blank line before the next paragraph or list item (no
code changes required, just adjust the doc content around those headings).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ea851824-6b82-4124-ab97-96626c48ee4e
📒 Files selected for processing (12)
artifacts/sandbox-ai/src/App.tsxartifacts/sandbox-ai/src/components/chat-area.tsxartifacts/sandbox-ai/src/components/chat-sidebar.tsxartifacts/sandbox-ai/src/config/auth-mode.tsartifacts/sandbox-ai/src/pages/auth-portal.tsxartifacts/sandbox-ai/src/pages/chat-static.tsxartifacts/sandbox-ai/src/pages/health-config.tsxartifacts/sandbox-ai/src/pages/mobile-dashboard.tsxartifacts/sandbox-ai/src/pages/termux-lab.tsxartifacts/sandbox-ai/src/pages/tools-hub.tsxartifacts/sandbox-ai/tsconfig.jsondocs_self_healing_process.md
Huynhthuongg
left a comment
There was a problem hiding this comment.
@Huynhthuongg @anthropic-code-agent @openai-code-agent
…in-public-fallback [PR #22 follow-up] Fix public-mode crash on /pricing route
…in-public-fallback-sfc4f4 Redirect /pricing to home and route sign-in/sign-up to /auth
…in-public-fallback-nv2thz Make AuthPortal aware of public mode and adjust public routes/redirects
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Motivation
/health-configpage to make missing configuration easier to diagnose.Description
VITE_AUTH_MODE, computeauthMode,isClerkConfigured, andisAuthEnabled, and build anenvChecklistfor display.HealthConfigPagewhich rendersenvChecklistand basic runtime auth information at/health-config.PublicOnlyRouterandPublicAppWithoutAuth, and updateAppto mount the public app when auth is disabled instead of failing on a missing Clerk key.auth-portal.tsx,mobile-dashboard.tsx,chat-static.tsx,termux-lab.tsx, andtools-hub.tsx, and add a short self-healing runbook indocs_self_healing_process.md.Testing
pnpm --filter @workspace/sandbox-ai run build, which completed successfully and verifies TypeScript/build checks for the modified package.Codex Task
Summary by cubic
Adds a public auth fallback when Clerk isn’t configured, a
/health-configdiagnostics page, and new sandbox pages. Tightens public-mode routing (including/pricingand/chat*redirects), improves the/authportal, and fixes CI type errors.New Features
VITE_AUTH_MODEwith fallback to public; exportsauthMode,isAuthEnabled,envChecklist, andclerkConfigfromsrc/config/auth-mode.ts, plus a short self-healing runbook./authportal; redirects/sign-inand/sign-upto/auth; guards/chat*; adds/health-config,/mobile-dashboard,/chat-static,/termux-lab,/tools; small banner linking to/health-config.Bug Fixes
/pricingcrash by redirecting to home.onSuccesscallback params and removing broken project references intsconfig.json.Written for commit 09b90a7. Summary will update on new commits.