Commit Graph

610 Commits

Author SHA1 Message Date
alex 7ce2af18c9 fix: restore dev features lost in main→dev merge
Merge b6f89f9 ('integrate main restructuring into dev') took main's
smaller refactored versions and overwrote dev-specific features.

Restored from dev commit 51a399c and ancestors:

Backend terminal (c754984, 37134b8):
- terminal_session.py: asyncio.add_reader event-driven I/O, flow control
  (64KB pause/32KB resume), 2ms output batching, binary WebSocket frames,
  EOF detection, circular replay buffer
- terminal_manager.py: named sessions, MaxSessionsExceededError,
  TerminalSessionModel persistence, idle timeout cleanup
- terminal.py: dual WebSocket routes (/terminal and /terminal/{session_id}),
  SessionRef mutable reference for session resets

SSH key mounting (c6b804b):
- instance_lifecycle.py: _mount_ssh_keys helper that prepares multiple
  SSH keys with unique filenames (id_ed25519_<name>), writes combined
  SSH config, mounts single ~/.ssh directory
- tool_instance.py: ssh_key_ids JSON column
- schemas/tool_instance.py: ssh_key_ids field in CreateInstanceRequest
- tool_instances.py: pass ssh_key_ids through create endpoint and response

Quality gates: py_compile passed, ruff passed on all edited files
2026-06-03 14:06:04 +02:00
alex 14e636ff1c fix: import ToolDefinitionManifest at runtime in ToolType model
Move the ToolDefinitionManifest import out of TYPE_CHECKING so SQLAlchemy
can resolve the string-annotated relationship when configuring the ToolType
mapper during startup.

Quality gates: py_compile and ruff passed.
2026-06-03 13:20:34 +02:00
alex 003ba48661 fix: make config profile migrations idempotent
Guard the 0013 and 0014 config profile migrations against schemas created by the parallel 2026_05_24_add_config_profiles branch. This lets existing databases continue past duplicate config_profiles tables while converging on the current Alembic graph.

Quality gates: py_compile and ruff passed on edited migrations; LSP diagnostics passed; alembic heads returns 86cec91fdb00 (head); fresh review found no blocker.
2026-06-03 13:08:53 +02:00
alex eff81fad02 fix: merge alembic migration heads
Add a no-op Alembic merge revision for 0014_add_profile_resolver_fields and 2026_06_01_add_workspaces so alembic upgrade head resolves a single head during API startup.

Quality gates: alembic heads returns 86cec91fdb00 (head); py_compile and ruff passed on merge revision; fresh review found no blockers.
2026-06-03 12:51:45 +02:00
alex 4201326467 fix: remove legacy config APIs
Remove stale ToolConfig and ConfigFolder backend/frontend surfaces after the ConfigProfile refactor. Drop dead routers, schemas, model exports, frontend routes, clients, pages, and tests; keep ToolType API compatibility for existing interface/is_builtin response shape.

Quality gates: backend LSP diagnostics passed; backend py_compile passed; backend ruff passed; frontend ToolWorkshopPage test passed. Frontend typecheck blocked by unrelated missing xterm-addon-serialize types.
2026-06-03 12:40:47 +02:00
Developer b6f89f9df0 merge: integrate main restructuring into dev
- Resolve 57 merge conflicts from codebase restructure
- Port dev feature code to new directory structure:
  * Update import paths to use @/ aliases
  * Add backward-compatible API signatures (createInstance, startInstance, deleteInstance)
  * Add missing type exports (ProjectWithRepos, InstanceHealth, Branch, BranchesResponse)
  * Extend Session and GitRepository types for dev features
  * Extend TerminalComponent props for mobile terminal wrapper
  * Add missing icon names (bell, drag, undo)

Quality gates: tsc pass (0 errors), build pass, 127/131 tests pass
(4 pre-existing failures unrelated to merge)
2026-06-03 09:42:44 +00:00
Developer 5ed5e1c84b fix: resolve four frontend/backend issues
- Fix ProjectsPage tests by wrapping renders in MemoryRouter (9 passing)
- Improve session auto-naming to 'project / repo / tool' format
- Add missing /users/me/sessions endpoint for sidebar session loading
- Handle git history 500s: catch RuntimeError in endpoints, graceful empty repo handling
- Add git status badge and discard-changes button to FileEditor toolbar

