···4455## Development
6677-**Prerequisites:**
88-- ATlast dev server must be running at `http://127.0.0.1:8888`
99-- You must be logged in to ATlast before using the extension
77+### Build Modes
88+99+The extension supports three build modes:
1010+1111+1. **Mock Mode** (`pnpm run build:mock`)
1212+ - For UI/UX testing only
1313+ - Shows dev toolbar with state toggle buttons
1414+ - No backend or browser API checks
1515+ - Uses fake data for all operations
1616+ - Perfect for rapid UI development
1717+1818+2. **Dev Mode** (`pnpm run build:dev` or `pnpm run build`)
1919+ - Full extension functionality with local backend
2020+ - Connects to `http://127.0.0.1:8888`
2121+ - Requires ATlast dev server running
2222+ - Checks server health on startup
2323+ - Must be logged in to ATlast
2424+2525+3. **Production Mode** (`pnpm run build:prod`)
2626+ - Full extension functionality with production backend
2727+ - Connects to `https://atlast.byarielm.fyi`
2828+ - No server health checks (assumes always online)
2929+ - Must be logged in to production ATlast
10301131### Build Extension
1232···1434# From project root:
1535cd packages/extension
1636pnpm install
1717-pnpm run build # Dev build (uses http://127.0.0.1:8888)
1818-pnpm run build:prod # Production build (uses https://atlast.byarielm.fyi)
3737+3838+# Choose your build mode:
3939+pnpm run build:mock # Mock mode - UI testing only
4040+pnpm run build:dev # Dev mode - local backend (default)
4141+pnpm run build:prod # Production mode - production backend
1942```
20432121-The built extension will be in `dist/chrome/`.
4444+The built extension will be in:
4545+- Chrome: `dist/chrome/`
4646+- Firefox: `dist/firefox/`
22472323-### Load in Chrome for Testing
4848+### Load in Browser for Testing
24495050+**Chrome/Edge:**
25511. Open Chrome and navigate to `chrome://extensions`
26522. Enable **Developer mode** (toggle in top right)
27533. Click **Load unpacked**
28544. Select the `packages/extension/dist/chrome/` directory
29555. The extension should now appear in your extensions list
30565757+**Firefox:**
5858+1. Open Firefox and navigate to `about:debugging#/runtime/this-firefox`
5959+2. Click **Load Temporary Add-on**
6060+3. Navigate to `packages/extension/dist/firefox/` and select `manifest.json`
6161+4. The extension will appear in your extensions list
6262+6363+**Important:** After rebuilding, click the reload button next to the extension in the browser's extension management page.
6464+3165### Testing the Extension
32663333-#### Step 0: Start ATlast Dev Server
6767+#### Testing Mock Mode
6868+6969+Mock mode is perfect for UI testing without backend dependencies:
7070+7171+1. Build in mock mode: `pnpm run build:mock`
7272+2. Load extension in browser
7373+3. Open popup - you'll see a dev toolbar at the bottom
7474+4. Click buttons to toggle between states (Idle, Ready, Scraping, Complete, Error, etc.)
7575+5. Test UI layouts, colors, and interactions
7676+7777+#### Testing Dev/Prod Mode
7878+7979+For full functionality testing:
8080+8181+**Step 0: Start ATlast Dev Server** (Dev mode only)
34823583```bash
3684# From project root:
···103151[Popup] Ready
104152```
105153154154+#### Error Handling
155155+156156+The extension now shows proper error states in the UI instead of browser alerts:
157157+158158+- **Upload Errors**: Shows specific error message with troubleshooting tips based on build mode
159159+- **Scraping Errors**: Guides user to correct page and provides context-specific help
160160+- **Server Offline** (Dev mode only): Shows instructions to start local server
161161+- **Not Logged In**: Provides button to open ATlast login page
162162+163163+All errors include:
164164+- User-friendly message explaining what went wrong
165165+- Specific troubleshooting steps to resolve the issue
166166+- Technical details in collapsible section for debugging
167167+106168#### Common Issues
107169108170**Issue: Extension shows "Not logged in to ATlast"**
109171110172Solution:
111111-1. Open `http://127.0.0.1:8888` in a new tab
173173+1. Click "Open ATlast" button in the error state
1121742. Log in with your Bluesky handle
1131753. Return to extension and click "Check Again"
114176115115-**Issue: Extension shows "ATlast server not running"**
177177+**Issue: Extension shows "Server not available"** (Dev mode only)
116178117179Solution:
1181801. Start dev server: `npx netlify-cli dev --filter @atlast/web`