# Workspace Improvements Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Polish the workspace by removing logo/login button clutter, adding a history toggle, enforcing mandatory login after 3 guest uploads, and adding email verification code to the registration flow.
**Architecture:** Five independent changes across the workspace layer. History toggle state lives in `WorkspacePage` and is passed into `LeftSidebar`. Email verification adds a two-step flow inside `AuthModal` only — no new files needed. All i18n strings go through `translations.ts`.
**Tech Stack:** React 18, TypeScript, Tailwind CSS (utility classes), Lucide React icons, existing `http` client in `lib/api.ts`
---
## File Map
| File | Change |
|------|--------|
| `src/components/layout/AppNavbar.tsx` | Remove logo icon + text + divider |
| `src/components/LeftSidebar.tsx` | Remove login button; add history toggle prop |
| `src/pages/WorkspacePage.tsx` | Add `historyEnabled` state; pass to sidebar; force mandatory modal after 3rd upload |
| `src/components/AuthModal.tsx` | Add send-code button, countdown, verification code field to signup tab |
| `src/lib/authService.ts` | Add `sendEmailCode()` method; update `register()` to send `code` |
| `src/types/api.ts` | Add `SendEmailCodeRequest`; add `code` to `RegisterRequest` |
| `src/lib/translations.ts` | Add new i18n keys for history toggle, verification code flow |
---
## Task 1: Add i18n strings for new features
**Files:**
- Modify: `src/lib/translations.ts`
- [ ] **Step 1: Add new keys to both `en` and `zh` auth sections and sidebar section**
In `src/lib/translations.ts`, find the `en.auth` block and add after `oauthFailed`:
```ts
sendCode: 'Send Code',
resendCode: 'Resend',
codeSent: 'Code sent',
verificationCode: 'Verification Code',
verificationCodePlaceholder: 'Enter 6-digit code',
verificationCodeRequired: 'Please enter the verification code.',
verificationCodeHint: 'Check your inbox for the 6-digit code.',
sendCodeFailed: 'Failed to send verification code, please retry.',
```
In `en.sidebar`, add after `historyHeader`:
```ts
historyToggle: 'Show History',
historyLoginRequired: 'Login to enable history',
```
In `zh.auth`, add after `oauthFailed`:
```ts
sendCode: '发送验证码',
resendCode: '重新发送',
codeSent: '验证码已发送',
verificationCode: '验证码',
verificationCodePlaceholder: '请输入 6 位验证码',
verificationCodeRequired: '请输入验证码。',
verificationCodeHint: '请查收邮箱中的 6 位验证码。',
sendCodeFailed: '发送验证码失败,请重试。',
```
In `zh.sidebar`, add after `historyHeader`:
```ts
historyToggle: '显示历史',
historyLoginRequired: '登录后开启历史记录',
```
- [ ] **Step 2: Commit**
```bash
git add src/lib/translations.ts
git commit -m "feat: add i18n keys for history toggle and email verification"
```
---
## Task 2: Remove logo from AppNavbar
**Files:**
- Modify: `src/components/layout/AppNavbar.tsx:38-50`
- [ ] **Step 1: Remove logo image, text, and divider — keep only the Home icon link**
Replace the entire `{/* Left: Logo + Home link */}` div (lines 38–51) with:
```tsx
{/* Left: Home link */}
{t.marketing.nav.home}
```
- [ ] **Step 2: Verify dev server renders correctly**
```bash
npm run dev
```
Navigate to `/app`. Confirm the navbar no longer shows the TexPixel icon or text, only the Home link on the left.
- [ ] **Step 3: Commit**
```bash
git add src/components/layout/AppNavbar.tsx
git commit -m "feat: remove logo from workspace navbar"
```
---
## Task 3: Remove login button from LeftSidebar and add history toggle prop
**Files:**
- Modify: `src/components/LeftSidebar.tsx`
- [ ] **Step 1: Add `historyEnabled` and `onToggleHistory` to the props interface**
Replace the existing `LeftSidebarProps` interface with:
```ts
interface LeftSidebarProps {
files: FileRecord[];
selectedFileId: string | null;
onFileSelect: (fileId: string) => void;
onUploadClick: () => void;
canUploadAnonymously: boolean;
onRequireAuth: () => void;
isCollapsed: boolean;
onToggleCollapse: () => void;
onUploadFiles: (files: File[]) => void;
hasMore: boolean;
loadingMore: boolean;
onLoadMore: () => void;
historyEnabled: boolean;
onToggleHistory: () => void;
}
```
- [ ] **Step 2: Destructure the two new props in the function signature**
Replace the destructuring block (the function params) to add `historyEnabled` and `onToggleHistory`:
```ts
export default function LeftSidebar({
files,
selectedFileId,
onFileSelect,
onUploadClick,
canUploadAnonymously,
onRequireAuth,
isCollapsed,
onToggleCollapse,
onUploadFiles,
hasMore,
loadingMore,
onLoadMore,
historyEnabled,
onToggleHistory,
}: LeftSidebarProps) {
```
- [ ] **Step 3: Add `Toggle` icon to lucide imports**
Change the import line at the top from:
```ts
import { Upload, LogIn, LogOut, FileText, Clock, ChevronLeft, ChevronRight, History, MousePointerClick, FileUp, ClipboardPaste, Loader2 } from 'lucide-react';
```
to:
```ts
import { Upload, LogOut, FileText, Clock, ChevronLeft, ChevronRight, MousePointerClick, FileUp, ClipboardPaste, Loader2 } from 'lucide-react';
```
(Remove `LogIn`, `History` — no longer used in expanded view)
- [ ] **Step 4: Remove the `showAuthModal` state and the `AuthModal` import/usage from LeftSidebar**
Remove these lines near the top of the function body:
```ts
const [showAuthModal, setShowAuthModal] = useState(false);
```
and the `useEffect` that sets `showAuthModal` to false on auth:
```ts
useEffect(() => {
if (isAuthenticated) {
setShowAuthModal(false);
}
}, [isAuthenticated]);
```
Also remove `import AuthModal from './AuthModal';` at the top of the file, and at the bottom remove the `{showAuthModal && setShowAuthModal(false)} />}` JSX.
- [ ] **Step 5: Replace the history header section with a toggle switch**
Find the `{/* Middle Area: History */}` block. Replace the header div (the one with `Clock` icon and `historyHeader` text) with:
```tsx
{t.sidebar.historyHeader}
```
- [ ] **Step 6: Gate the history list behind `historyEnabled`**
Replace the entire `
```
- [ ] **Step 7: Replace the bottom user/login area — remove login button, keep only logged-in user view**
Replace the entire `{/* Bottom Area: User/Login */}` div with:
```tsx
{/* Bottom Area: User info (only shown when logged in) */}
{user && (
{displayName}
)}
```
- [ ] **Step 8: Fix collapsed view — remove LogIn icon button**
In the `if (isCollapsed)` return block, remove the bottom `