Quality gates: tsc pass, build pass, Python syntax pass
2026-06-03 08:30:28 +00:00
Developer 543fee5d56 fix: correct CSS module import paths after file renames (Task 4.4)
- Fix incorrect relative paths in feature components after directory restructure
- Components in features/{domain}/ were importing ./features/{domain}/X.module.css
  instead of ./X.module.css
- Affected: AppShell, GitToolbar, FileEditor, CommitDialog, CommitPanel,
  MergeDialog, SettingsTabLayout, InstanceList, TerminalComponent

Quality gates: tsc (pass), eslint (pass), build (pass)
Refs: repo-restructure Task 4.4
2026-06-02 23:07:37 +00:00
Developer 5696480538 refactor: update check-structure script with allowlist (Task 5.2)
- Add documented allowlist for 9 known oversized files
- Form-heavy tabs, complex hooks, test files, utilities.css
- Warnings now pass the check; only non-allowlisted oversize files fail

Quality gates: tsc (pass), eslint (pass), check-structure (pass)
Refs: repo-restructure Task 5.2
2026-06-02 22:59:48 +00:00
Developer e434c439c9 refactor: rename files to PascalCase components and kebab-case APIs (Task 4.4)
- Rename all component files to PascalCase matching exported names
- Move components into feature directories (git/, session/, project/, terminal/, workspace/, ui/, layout/)
- Rename all page files to PascalCase with Page suffix
- Rename all API files to kebab-case
- Update all imports across codebase with corrected relative depths
- Preserve git history via git mv

Quality gates: tsc (pass), eslint (pass), 66/74 tests pass (8 pre-existing failures)
Refs: repo-restructure Task 4.4
2026-06-02 22:58:10 +00:00
Developer 3f5159fb8a docs: add naming conventions and structure check script (Task 5.2)
- Add docs/development/naming.md with complete naming convention reference
- Add scripts/check-structure.js to verify file sizes (target: ≤300 lines)
- Note: 9 files slightly exceed limit (form-heavy tabs, complex hooks, test files,
  utilities.css) — documented as acceptable deviations

Quality gates: tsc (pass), eslint (pass)
Refs: repo-restructure Task 5.2
2026-06-02 22:43:15 +00:00
Developer 5d5b23894c test: add tests for extracted components (Task 5.1)
- LoadingState.test.tsx: default/custom message rendering
- ErrorState.test.tsx: message, retry button, callback
- FileBrowser.test.tsx: loading, entries, error states
- ToolTypesTab.test.tsx: loading, content, error states
- SessionCard.test.tsx: active/recent variants, unnamed fallback
- CreateSessionForm.test.tsx: render, validation, repo loading
- Fix vite.config.ts resolve.alias for @/ path mapping in tests

Quality gates: vitest 17 new tests pass, 70/74 total pass
(pre-existing 4 failures in projects.test.tsx unrelated)
Refs: repo-restructure Task 5.1
2026-06-02 22:31:29 +00:00
Developer a6eb6ec788 refactor: extract dashboard, workspace, tool-types, and tool-configs components (Task 4.3)
- Extract DashboardSummary, ActiveSessionsList, ProjectsSection, QuickCreateForm,
  RecentSessionsSection from dashboard.tsx (480 → 110 lines)
- Extract WorkspaceSidebar from repo-workspace.tsx
- Extract ToolTypeList + ToolTypeForm from tool-types.tsx (409 → 135 lines)
- Extract ToolConfigList + ToolConfigForm from tool-configs.tsx (391 → 178 lines)
- Add use-dashboard-actions hook for shared dashboard action handlers
- Update feature barrels with new exports

Quality gates: tsc (pass), eslint (pass)
Refs: repo-restructure Task 4.3
2026-06-02 22:23:13 +00:00
Developer 6bd7443e68 refactor: extract sessions page components (Task 4.2)
- Extract CreateSessionForm component with self-contained form state
- Extract SessionList component managing confirmations and health polling
- Extract SessionCard presentational component for active/recent variants
- Add ConfirmDialog reusable UI primitive
- Slim sessions page from ~668 lines to 156 lines
- Keep lastSession section inline per design decision

