Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The email verification flow has a functional gap (verification does not establish a session for users without an existing cookie), plus a few concrete UI/UX bugs that should be corrected before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR introduces a new authenticated dashboard experience (overview, balances, API keys, account data) and a revamped developer documentation section, while tightening the authentication flow around email verification and initializing starting balances during signup.
Changes:
- Added a dashboard layout (sidebar + pages) including API key CRUD, balance views, and recent activity overview.
- Reworked docs into markdown-backed pages with syntax highlighting and code-copy UX.
- Updated auth flow to include
emailVerifiedin user data, gate protected routes by verification, and initialize engine balances at signup.
File summaries
| File | Description |
|---|---|
| frontend/styles/globals.css | Adds sidebar theme tokens + highlight.js styling hooks. |
| frontend/src/utils/format.ts | Allows null input for quantity formatting. |
| frontend/src/types/index.ts | Adds API key scope/types for dashboard UI. |
| frontend/src/types/api.ts | Adds emailVerified to user API type. |
| frontend/src/pages/verify-email.tsx | Updates verification UX + resend flow and redirects. |
| frontend/src/pages/trade.tsx | Mobile/layout tweaks; adjusts panel sizing based on auth state. |
| frontend/src/pages/signup.tsx | Responsive spacing adjustments. |
| frontend/src/pages/profile.tsx | Rebuilds profile into dashboard-style page + copy ID action. |
| frontend/src/pages/markets.tsx | Responsive spacing + skeleton/table tweaks. |
| frontend/src/pages/login.tsx | Responsive spacing adjustments. |
| frontend/src/pages/docs.tsx | Converts docs page to slug-based markdown rendering. |
| frontend/src/pages/dashboard/overview.tsx | New dashboard overview page (balances/orders/trades/keys). |
| frontend/src/pages/dashboard/data.tsx | New dashboard “account data” wrapper around DataPanel. |
| frontend/src/pages/dashboard/balances.tsx | New dashboard balances table page. |
| frontend/src/pages/dashboard/api-keys.tsx | New dashboard API key management page. |
| frontend/src/lib/seo.ts | Adds dynamic SEO handling for docs/dashboard routes. |
| frontend/src/lib/api.ts | Adds keys API + updates auth response typings. |
| frontend/src/hooks/use-mobile.ts | Adds mobile breakpoint hook for responsive sidebar behavior. |
| frontend/src/context/AuthContext.tsx | Adds verified flag derived from emailVerified. |
| frontend/src/content/docs/websocket.md | Adds websocket documentation page. |
| frontend/src/content/docs/trades.md | Adds trades endpoint documentation page. |
| frontend/src/content/docs/quick-start.md | Adds API quick-start documentation page. |
| frontend/src/content/docs/orders.md | Adds orders endpoint documentation page. |
| frontend/src/content/docs/orderbook.md | Adds orderbook endpoint documentation page. |
| frontend/src/content/docs/markets.md | Adds markets endpoint documentation page. |
| frontend/src/content/docs/authentication.md | Adds authentication/scopes documentation page. |
| frontend/src/content/docs.ts | Switches docs registry to markdown-backed pages + lookup helper. |
| frontend/src/components/ui/tooltip.tsx | Adds tooltip primitive wrapper used by sidebar/nav. |
| frontend/src/components/ui/sidebar.tsx | Adds sidebar primitive system (provider, menu, rail, etc.). |
| frontend/src/components/ui/page.tsx | Updates page padding for responsive layout. |
| frontend/src/components/ui/collapsible.tsx | Adds collapsible primitive wrapper for UI composition. |
| frontend/src/components/ui/breadcrumb.tsx | Adds breadcrumb components for dashboard header. |
| frontend/src/components/signup-form.tsx | Updates signup workflow to set user + route to verify-email. |
| frontend/src/components/route-guards.tsx | Gates protected routes on email verification. |
| frontend/src/components/root-layout.tsx | Prevents horizontal overflow at root layout level. |
| frontend/src/components/navbar.tsx | Adds docs/dashboard links; updates user menu destinations. |
| frontend/src/components/nav-user.tsx | Adds sidebar user menu (profile/API keys/logout). |
| frontend/src/components/nav-main.tsx | Adds sidebar main navigation builder. |
| frontend/src/components/market/trade-form.tsx | Disables trading until verified; adds verify-email CTA. |
| frontend/src/components/market/skeletons.tsx | Enhances trade form skeleton (secondary action option). |
| frontend/src/components/market/market-header.tsx | Responsive layout tweaks for market header. |
| frontend/src/components/market/market-dropdown.tsx | Makes market dropdown responsive on mobile width. |
| frontend/src/components/market/data-panel.tsx | Gates account data on verification; responsive filter layout. |
| frontend/src/components/login-form.tsx | Trims email; routes to dashboard vs verify-email based on status. |
| frontend/src/components/landing/navbar.tsx | Adds “Crypto” link + improves mobile sheet sizing. |
| frontend/src/components/landing/announcement-bar.tsx | Adjusts announcement bar spacing for small screens. |
| frontend/src/components/docs/markdown-content.tsx | Adds markdown renderer with highlight.js + table/list styling. |
| frontend/src/components/docs/docs-layout.tsx | Adds docs layout with sidebar/tab navigation + outlet. |
| frontend/src/components/docs/code-block.tsx | Adds copy-to-clipboard wrapper for fenced code blocks. |
| frontend/src/components/dashboard-page.tsx | Adds shared dashboard page header wrapper. |
| frontend/src/components/dashboard-layout.tsx | Adds dashboard shell with sidebar + breadcrumb header. |
| frontend/src/components/chart/market-info.tsx | Responsive spacing tweaks for market info panel. |
| frontend/src/components/chart/chart.tsx | Responsive overflow handling for chart header/footer controls. |
| frontend/src/components/app-sidebar.tsx | Adds dashboard sidebar with nav + quick links. |
| frontend/src/components/app-layout.tsx | Hides top navbar/disclaimer when on dashboard routes. |
| frontend/src/App.tsx | Adds nested docs routes and new dashboard route tree. |
| frontend/package.json | Adds markdown/highlight dependencies. |
| frontend/bun.lock | Locks new frontend dependencies. |
| frontend/bun-env.d.ts | Adds module typings for .md (and css) imports. |
| engine/tests/utils.ts | Resets balances/assets more aggressively for new balance model. |
| engine/tests/get-balance.test.ts | Adds tests for sparse balances + explicit initialization. |
| engine/src/types/request.ts | Adds initialize_balance engine command type. |
| engine/src/schema/index.ts | Adds initialize balance payload schema alias. |
| engine/src/modules/balance.ts | Switches to sparse balances + adds initializer and safe asset ensures. |
| engine/src/handlers/initializeBalance.ts | Adds engine handler to initialize starting balances. |
| engine/src/core/dispatcher.ts | Registers initialize-balance handler. |
| backend/tests/access.test.ts | Extends access checks to enforce verification gating. |
| backend/src/types/principal.ts | Adds emailVerified to principal. |
| backend/src/types/engine.ts | Adds initialize-balance engine command type. |
| backend/src/routes/user.ts | Allows unverified sessions for /users/me only. |
| backend/src/routes/auth.ts | Allows unverified sessions to logout. |
| backend/src/middleware/auth.ts | Adds verification enforcement to requireAccess (with override). |
| backend/src/controllers/user.ts | Returns user id + emailVerified to clients. |
| backend/src/controllers/auth.ts | Initializes engine balance on signup; returns user payload; updates verify response. |
| .gitignore | Ignores only repo-root /docs directory. |
Review details
- Files reviewed: 72/75 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| .status(200) | ||
| .cookie("token", createToken({ id: verification.userId }), config.cookie) | ||
| .json(user); | ||
| res.status(200).json({ message: "Email verified successfully" }); |
Comment on lines
+19
to
+23
| const copyUserId = async () => { | ||
| await navigator.clipboard.writeText(user.id); | ||
| setCopied(true); | ||
| toast.success("Account ID copied"); | ||
| }; |
| <SidebarInset className="min-h-0 overflow-hidden"> | ||
| <header className="flex h-12 shrink-0 items-center gap-2 border-b border-border/40 bg-l0 px-4"> | ||
| <SidebarTrigger className="-ml-1" /> | ||
| <Separator orientation="vertical" className="mr-1 h-4!" /> |
| </CardTitle> | ||
| <CardDescription> | ||
| {verified ? ( | ||
| "Your email has been successfully verified. Redirecting to the markets page..." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Features:
Updated:
Fixed: