Commit Graph

195 Commits

Author SHA1 Message Date
Fusion b4a7627718 fix(sessions): stabilize setAllSessions to prevent polling loop
Wrap setAllSessions in useCallback so it has a stable reference.
This breaks the infinite re-render loop that was causing 4-10
requests per second to /users/me/sessions.
2026-05-20 13:41:24 +02:00
Fusion 9d27cd9fe8 fix: install Docker CLI and mount socket for instance management
- Install docker-ce-cli and docker-compose-plugin in API Dockerfile
- Mount /var/run/docker.sock into API container
- Add appuser to docker group for socket permissions
- Fixes FileNotFoundError when deleting instances
2026-05-20 11:32:58 +02:00
Fusion e3ef852eca fix: add missing repository_id and project_id to Session type in state
The state/sessions.tsx Session interface was missing repository_id and
project_id fields that were added to api/sessions.ts in the previous
commit. This caused a TypeScript build error when the app-shell tried
to pass API sessions to the state context.
2026-05-20 11:30:01 +02:00
Fusion f824a1e6fe fix: settings save and session deletion bugs
Settings save:
- Remove exclude_none=True from user_config.py model_dump() call
- Fixes fields not updating when cleared or set to null/undefined

Session deletion:
- Add project_id and repository_id to get_user_sessions response
- Update frontend Session interface with new fields
- Fix handleDelete to use IDs instead of names, resolving 404 errors
2026-05-20 11:20:43 +02:00
Fusion ad09ffa6ec feat(tool-configs): add frontend tool config management page
- Create ToolConfigsPage with tool type selector, config list, and add/edit form
- Support both env and file config types
- Add route /tool-configs and navigation item
- Update API client with tool config endpoints
- Build passes successfully
2026-05-20 11:13:25 +02:00
Fusion 63ae706dd0 feat(tool-config): add categories, interfaces, and config management
Add support for tool categories, interface types, and per-tool configuration.

Backend:
- Add category and interfaces fields to ToolType model
- Create ToolConfig model for storing tool-specific settings
- Add tool_configs API endpoints (CRUD)
- Update built-in tool types with categories and interfaces:
  - code-server: editor, [web]
  - jupyter-notebook: notebook, [web]
  - opencode: ai-assistant, [terminal]
- Update instance API to include tool type interfaces
- Create Alembic migrations 0008 and 0009

Frontend:
- Update ToolType and Session interfaces with new fields
- Conditionally show Open/Terminal buttons based on tool interfaces
- Add API client for tool configs

OpenSpec: tool-config-management change created and implemented.
2026-05-20 11:03:09 +02:00
Fusion 74b5d0dc8c feat(instance-proxy): add HTTP proxy for tool instances
Add API proxy endpoint so users can access running tool instances
through the backend API instead of internal Docker network.

Backend:
- Add container_name field to ToolInstance model
- Create /instances/{id}/proxy/{path:path} endpoint with ownership checks
- Proxy HTTP requests to containers via docker network using container names
- Support all HTTP methods (GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS)
- Store proxy URL in instance.url instead of localhost
- Add Alembic migration 0007 for container_name column
- Add get_container_name() utility to docker.py

Frontend:
- Update Open button to use full proxy URL (API_BASE_URL + instance.url)

Closes instance-proxy OpenSpec change.
2026-05-20 10:37:21 +02:00
Fusion 25662e525c fix(docker): make instance directory configurable and writable
- Add INSTANCE_BASE_PATH config option (defaults to /data/instances)
- Update docker.py to use configured path instead of hardcoded 'data/instances'
- Update Dockerfile to create /data/instances and chown to appuser
- Add instance_data volume to docker-compose.traefik.yml and docker-compose.yml
- Set INSTANCE_BASE_PATH env var in both compose files

This fixes the PermissionError when creating tool instances because
appuser can now write to /data/instances.
2026-05-20 10:09:37 +02:00
Fusion d4e992a9e2 fix(cors): add API domain to CORS origins and improve instance error handling
- Add API base URL to CORS allowed origins alongside web base URL
- Add CORS origin logging on startup for debugging
- Wrap instance creation in try/except with detailed error logging
- Return proper error message instead of raw 500 for instance creation failures

This fixes CORS errors when the frontend makes cross-origin requests and
provides better diagnostics for instance creation failures.
2026-05-20 10:03:53 +02:00
Fusion 35ada0e662 fix(auth): set session cookie on redirect response
The OAuth callback was setting the session cookie on the 'response'
parameter but returning a brand new RedirectResponse, causing the
cookie to be lost. This created an infinite login loop where the
callback succeeded but /auth/me always returned 401.

- Set cookies on the RedirectResponse instead of the unused response param
- Remove unused 'response: Response' parameter from callback handler
- Fixes login loop in production with cross-domain cookies
2026-05-19 23:29:24 +02:00
Fusion c3e2264771 debug: add logging to auth /me endpoint to diagnose login loop 2026-05-19 23:25:30 +02:00
Fusion 76741d3ee6 debug: add logging to settings save to diagnose issue 2026-05-19 23:21:48 +02:00
Fusion 62752a8390 fix: add validation logging and debug info for tool instance creation
- Add RequestValidationError handler to log validation errors
- Add extra=ignore to CreateInstanceRequest to be more lenient
- Add logging to create_instance endpoint to see received data
- Add missing logger import in tool_instances.py
2026-05-19 23:17:08 +02:00
Fusion 461cb30b28 fix: dark mode theme switching and styling
- Apply theme immediately when saving settings (fixes theme not updating)
- Add dark mode CSS variables for success/warning/danger/info colors
- Fix shell-header background for dark mode
- Fix URL validation styles to use CSS variables
- Add explicit background/color to form inputs for dark mode support
- Quality gates: typecheck OK, lint OK, build OK
2026-05-19 23:13:10 +02:00
Fusion 94aa88c154 feat: add Sessions Hub page
- Add Sessions tab to navigation between Dashboard and Projects
- Show active session count badge in navigation
- Create SessionsPage with:
  - Last session section with resume button
  - Active sessions grid with open/stop actions
  - Recent sessions list
  - Create session form with project/repo/tool selectors
- Add last_session_id to user config
- Update UserConfig schemas (backend and frontend)
- Add comprehensive CSS for sessions page

Quality gates: typecheck ✓, lint ✓, build ✓
2026-05-19 23:06:54 +02:00
Fusion 4f695d7e62 fix: accept tool instance creation params in request body
The create_instance endpoint was expecting tool_type_id and display_name
as query parameters, but the frontend sends them in the JSON body.
Added CreateInstanceRequest Pydantic model to properly parse the request body.

Fixes 422 Unprocessable Content error on instance creation.
2026-05-19 22:55:47 +02:00
Fusion 7a48180dc3 fix: correct get_db_session import in tool_instances.py
Import get_db_session from src.auth.dependencies instead of src.database.
Fixes ImportError on application startup.
2026-05-19 21:39:29 +02:00
Fusion a0b0944709 fix: correct get_db_session import in terminal.py
Import get_db_session from src.auth.dependencies instead of src.database.
Fixes ImportError on application startup.
2026-05-19 21:37:00 +02:00
Fusion b79da51269 docs: mark api-documentation tasks complete 2026-05-19 21:31:57 +02:00
Fusion 40a940304b docs: comprehensive API documentation
- Create enhanced health endpoints with /health and /health/db
- Add comprehensive docstrings to all API endpoints
- Add Pydantic response models with Field descriptions
- Create apps/api/README.md with setup guide
- Create ADR-001 for session auth decision
- Create ADR-002 for async SQLAlchemy decision
- Quality gates: Python syntax OK, TypeScript OK
2026-05-19 21:31:20 +02:00
Fusion e344e961d6 feat: implement web terminal for tool instances
- Add TerminalSession backend service for docker exec subprocess management
- Add TerminalManager for WebSocket session lifecycle management
- Create WebSocket endpoint at /ws/tool-instances/{id}/terminal
- Add session cookie authentication and instance ownership verification
- Install xterm.js with fit and web-links addons
- Create TerminalComponent with xterm.js integration
- Create TerminalPage with full-screen terminal view
- Add terminal route at /instances/:id/terminal
- Add terminal button to InstanceList for running instances
- Add terminal and arrow-left icons to icon registry
- Add comprehensive terminal CSS styles (dark theme, responsive)