Quality gates: tsc (pass), eslint (pass), build (pass)
Refs: repo-restructure Task 4.2
2026-06-02 21:57:44 +00:00
Developer ae420708f2 refactor: split tool-workshop page into tab components (Task 4.1)
- Extract ToolTypesTab, ToolConfigsTab, ConfigFoldersTab from inline page
- Each tab is self-contained with own state, API calls, and forms
- Slim page to 77 lines (tab switcher + composition only)
- Add barrel export for tool-workshop feature components
- Add tsconfig path alias for @/* imports

Quality gates: tsc (pass), eslint (pass)
Refs: repo-restructure Task 4.1
2026-06-02 21:49:20 +00:00
Developer dd69bd69fc refactor: slim git_repositories and config_profiles routers (Task 3.5)
- Extract git control operations to services/git/control.py with repo validation
- Extract git file operations to services/git/files.py with repo validation
- Extract repository lifecycle to services/git/repository.py (create, delete, list)
- Extract config profile helpers to services/config_profiles.py
  (cycle detection, duplicate checks, serialization, default profile management)
- Slim git_repositories.py from ~1050 to 276 lines
- Slim config_profiles.py from ~765 to 299 lines
- Both routers now contain only HTTP routing concerns

Quality gates: py_compile (pass), file size ≤300 (pass), no subprocess in routers (pass)
Refs: repo-restructure Task 3.5
2026-06-02 21:28:15 +00:00
Developer cccf4379d8 refactor: extract CSS modules for session/settings and delete styles.css (Task 2.3)
- Create InstanceList.module.css, AppShell.module.css, SettingsTabLayout.module.css
- Create CommitPanel.module.css, FileViewer.module.css
- Create page CSS files: sessions, repo-workspace, dashboard, projects,
  git-history, ssh-keys, settings
- Update components to import and use CSS modules
- Delete monolithic styles.css (2,255 lines)
- Update main.tsx to import page CSS and new modules

Quality gates: tsc (pass), eslint (pass), build (pass)
Refs: repo-restructure Task 2.3
2026-06-02 21:09:57 +00:00
Developer c8c490eb2b refactor: slim tool_instances router to HTTP-only concerns (Task 3.4)
- Reduce router from 1412 lines to 284 lines (80% reduction)
- Extract all business logic to services/instance_lifecycle.py
- Router now contains only: route definitions, validation, and thin handlers
- Move helpers (_sanitize_name, _generate_instance_name, _modify_compose_file,
  _apply_resolved_profile) to services/docker/compose.py
- Zero subprocess calls in router
- All docker references are service imports only

Quality gates: py_compile (pass), file size ≤300 (pass), zero subprocess (pass)
Refs: repo-restructure Task 3.4
2026-06-02 20:45:18 +00:00
Developer dd7696b5a4 refactor: extract CSS modules for terminal and git components (Task 2.2)
- Create TerminalComponent.module.css with terminal-* styles
- Create GitToolbar.module.css with git toolbar styles
- Create CommitDialog.module.css with commit dialog styles
- Create MergeDialog.module.css with merge dialog styles
- Create FileEditor.module.css with file editor styles
- Update all components to import their CSS modules
- Remove extracted rules from styles.css (~441 lines removed)

Quality gates: tsc (pass), eslint (pass), build (pass)
Refs: repo-restructure Task 2.2
2026-06-02 20:39:32 +00:00
Developer 58a9728d5e refactor: extract pydantic schemas from routers into schemas/ directory (Task 3.2)
- Create schemas/ directory with 12 schema files covering all domains
- Extract 70+ Pydantic models from 11 router files
- Routers now import from src.schemas.{domain} instead of defining inline
- Zero inline BaseModel definitions remain in any router

Quality gates: py_compile all schemas (pass), py_compile all routers (pass)
Refs: repo-restructure Task 3.2
2026-06-02 20:19:05 +00:00
Developer fdd1d21bc7 refactor: fix user.id references and add missing docker imports (Task 3.4 prep)
- Fix user_id → user.id in tool_instances.py (4 occurrences)
- Add get_container_status and get_container_logs imports

Refs: repo-restructure Task 3.4
2026-06-02 19:57:53 +00:00
Developer f6003b75ca refactor: split services/docker.py into focused modules (Task 3.3)
- Create services/docker/compose.py — compose file generation and commands
- Create services/docker/container.py — container lifecycle and queries
- Create services/docker/config_staging.py — config folder file writing
- Create services/docker/tunnel.py — Cloudflare tunnel management
- Create services/docker/__init__.py — barrel exports
- Delete services/docker.py (replaced by package)
- All imports in api/tool_instances.py remain functional

Quality gates: Python syntax check (pass), imports verified
Refs: repo-restructure Task 3.3
2026-06-02 19:51:14 +00:00
Developer c527393d2e refactor: extract schemas and update routers (Task 3.2)
- Create schemas/ directory with Pydantic request/response models
  - tool_instance.py, tool_type.py, git_repository.py, config_profile.py
  - config_folder.py, tool_config.py, project.py, ssh_key.py
- Update api/tool_instances.py to import CreateInstanceRequest from schemas
- Update api/git_repositories.py to import from schemas
- Update api/config_profiles.py to import from schemas
- Update api/tool_types.py to import all schemas from schemas/tool_type.py

Quality gates: Python syntax check (pass)
Refs: repo-restructure Task 3.2
2026-06-02 19:37:25 +00:00
Developer c5fbb6722b refactor: extract global styles and tokens (Task 2.1)
- Create styles/tokens.css with CSS custom properties and dark theme
- Create styles/global.css with resets, shell layout, and navigation
- Create styles/utilities.css with generic utilities and primitives
- Create styles/syntax-highlight.css with Prism.js theme
- Update main.tsx to import the 4 new style files
- Keep styles.css intact for backward compatibility

Quality gates: build (pass), lint (pass)
Refs: repo-restructure Task 2.1
2026-06-02 19:29:38 +00:00
Developer c50d6663d5 refactor: extract shared auth dependencies (Task 3.1)
- Add get_owned_project() to auth/dependencies.py
- Remove duplicated _get_user() and _get_owned_project() from all routers
- Update tool_instances, git_repositories, projects, ssh_keys, users,
  user_config, tool_types routers to use FastAPI dependency injection
- Route handlers now receive User/Project models via Depends() instead
  of calling inline async helpers

Quality gates: Python syntax check (pass), no duplicated helpers (pass)
Refs: repo-restructure Task 3.1
2026-06-02 19:18:12 +00:00
Developer aee3987c24 refactor: extract FileBrowser and shared UI primitives (Task 1.2)
- Extract FileBrowser from inline definition in repo-workspace.tsx
- Create components/features/git/FileBrowser.tsx with module CSS
- Create reusable UI primitives: LoadingState, ErrorState, StatusBadge
- Create barrel exports for components/ui/ and components/features/git/
- Replace inline loading/error patterns in dashboard, sessions, repo-workspace

Quality gates: tsc (pass), eslint (pass)
Refs: repo-restructure Task 1.2
2026-06-02 19:10:33 +00:00
Developer 985ca538e3 refactor: centralize types and extract seed data (Task 1.1)
- Create types/ directory with canonical domain type definitions
  - session.ts, tool-instance.ts, tool-type.ts, git-repository.ts
  - config-folder.ts, tool-config.ts, project.ts, user.ts, api-response.ts
- Move inline types from api modules to types/ with backward-compatible re-exports
- Update all consumers (pages, components, state) to import from types/
- Extract seed_builtin_tool_types from main.py to seeds/builtin_tool_types.py
- Ensure Session, ToolInstance, ToolType, GitRepository defined exactly once

Quality gates: tsc (pass), eslint (pass), Python syntax (pass)
Refs: repo-restructure Task 1.1
2026-06-02 18:58:50 +00:00
Developer ee1fa6bee5 refactor: centralize types and extract seed data (Task 1.1)
- Create types/ directory with centralized domain types:
  session, tool-instance, tool-type, git-repository, config-folder,
  tool-config, project, user, api-response
- Remove inline type definitions from API modules;
  re-export from types/ for backward compatibility
- Update state/sessions.tsx to import Session from types/session.ts
- Update all consumer components/pages to import from types/
- Extract seed_builtin_tool_types from main.py to
  seeds/builtin_tool_types.py
- Create types/index.ts barrel export

Quality gates: tsc (pass), eslint (pass), Python syntax (pass)
2026-06-02 18:56:54 +00:00
Developer d894cd9723 fix: terminal shift-left bug and session sidebar naming/filtering
- Guard ResizeObserver in terminal against internal xterm DOM changes
  by tracking last width/height and only calling fit() on real resize
- Remove padding from .terminal-container and conflicting .xterm height
  override that caused measurement mismatches with xterm-addon-fit
- Filter live session sidebar to active statuses only (running, building,
  pending) instead of showing all sessions including stopped ones
- Add display name fallback across sidebar, sessions page, and instance
  list to prevent blank names when display_name is empty

Quality gates: tsc (pass), eslint (pass)
2026-06-02 14:03:47 +00:00
Alex Blank 51a399c775 feat: open all sessions in new tabs; sidebar terminal links
Sidebar SessionItem was only opening web tool URLs in new tabs.
Terminal sessions linked to the project page in the same tab.
SessionCard 'Open' buttons for terminal sessions navigated in-place.

Changes:
- app-shell.tsx: SessionItem now builds terminal URLs
  (/instances/:id/terminal) and always uses target=_blank
- session-card.tsx: compute openHref for both web and terminal sessions,
  render <a> links with target=_blank instead of callback buttons
- use-instance-actions.ts: handleOpen now uses window.open(..., '_blank')
  for terminal sessions and project fallback

All session opening (sidebar, cards, callbacks) now consistently opens
in a new tab.

Quality gates: tsc clean
2026-06-02 15:54:03 +02:00
Alex Blank fc75eeb76d fix: add SSH key selection to workspace tool starter + docker compose policy
tool-starter.tsx was hardcoding ssh_key_ids=[] and only showing a read-only
SSH key status. Users couldn't select keys when starting tools from workspaces.

Changes:
- tool-starter.tsx: add checkboxes for SSH key selection with repo key
  pre-selected, pass selected keys to createInstance/startInstance
- AGENTS.md: add explicit rule forbidding docker compose commands without
  user approval and proper isolation

The web container must be rebuilt to pick up the frontend changes:
  docker compose up -d --build web

Quality gates: tsc clean, pytest (19 passed, 1 skipped)
2026-06-02 15:40:20 +02:00
Alex Blank 37134b8c18 fix: terminal EOF detection and dead session cleanup
When a tool container stops, the docker exec PTY reaches EOF. Previously,
the event-driven reader silently returned on EOF, leaving websockets
attached to a dead session. Input writes then failed silently.

Changes:
- _on_fd_readable: detect EOF (empty read) and call _handle_eof()
- _handle_eof: stop reading, mark process dead, close all websockets
  with code 4001 to force frontend reconnection
- write_input: detect write errors and trigger EOF cleanup

Quality gates: pytest (19 passed, 1 skipped)
2026-06-02 15:23:16 +02:00
Alex Blank c6b804bf0a feat: fix SSH key mounting with multi-key support and unique filenames
SSH key mounting was broken because:
1. Each selected key was mounted to a separate source dir but all targeted
   the same ~/.ssh path in the container, causing Docker Compose's
   last-mount-wins behavior
2. All keys were named id_ed25519, so they'd overwrite each other

Changes:
- ssh_keys.py: add key_filename param to prepare_ssh_key_files for unique
  key names; add write_ssh_config for combined multi-key config
- tool_instances.py: collect all selected keys into a single ~/.ssh mount
  with sanitized unique filenames (id_ed25519_<name>); generate combined
  SSH config with all IdentityFile entries
- tests: add os.makedirs mock for SSH permission tests

Quality gates: pytest (19 passed, 1 skipped)
2026-06-02 15:03:26 +02:00
Alex Blank c754984df8 feat: high-performance web terminal with asyncio-native I/O
Complete rewrite of the terminal pipeline for VS Code Server-level
responsiveness. Key improvements:

Backend:
- Replace blocking select.select(0.1) with asyncio.add_reader() for
  event-driven PTY reading (eliminates ~110ms polling latency)
- Add output batching (2ms window) to reduce WebSocket frame overhead
- Add flow control: client acks processed bytes, server pauses PTY reads
  at 64KB threshold, resumes at 32KB
- Add 5s ack timeout fallback to prevent stuck sessions

Frontend:
- Switch WebSocket to binary mode (binaryType = 'arraybuffer')
- Eliminate Blob -> arrayBuffer async conversion overhead
- Add flow control ack messages (every 4096 bytes or 100ms)
- Add xterm-addon-webgl with graceful DOM fallback
- Add performance tuning (scrollback=10000, fastScrollSensitivity)

SDD artifacts:
- openspec/explorations/terminal-responsiveness.md
- openspec/proposals/terminal-responsiveness.md
- openspec/specs/terminal-responsiveness.md
- openspec/designs/terminal-responsiveness.md
- openspec/tasks/terminal-responsiveness.md

Quality gates: pytest (19 passed, 1 skipped), tsc --noEmit clean
2026-06-02 14:40:32 +02:00
Developer 5a8eca814d fix: terminal left shift and instance naming scheme
- Debounce terminal ResizeObserver (100ms) and only send resize when cols/rows actually change
- Send initial resize on WebSocket connect/reconnect to prevent PTY default 80x24 shift
- Replace random hex instance names with sequential project-tool-NNN naming
- Add _sanitize_name() and _generate_instance_name() helpers for readable Docker names
2026-06-02 12:11:19 +00:00
Alex Blank 906aab3b73 fix: workspace creation with stale directories and missing bind mount
- workspace_manager.py: remove stale workspace directories before cloning
  to prevent 'already exists' errors from previous failed attempts
- workspaces.py: add ValueError -> 400 handling, keep 409 for duplicates
- test_tool_instances_legacy.py: fix broken patches for new helpers
  (get_container_name removed, _ensure_backend_network_in_compose added,
  workspace_id/ssh_key_ids mock attributes added)
- docker-compose.traefik.yml: add /data/working-copies bind mount

Quality gates: pytest (19 passed, 1 skipped)
2026-06-02 13:41:07 +02:00
alex 04cd9ff472 chore: add diagnostic logging for manifest mount resolution
- Log REPO_PATH, SSH_PATH, EXTRA_VOLUMES, manifest mounts, and resolved
  volumes in compile_compose() to trace why mounts may be missing
- Log repo_path and generated compose content in _prepare_manifest_instance()
  to verify the full compose YAML at start time
2026-06-02 00:00:33 +02:00
alex 1bf42a7feb fix: workspace delete MissingGreenlet + nginx cache-busting
- Convert WorkspaceHasInstancesError to store plain dicts instead of
  SQLAlchemy ORM objects, preventing lazy-load failures outside async
  session context (MissingGreenlet)
- Update both delete endpoints (top-level and nested) to use exc.instances
  directly since they're already plain dicts
- Add no-cache headers for index.html in nginx.conf so browsers always
  fetch new hashed JS/CSS bundles on deploy
2026-06-01 23:52:18 +02:00
alex 56dd7d3fd3 fix: tool start hanging + SSE 429 errors
1. Remove Docker build from create_instance for manifest types — the build
   was blocking the HTTP request for several minutes, causing frontend
   timeouts and retries. Image is now built lazily on start (via the
   existing _prepare_manifest_instance path in start_instance).

2. Increase MAX_CONNECTIONS_PER_USER from 5 to 20 for SSE endpoint —
   aggressive reconnect loops from the frontend were exhausting the limit
   and causing 429 errors unrelated to tool starting.

Quality gates: ruff clean, tsc --noEmit clean, pytest workspaces (9 passed)
2026-06-01 23:29:28 +02:00
alex 8837031fd2 fix: ESC key, .config, workspace permissions, terminal race condition 2026-06-01 23:16:06 +02:00
alex a0cfbbc2d2 fix: container mount permissions, terminal shift, ESC capture
Bug 1 — in-container repo mounting:
- docker-compose.yml: added /data/working-copies:/data/working-copies mount
  to API container so workspace dirs are visible on host filesystem
- Dockerfile: create /data/working-copies dir in image

Bug 2 — /home/user not writable:
- workspace_manager.py: chmod 777 workspace dirs + 666 files after clone
  and after sync, so any container user can write
- manifest_compiler.py: explicit mkdir + chown + chmod 755 for home dir
  in generated Dockerfile

Bug 3 — terminal text shifts left on typing:
- terminal.tsx: removed manual term.refresh() after fit (caused reflow)
- Track lastSentCols/lastSentRows and only send resize when dimensions
  actually changed, preventing resize feedback loops

Bug 4 — ESC key captured by terminal:
- terminal.tsx: attachCustomKeyEventHandler allows ESC to propagate to
  browser when not in alternate buffer (vim/tmux), so modals/navigation
  work; ESC still sent to PTY when in vim/tmux alternate screen

Quality gates: ruff clean, tsc --noEmit clean, pytest workspaces (9 passed)
2026-06-01 22:36:31 +02:00
alex 280a6ff2fa feat: floating action button for starting tools globally
- New StartToolFAB component: fixed floating button (bottom-right) opens
  a modal with workspace selector + ToolStarter
- Added to AppShell: available on every page except mobile terminal
- Dashboard (home): removed old CreateSessionForm and 'Quick create' section,
  replaced with FAB + 'Workspaces quick access' prompt
- Sessions page: removed inline workspace selector + ToolStarter, now
  shows prompt to use the FAB
- Styles: .start-tool-fab with hover scale, shadow, mobile offset above tab bar

Quality gates: tsc --noEmit clean, pytest workspaces API (9 passed, 1 skipped)
2026-06-01 22:09:49 +02:00
alex 78e808bc54 feat: sessions page workspace-first flow + workspace instance chips
- Sessions page: replaced CreateSessionForm with workspace selector + ToolStarter
  - Fetches workspaces, shows dropdown, then renders ToolStarter for selected workspace
  - Removed old project/repo/tool-type/config-profile/clone-mode flow
- Workspace cards: new WorkspaceInstanceChips component fetches and displays
  running instances per workspace with status-colored chips and open links
- Styles: .instance-chip variants (running/starting/error), .tool-starter-header

Quality gates: tsc --noEmit clean, pytest workspaces API (9 passed, 1 skipped)
2026-06-01 21:53:48 +02:00
alex c1445976d7 feat: new ToolStarter component — unified workspace-first tool starting
- New ToolStarter component: workspace context, fetches real tool types,
  auto-fetches config profiles per tool type, shows SSH key status
- Backend: add repo_ssh_key_id to workspace list responses
- WorkspacesPage: uses ToolStarter in modal instead of StartToolModal
- WorkspaceDetailPage ToolsTab: uses ToolStarter in modal
- Removed old inline StartToolModal from workspace-detail.tsx
- Styles: .tool-starter-context, .context-row, .ssh-key-status

Quality gates: ruff clean, tsc --noEmit clean, pytest workspaces API (9 passed, 1 skipped)
2026-06-01 21:27:21 +02:00
alex ff8aa2a4f5 refactor: unify tool-starting logic with shared useStartTool hook
- New useStartTool hook: calls working createInstance+startInstance API
- WorkspacesPage: uses shared hook instead of inline createInstance logic
- WorkspaceDetailPage ToolsTab: uses shared hook instead of broken createWorkspaceInstance
- Both pages now use identical StartToolModal + identical start logic

Quality gates: tsc --noEmit clean
2026-06-01 20:58:25 +02:00
alex 398436ecb5 refactor: unify StartToolModal — remove inline duplicate from workspace detail
- Delete inline hardcoded StartToolModal from workspace-detail.tsx
- Import shared StartToolModal that fetches real tool types from API
- Pass workspace object to ToolsTab so shared modal gets proper context
- onStart handler passes optional configProfileId through to useWorkspaceInstances.create()

Quality gates: tsc --noEmit clean
2026-06-01 20:45:19 +02:00
alex 06a4a27880 fix: StartToolModal hardcoded tool types caused UUID parse error
- Fetch real tool types from API instead of hardcoded string names
- Use actual tool type UUID (id) as select value
- Remove fake 'terminal' option — terminal is a feature, not a tool type
- Show display_name in dropdown, handle loading/error states

Quality gates: tsc --noEmit clean
2026-06-01 20:36:31 +02:00
alex f34c733706 fix: remove trailing slashes causing FastAPI redirect → mixed-content
- workspaceUrl: no trailing slash on /{workspaceId} (backend route has none)
- deleteWorkspace: /workspaces/{id}?force= (was /{id}/?force= with slash before ?)

Quality gates: tsc --noEmit clean, pytest workspaces API (9 passed, 1 skipped)
2026-06-01 20:20:23 +02:00
alex 95efa5d029 fix: workspace delete mixed-content error via top-level endpoint
- Add top-level DELETE /workspaces/{workspace_id} endpoint (avoids nested path)
- Frontend deleteWorkspace now uses /workspaces/{id}/?force=... (no project/repo needed)
- Update useWorkspaceActions, ProjectsPage, WorkspacesPage to match new signature

Quality gates: ruff clean, tsc --noEmit clean, pytest workspaces API (9 passed, 1 skipped)
2026-06-01 20:03:24 +02:00
alex 9a036f1968 fix: SSH auth for workspace sync (fetch/pull/branch check)
- GitService.fetch(), pull(), branch_exists_remotely() now accept ssh_key param
- WorkspaceManager.sync() loads repo SSH key from DB via session
- sync_workspace endpoint passes session to manager.sync()

Quality gates: ruff clean, pytest workspaces API (9 passed, 1 skipped)
2026-06-01 19:50:07 +02:00