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.
This commit is contained in:
@@ -0,0 +1,142 @@
|
||||
# Git Control - Tasks
|
||||
|
||||
## Phase 1: Backend Git Utilities
|
||||
|
||||
- [x] **Task 1.1**: Extend git utilities
|
||||
- Add to `src/utils/git_control.py`:
|
||||
- `get_status(repo_path)` - working directory status
|
||||
- `create_branch(repo_path, name, base)` - create branch
|
||||
- `delete_branch(repo_path, name)` - delete branch
|
||||
- `checkout_branch(repo_path, name)` - switch branch
|
||||
- `commit_changes(repo_path, message, author)` - commit
|
||||
- Add tests
|
||||
|
||||
- [x] **Task 1.2**: Add remote operations
|
||||
- Add to `src/utils/git_control.py`:
|
||||
- `fetch(repo_path)` - fetch from remote
|
||||
- `pull(repo_path, branch)` - pull updates
|
||||
- `push(repo_path, branch)` - push changes
|
||||
- `merge(repo_path, source, target, message)` - merge
|
||||
- Handle errors (conflicts, auth, etc.)
|
||||
- Add tests
|
||||
|
||||
## Phase 2: Backend API Endpoints
|
||||
|
||||
- [x] **Task 2.1**: Branch management endpoints
|
||||
- POST `/projects/{id}/repositories/{id}/branches` - create
|
||||
- DELETE `/projects/{id}/repositories/{id}/branches/{name}` - delete
|
||||
- POST `/projects/{id}/repositories/{id}/checkout` - checkout
|
||||
- Add to `src/api/git_repositories.py`
|
||||
|
||||
- [x] **Task 2.2**: Status endpoint
|
||||
- GET `/projects/{id}/repositories/{id}/status`
|
||||
- Returns working directory status
|
||||
|
||||
- [x] **Task 2.3**: Commit endpoint
|
||||
- POST `/projects/{id}/repositories/{id}/commits`
|
||||
- Commits all staged changes
|
||||
|
||||
- [x] **Task 2.4**: Remote operation endpoints
|
||||
- POST `/projects/{id}/repositories/{id}/fetch`
|
||||
- POST `/projects/{id}/repositories/{id}/pull`
|
||||
- POST `/projects/{id}/repositories/{id}/push`
|
||||
|
||||
- [x] **Task 2.5**: Merge endpoint
|
||||
- POST `/projects/{id}/repositories/{id}/merge`
|
||||
- Handle conflict responses
|
||||
|
||||
## Phase 3: Frontend Git Toolbar
|
||||
|
||||
- [ ] **Task 3.1**: Create GitToolbar component
|
||||
- Fetch, Pull, Push buttons
|
||||
- Branch selector with count badges
|
||||
- Commit button
|
||||
- Merge button
|
||||
- Add to workspace layout
|
||||
|
||||
- [ ] **Task 3.2**: Add status polling
|
||||
- Poll status every 5 seconds
|
||||
- Update toolbar badges (ahead/behind)
|
||||
- Show commit button when changes exist
|
||||
|
||||
## Phase 4: Branch Management
|
||||
|
||||
- [ ] **Task 4.1**: Enhance BranchSelector
|
||||
- Add "Create new branch" option
|
||||
- Add delete option with confirmation
|
||||
- Show current branch
|
||||
- Call branch API endpoints
|
||||
|
||||
- [ ] **Task 4.2**: Create NewBranchDialog
|
||||
- Branch name input
|
||||
- Base branch selector
|
||||
- Create/Cancel buttons
|
||||
|
||||
## Phase 5: Commit Workflow
|
||||
|
||||
- [ ] **Task 5.1**: Create CommitPanel component
|
||||
- Shows when files are modified
|
||||
- Lists changed files
|
||||
- Commit message input
|
||||
- Commit button
|
||||
- Success/error feedback
|
||||
|
||||
- [ ] **Task 5.2**: Add status indicators to FileTree
|
||||
- Modified icon (✏️)
|
||||
- New file icon (✨)
|
||||
- Deleted icon (🗑️)
|
||||
- Untracked icon (❓)
|
||||
|
||||
## Phase 6: Remote Operations
|
||||
|
||||
- [ ] **Task 6.1**: Implement fetch/pull/push
|
||||
- Wire toolbar buttons to API
|
||||
- Show progress indicators
|
||||
- Handle errors (auth, conflicts, etc.)
|
||||
- Update status after operations
|
||||
|
||||
- [ ] **Task 6.2**: Create MergeDialog
|
||||
- Source branch selector
|
||||
- Target branch display
|
||||
- Commit message input
|
||||
- Merge/Cancel buttons
|
||||
- Handle conflicts
|
||||
|
||||
## Phase 7: Integration & Polish
|
||||
|
||||
- [ ] **Task 7.1**: Wire everything together
|
||||
- Connect toolbar to all APIs
|
||||
- Update workspace state after operations
|
||||
- Refresh file tree on branch switch
|
||||
|
||||
- [ ] **Task 7.2**: Add error handling
|
||||
- Show toast notifications for operations
|
||||
- Handle all error cases gracefully
|
||||
- Provide recovery options
|
||||
|
||||
- [ ] **Task 7.3**: Add CSS styles
|
||||
- Toolbar layout
|
||||
- Status indicators
|
||||
- Commit panel
|
||||
- Dialogs
|
||||
|
||||
- [ ] **Task 7.4**: Run quality gates
|
||||
- Backend: ruff, mypy, pytest
|
||||
- Frontend: typecheck, lint, build
|
||||
|
||||
## Phase 8: Testing
|
||||
|
||||
- [ ] **Task 8.1**: Backend tests
|
||||
- Test all git operations
|
||||
- Test error cases
|
||||
- Test auth failures
|
||||
|
||||
- [ ] **Task 8.2**: Frontend tests
|
||||
- Test toolbar interactions
|
||||
- Test branch management
|
||||
- Test commit workflow
|
||||
|
||||
- [ ] **Task 8.3**: Manual testing
|
||||
- Create branch → edit → commit → push → merge workflow
|
||||
- Test error scenarios
|
||||
- Test with multiple repos
|
||||
Reference in New Issue
Block a user