2.0 KiB
2.0 KiB
CRITICAL: Frontend Development Workflow
⚠️ IMPORTANT FOR ALL AGENTS ⚠️
All frontend changes MUST be served live immediately.
When making changes to any files in /home/translator/docker/appdata/stemengine/frontend/src/, the dev server will automatically hot-reload and serve changes without requiring:
npm run build- Manual browser refresh (in most cases)
- Container restart
How this works
- The frontend has a dev server running (Vite/dev server via Docker)
- It watches for file changes in
src/ - Changes are automatically compiled and served to
http://localhost:5173(or the active dev server port) - Browser will auto-refresh on most changes
When you're done with frontend changes:
- Make the file edits directly to
src/files - Verify changes appear in the browser within seconds
- Test the functionality immediately
- Move on — no build step needed
The prod/dev distinction
- Dev mode (current): Hot reload, live serving
- Prod mode (future): May require build step
- For now: Everything is dev, everything is live
Verification
After making frontend changes, you should see:
- The browser automatically refresh (or prompt to do so)
- Changes visible within 1-3 seconds
- Console may show "Updated in X ms" or similar
If changes don't appear:
- Wait 5 seconds (compilation takes a moment)
- Hard refresh:
Ctrl+Shift+R(Windows/Linux) orCmd+Shift+R(Mac) - Check if dev server is running:
docker-compose psshould show frontend service running - Check browser console for errors
Do NOT do these things:
- ❌ Tell users "changes will appear after rebuild"
- ❌ Run
npm run build(waste of time in dev mode) - ❌ Ask users to clear cache and restart
- ❌ Suggest changes need "deployment"
Example workflow:
1. Edit src/pages/SearchPage.tsx
2. Save file (1-2 second delay)
3. Browser refreshes automatically
4. Changes are live
5. Done
Last Updated: April 16, 2026
Set by: Frontend development team