feat: unified git repo hook + fix branch dropdown in workspace creation
- New useGitRepo hook: centralizes all git operations (branches, status, history, commit, push, pull, fetch, checkout, create/delete branch, merge) for a given project+repo. Auto-refreshes after mutating ops. - Fix WorkspaceCreateForm branch dropdown: - Always renders <select> (never input fallback) - Uses useGitRepo for branch fetching with loading/error states - Shows 'Loading branches...' while fetching - Shows 'Enter branch name manually...' if API fails - '+ Create new branch...' option with text input reveal - Auto-selects default branch on load - ProjectsPage uses updated form props (defaultProjectId/defaultRepoId) Quality gates: tsc --noEmit clean, eslint clean
This commit is contained in:
@@ -10,10 +10,7 @@ import {
|
||||
type ProjectCreateInput,
|
||||
type ProjectUpdateInput,
|
||||
} from "../api/projects";
|
||||
import {
|
||||
deleteWorkspace,
|
||||
syncWorkspace,
|
||||
} from "../api/workspaces";
|
||||
import { deleteWorkspace, syncWorkspace } from "../api/workspaces";
|
||||
import {
|
||||
EmptyState,
|
||||
ErrorState,
|
||||
@@ -111,8 +108,6 @@ export const ProjectsPage = () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
const handleSyncWorkspace = async (
|
||||
projectId: string,
|
||||
repoId: string,
|
||||
|
||||
Reference in New Issue
Block a user