Quality gates: typecheck ✓, lint ✓, build ✓, Python syntax ✓
2026-05-19 21:11:29 +02:00
Fusion d6b3e8b804 docs: mark all tool-instances tasks complete 2026-05-19 20:51:03 +02:00
Fusion f997b3f7c5 feat: add instance list component and integrate into workspace
- Create InstanceList component with create/start/stop/restart/delete
- Add tool instance icons (external, play, stop)
- Integrate InstanceList into RepoWorkspace sidebar
- Load tool types for instance creation
- Add instance-specific CSS styles

Quality gates: typecheck ✓, lint ✓, build ✓
2026-05-19 20:50:08 +02:00
Fusion c795f8f873 feat: implement tool instances backend and session navigation
Backend:
- Create ToolInstance model with status tracking
- Add Alembic migration for tool_instances table
- Create Docker service for compose template rendering and container execution
- Add CRUD API endpoints for tool instances
- Add lifecycle endpoints (start/stop/restart)
- Add user sessions endpoint for navigation
- Register routers in main.py

Frontend:
- Create SessionsProvider with React context
- Create sessions API client
- Update AppShell with sessions section in navigation
- Add session status indicators and polling
- Add CSS for session navigation

Quality gates: typecheck ✓, lint ✓, build ✓
2026-05-19 20:42:59 +02:00
Fusion c52367401b feat: complete responsive spacing improvements
- Add page-specific responsive styles for all pages
- Mobile form full-width inputs
- Stack project/repository cards on mobile
- Git toolbar wrapping on mobile
- Dashboard grid single column on mobile
- Settings layout stacking on mobile
- Touch target verification (min 44px)
- Table horizontal scroll wrapper
- SSH key list responsive layout
- Text overflow prevention in cards

Quality gates: typecheck ✓, lint ✓, build ✓
2026-05-19 20:27:28 +02:00
Fusion e9e0e87013 fix: resolve double scrollbar in file editor
- Change workspace-main overflow from auto to hidden to prevent nested scrolling
- Change file-editor-content overflow from auto to hidden
- Change code-block overflow from auto to visible
- Add flex display to workspace-main and file-editor-content for proper height distribution

Fixes double scrollbar issue in file editor workspace
2026-05-19 19:57:53 +02:00
Fusion 2b5331a1a0 feat: implement responsive spacing improvements
- Add CSS custom properties for spacing scale (4px base), breakpoints, and fluid typography
- Create layout utilities: Container, Stack, Row, Grid
- Update AppShell with responsive mobile navigation
- Update card grid with responsive columns
- Update dialogs with viewport-aware sizing and mobile fullscreen
- Update workspace layout for mobile stacking
- Ensure minimum 44px touch targets for buttons
- Add table-responsive and text truncation utilities
- Update page headers for mobile stacking

Quality gates: typecheck ✓, lint ✓, build ✓
2026-05-19 19:50:36 +02:00
Fusion 6f41fa7cbe feat: implement universal icon system with Phosphor Icons
- Install @phosphor-icons/react package
- Create centralized Icon component with size/weight/color variants
- Create icon registry with 34 icons across 5 categories
- Replace all raw Unicode symbols with proper icon components
- Add icons to navigation, buttons, status indicators, git operations
- Add icon CSS with consistent sizing and spacing
- Fix type definitions for Phosphor icon compatibility

Quality gates: typecheck ✓, lint ✓, build ✓ (375KB bundle)
2026-05-19 19:33:06 +02:00
Fusion cccc4a9d5a fix: correct binary file detection in git file viewer
- Remove useless git diff --numstat call that failed in bare repos
- Use raw bytes instead of text decoding to avoid encoding issues
- Properly check subprocess return codes

