- Documented the containerized CI approach using docker-compose.ci.yml
- Added instructions for local CI testing with test-ci-locally.sh
- Explained benefits of the approach (reproducibility, simplicity)
- Updated .gitignore to ignore SurrealDB data directory
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Adds Playwright service to docker-compose.yml for easier test execution
and better integration with existing database services.
## Changes
- Add `playwright` service to docker-compose.yml:
- Uses official Playwright image (mcr.microsoft.com/playwright:v1.49.1-noble)
- Runs as non-root user (pwuser) for security
- Uses host networking to access dev server on localhost:3000
- Loads environment variables from .env
- Uses `profiles: [test]` to keep it optional
- Mounts node_modules volume to prevent permission issues
- Update documentation in AGENTS.md:
- Replace standalone Docker commands with docker-compose usage
- Document two usage patterns: `docker compose run` and `--profile test`
- Explain benefits of integrated setup
## Usage
```bash
# Start database services
docker compose up -d
# Start dev server
pnpm dev
# Run Playwright tests in Docker
docker compose run --rm playwright
```
Or with profiles:
```bash
# Run tests one-off
docker compose --profile test run --rm playwright
```
## Benefits
- Unified infrastructure setup (database + tests)
- No need for separate Dockerfile build step
- Easier for new developers to run tests
- Consistent with existing docker-compose workflow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements robust testing setup with Playwright global auth, reusable test
helpers, Docker support, and CI/CD integration with Gitea Actions.
## Changes
### Playwright Setup
- Add global auth setup with storage state reuse (tests/playwright/auth.setup.ts)
- Fix auth setup to clear existing state before fresh login
- Create reusable performOAuthLogin helper (tests/playwright/helpers.ts)
- Configure dotenv loading for environment variables in playwright.config.ts
### Magnitude Configuration
- Update to use Claude Sonnet 4.5 (claude-sonnet-4-5-20250514)
- Create reusable loginFlow helper (tests/magnitude/helpers.ts)
- Fix smoke test to check login page instead of non-existent homepage
### Docker Support
- Add Dockerfile.playwright with non-root user (pwuser) for security
- Uses official Playwright Docker image (mcr.microsoft.com/playwright:v1.49.1-noble)
- Provides consistent testing environment across users and CI/CD
### CI/CD Integration
- Add Gitea Actions workflow (.gitea/workflows/magnitude.yml)
- Runs Magnitude tests on every push and PR
- Starts SurrealDB and Next.js dev server automatically
- Uploads test results as artifacts (30-day retention)
### Documentation
- Add comprehensive testing setup docs to AGENTS.md:
- Playwright Docker setup instructions
- CI/CD with Gitea Actions
- Testing framework separation (Playwright vs Magnitude)
- Required secrets for CI/CD
### Testing Best Practices
- Separate Playwright (manual + global auth) from Magnitude (automated E2E)
- Reusable helpers reduce code duplication
- Both frameworks work independently
## Testing
- ✅ Playwright auth setup test passes (5.6s)
- ✅ Magnitude smoke test passes
- ✅ OAuth flow works correctly with helper function
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Increase logo size (48x48 desktop, 56x56 mobile) for better visibility
- Add logo as favicon
- Add logo to mobile header
- Move user menu to navigation bars (sidebar on desktop, bottom bar on mobile)
- Fix desktop chat layout - container structure prevents voice controls cutoff
- Fix mobile bottom bar - use icon-only ActionIcons instead of truncated text buttons
- Hide Create Node/New Conversation buttons on mobile to save header space
- Make fixed header and voice controls work properly with containers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Step 7 Updates (AI Chat with Structured Output):
- Created lib/ai-schemas.ts with Zod schema for NodeSuggestion
- Updated app/api/chat/route.ts:
- Changed import from 'ai' to '@ai-sdk/react' for streamText
- Added tools configuration with 'suggest_node' tool using NodeSuggestionSchema
- Added persona support with dynamic system prompts
- Extracts persona from request data object
- Rewrote app/chat/page.tsx:
- Changed from server component to client component ('use client')
- Uses useChat from '@ai-sdk/react' (fixes broken 'ai/react' import)
- Added experimental_onToolCall handler for node suggestions
- Redirects to /editor/new with AI-generated title/body as query params
- Integrated MicrophoneRecorder for voice input
- Added persona support (currently hardcoded to 'Socratic')
- Added tests/magnitude/07-chat.mag.ts with tests for:
- Basic chat functionality
- AI-triggered node suggestions with redirect to editor
Auth Callback Fixes:
- Fixed app/api/auth/callback/route.ts:
- Changed to use agent.api.com.atproto.server.getSession() to fetch session
- Previously used agent.getSession() which returned empty did/handle
- Added user upsert to SurrealDB (INSERT...ON DUPLICATE KEY UPDATE)
- Fixed variable references (session.did -> did, session.handle -> handle)
- Properly creates user record before minting JWT
CLAUDE.md Updates:
- Added git commit HEREDOC syntax documentation for proper quote escaping
- Clarified that this project allows direct git commits (no PGP signatures)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement the core write-through cache pattern for node creation.
This is the architectural foundation of the application.
Changes:
- Add @google/generative-ai dependency for embeddings
- Create lib/db.ts: SurrealDB connection helper with JWT auth
- Create lib/ai.ts: AI embedding generation using text-embedding-004
- Create app/api/nodes/route.ts: POST endpoint implementing write-through cache
Write-through cache flow:
1. Authenticate user via SurrealDB JWT
2. Publish node to ATproto PDS (source of truth)
3. Generate 768-dimensional embedding via Google AI
4. Cache node + embedding + links in SurrealDB
Updated schema to use 768-dimensional embeddings (text-embedding-004)
instead of 1536 dimensions.
Security:
- Row-level permissions enforced via SurrealDB JWT
- All secrets server-side only
- ATproto OAuth tokens from secure cookies
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>