# BZZZ Next.js Build Output Location Notes

## Issue Description
The Next.js build process for BZZZ's web UI has inconsistent output locations, causing misalignment between generated files and where BZZZ expects them.

## Correct Process

### Build Output Location
- **Source directory**: `/home/tony/chorus/project-queues/active/BZZZ/install/config-ui/`
- **Build command**: `npm run build` (from config-ui directory)
- **Actual build output**: `/home/tony/chorus/project-queues/active/BZZZ/install/config-ui/pkg/web/static/`
- **Expected by BZZZ embed**: `/home/tony/chorus/project-queues/active/BZZZ/pkg/web/static/`

### Correct Sync Command
```bash
# From BZZZ root directory
cp -r install/config-ui/pkg/web/static/* pkg/web/static/
```

### Go Embed Configuration
- Location: `/home/tony/chorus/project-queues/active/BZZZ/pkg/web/embed.go`
- Directive: `//go:embed *`
- Serves from: `pkg/web/` directory (including `static/` subdirectory)

### Complete Build & Deploy Process
```bash
# 1. Clean and rebuild Next.js UI
cd install/config-ui
rm -rf .next pkg/
npm run build

# 2. Sync to Go embed location
cd ../..
cp -r install/config-ui/pkg/web/static/* pkg/web/static/

# 3. Rebuild Go binary with embedded files
go build -o build/bzzz-1.0.2 .

# 4. Deploy to cluster (if needed)
./deploy-cluster.sh
```

## Known Issues

### CSS Build Issues
- Tailwind CSS purging may exclude custom classes not detected as used
- CSS variables in globals.css may not appear in final build
- Theme toggle component exists but may not be included in build

### Troubleshooting
1. Verify build output location: `ls -la install/config-ui/pkg/web/static/`
2. Check embedded files: `ls -la pkg/web/static/`
3. Verify CSS content: `grep -l "input-field" pkg/web/static/_next/static/css/*.css`
4. Check for CSS variables: `grep "--bg-secondary\|--border-defined\|--text-primary" pkg/web/static/_next/static/css/*.css`

## Historical Context
This alignment issue has occurred multiple times. The Next.js export process creates files in a nested `pkg/web/static/` structure within the config-ui directory, not directly in the `out/` directory as typically expected.

## Date
2025-01-29