Fixes false positive binary detection for text files like .env.sample
2026-05-19 18:55:58 +02:00
Fusion 72b4a5e2bd docs: complete smart-git-url-parsing and documentation-overhaul tasks
- Mark all tasks complete for smart-git-url-parsing change
- Mark all tasks complete for documentation-overhaul change
- Add CHANGELOG.md with feature history
- Quality gates: code previously verified in earlier sessions
2026-05-19 18:49:48 +02:00
Fusion 8f1d2a149a archive: file-editor change complete 2026-05-19 16:05:30 +02:00
Fusion 7261c75bb2 feat: implement file editor with syntax highlighting and editing
- Install react-simple-code-editor and prismjs dependencies
- Create language detection utility with 50+ file extensions
- Create SyntaxHighlighter component with Prism.js highlighting
- Create CodeEditor component with syntax-highlighted editing
- Create CommitDialog with diff preview and commit message
- Create FileEditor component integrating view/edit/commit flow
- Replace FileViewer with FileEditor in RepoWorkspace
- Add comprehensive CSS styles for editor, highlighter, and dialog
- Support keyboard shortcuts: Ctrl+E (toggle edit), Ctrl+S (save)
- Quality gates: typecheck ✓ lint ✓ build ✓
2026-05-19 16:04:48 +02:00
Fusion 84bf7e4aeb feat: move git toolbar to top bar with proper styling
- Move GitToolbar from sidebar to top bar below workspace header
- Remove GitToolbar from sidebar layout
- Add comprehensive CSS styles for git toolbar:
  - Flex layout with proper spacing
  - Styled buttons with hover effects
  - Branch selector styling
  - Badge styling for ahead/behind counts
  - Status badges for modified/added/deleted/untracked
  - Error message styling
  - New branch form styling
- Quality gates: typecheck ✓ lint ✓ build ✓
2026-05-19 15:49:06 +02:00
Fusion 9373d93169 fix: remove duplicate workspace header and update repo link
- Remove duplicate WorkspaceHeader render (was showing twice)
- Update empty state 'Add Repository' link to point to
  /projects/{id}/settings/repositories instead of old route
- Quality gates: typecheck ✓ lint ✓ build ✓
2026-05-19 15:42:50 +02:00
Fusion 7fc8b82621 fix: add missing GET /projects/{id} endpoint
Frontend workspace was calling GET /projects/{id} which didn't exist,
causing 405 errors and preventing WorkspaceHeader from rendering.

Add get_project endpoint that returns a single project by ID with
ownership verification.
2026-05-19 15:34:26 +02:00
Fusion 2d078c8b1e docs: mark workspace-visual-overhaul tasks as complete
All 7 phases complete:
- Phase 1: Workspace header with project icon, name, History/Settings buttons
- Phase 2: Project settings page with tabbed layout (General, Repositories, Members)
- Phase 3: Repository management moved to settings tab
- Phase 4: Sidebar cleaned (repo selector, branch selector, file tree)
- Phase 5: Members placeholder tab added
- Phase 6: Breadcrumbs, mobile responsiveness, transitions
- Phase 7: Quality gates passed (typecheck, lint, build)
2026-05-19 15:29:39 +02:00
Fusion 92c8dfe986 feat: add mobile responsiveness to settings layout
- Add mobile responsive styles for settings page
- Stack sidebar tabs horizontally on small screens
- Adjust workspace header for mobile
- Quality gates: typecheck ✓ lint ✓ build ✓
2026-05-19 15:28:40 +02:00
Fusion 0bc0d99c21 feat: add project settings page with tabbed layout
- Create SettingsTabLayout component with sidebar navigation
- Create ProjectSettingsPage with General settings tab
- Create RepositoriesSettingsTab for repo management
- Add Members placeholder tab
- Update router with settings routes
- Add CSS styles for settings layout
- Navigate to /projects/:id/settings from workspace header
2026-05-19 15:26:57 +02:00
Fusion 965f6f6585 feat: add git control tests and mark all tasks complete
- Add integration tests for git control utilities
- Test status, branch operations, and commit functionality
- All 9 tests passing
2026-05-19 15:10:31 +02:00
Fusion a9f4657d03 feat: add MergeDialog component and integrate with GitToolbar
- Create MergeDialog component for branch merging
- Add merge button to GitToolbar
- Show source branch selector and target branch display
- Handle merge success and error states
- Add modal CSS styles

Completes Task 6.2 of git-control change.
2026-05-19 15:05:55 +02:00
Fusion 875594d66d feat: add commit panel and file status indicators to repo workspace
- Add CommitPanel component for viewing changed files and committing
- Show file status indicators (M/A/D/?) in file tree
- Integrate git status with workspace for real-time updates
- Add CSS styles for commit panel and status badges

Part of git-control change implementation.
2026-05-19 15:00:25 +02:00
Fusion 762e0de44c feat: add git control endpoints (status, branch, commit, fetch, pull, push, merge)
- Add GitStatus dataclass and git control utilities
- Add endpoints:
  - GET /status - working directory status
  - POST /branches - create branch
  - DELETE /branches/{name} - delete branch
  - POST /checkout - checkout branch
  - POST /commit - commit changes
  - POST /fetch - fetch from remote
  - POST /pull - pull updates
  - POST /push - push changes
  - POST /merge - merge branches

Quality gates: ruff ✓, mypy ✓
2026-05-19 14:49:22 +02:00
Fusion 955dadc604 fix: correct API endpoint URLs in workspace file browser
The workspace was using /api/projects/... but the API routes are mounted
at /projects without the /api prefix. Switched from raw fetch() to the
apiClient which already has the correct baseURL configured.

Also fixed TypeScript types and removed unused variables.
2026-05-19 14:27:22 +02:00
Fusion 83f94b1f09 docs: comprehensive documentation overhaul
Add complete documentation structure:
- Frontend architecture documentation
- Database schema documentation
- Deployment guides (Docker, Traefik, Authentik, Environment)
- Development guides (Setup, Testing, Contributing, Quality Gates)
- Deployment architecture documentation
- Updated docs README with complete navigation

All new features and APIs are now documented.
Quality gates: docs only, no code changes
2026-05-19 14:18:20 +02:00
Fusion 6807f449b7 feat: add repository workspace as default project view
- Create git file utilities (list_tree, get_file_content, list_branches, commit_file)
- Add file browsing API endpoints (list, content, branches, update)
- Create RepoWorkspace page with sidebar + main content layout
- Add FileTree component with directory navigation
- Add FileViewer component for viewing file contents
- Update project list to link to workspace
- Add workspace CSS styles
- Update router with workspace route

Quality gates: ruff ✓, mypy ✓, typecheck ✓, build ✓
2026-05-19 13:43:49 +02:00
Fusion 92d0d5b891 fix: don't combine --all with branch name in git log
Using 'git log --all <branch>' creates ambiguous behavior. Now:
- Without branch: uses --all to show all commits from all refs
- With branch: shows only commits from that specific branch

This ensures consistent commit counts between git CLI and API.
2026-05-19 13:19:36 +02:00
Fusion 834982d423 fix: fetch up to 10000 commits instead of default 100
The backend defaults to returning only 100 commits. Update frontend
to explicitly request up to 10000 commits to show full history for
most repositories.
2026-05-19 13:12:48 +02:00
Fusion 9873a8186a fix: send ISO format dates instead of Unix timestamps
Backend was sending Unix timestamps as strings (e.g. '1716112800')
which JavaScript Date couldn't parse. Now sends proper ISO 8601
format dates that work with new Date() in the browser.
2026-05-19 13:10:10 +02:00
Fusion d4b52668aa fix: align backend commit response with frontend expectations
Backend was returning fields like 'author', 'email', 'date' but frontend
expected 'author_name', 'author_email', 'author_date'. Also 'branches' and
'tags' were separate but frontend expects unified 'refs' array.

- Update _commit_to_dict to return frontend-compatible field names
- Add graph_symbol and graph_depth for commit graph display
- Update get_commit_detail to return matching field names
- Include diff as top-level field for detail view
2026-05-19 13:04:49 +02:00
Fusion d0191cd549 fix: use NULL bytes as git log format separators
The git log --graph output uses | characters in the ASCII art,
which conflicts with using | as a format separator. Switch to
NULL bytes (\x00) which won't appear in commit data.

Also removed --graph flag since we build graph data from
parent relationships instead.
2026-05-19 13:00:22 +02:00