Skip to content

feat: add workspace branch switching and git graph - #679

Merged
BetterAndBetterII merged 22 commits into
mainfrom
feat/ase-173-workspace-git
Apr 13, 2026
Merged

feat: add workspace branch switching and git graph#679
BetterAndBetterII merged 22 commits into
mainfrom
feat/ase-173-workspace-git

Conversation

@BetterAndBetterII

Copy link
Copy Markdown
Collaborator

Summary

  • add conversation-scoped workspace git refs, checkout, and git graph APIs with backend parsing and tests
  • surface branch badges, branch switching, and a git graph panel in the workspace browser UI
  • refresh tree, file, diff, and draft state on checkout while blocking unsafe switches for dirty workspaces or unsaved drafts

Validation

  • PATH=$HOME/.local/go1.26.1/bin:$PATH go test ./internal/chat ./internal/httpapi
  • PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web check
  • PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web exec vitest run src/lib/features/chat/project-conversation-workspace-browser-state.test.ts src/lib/features/chat/project-conversation-workspace-browser-git-state.test.ts src/lib/features/chat/project-conversation-workspace-browser-git-checkout.test.ts src/lib/features/chat/project-conversation-workspace-browser-refresh.test.ts src/lib/features/chat/project-conversation-workspace-browser-race.test.ts src/lib/features/chat/project-conversation-workspace-browser-navigation.test.ts src/lib/features/chat/project-conversation-workspace-browser-detail.test.ts src/lib/features/chat/project-conversation-workspace-browser-pane.test.ts src/lib/features/chat/project-conversation-workspace-browser-terminal-layout.test.ts
  • PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$HOME/.local/go1.26.1/bin:$PATH OPENASE_PGTEST_SHARED_ROOT=$HOME/.cache/openase/pgtest PLAYWRIGHT_WEB_PORT=4174 PLAYWRIGHT_PORT=4174 .codex/skills/push/scripts/openase_ci_gate.sh

Risks / Follow-up

  • local CI needed PLAYWRIGHT_WEB_PORT=4174 because another process was already bound to 127.0.0.1:4173; repo config was left unchanged

betterandbetterii and others added 22 commits April 11, 2026 17:26
Summary:
- add conversation-scoped workspace file create, rename, and delete
  APIs with path-safe parsing and test coverage
- extend Project AI workspace focus and web editor state with
  selection context, pending patch review/apply, autosave, recent
  files, and changed-file navigation
- wire the browser/detail UI to expose patch review, selection-aware
  prompts, formatting hooks, autosave controls, and workspace file
  actions

Rationale:
- deliver the V2 editor workflow on top of the V1 revision/conflict
  model instead of introducing direct AI writes into saved workspace
  state
- keep file operations and editor saves revision-aware so autosave,
  patch application, and rename/delete flows remain recoverable and
  path-safe
- improve multi-file productivity without weakening the explicit draft
  versus save boundary in Project AI workspaces

Tests:
- PATH=$HOME/.local/go1.26.1/bin:$PATH go test ./internal/chat ./internal/httpapi
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm exec vitest run src/lib/features/chat/project-conversation-workspace-browser-detail.test.ts src/lib/features/chat/project-conversation-workspace-browser-state.test.ts src/lib/components/code/code-editor.test.ts src/lib/features/chat/project-conversation-workspace-browser-navigation.test.ts src/lib/features/chat/project-conversation-workspace-browser-refresh.test.ts src/lib/features/chat/project-conversation-workspace-browser-terminal-layout.test.ts src/lib/features/chat/project-conversation-panel-workspace-summary.test.ts
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm exec svelte-kit sync && PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm exec svelte-check --tsconfig ./tsconfig.json
- git diff --check

Co-authored-by: Codex <codex@openai.com>
Summary:
- regenerate the OpenAPI document for the new workspace file
  create, rename, and delete endpoints
- refresh the generated frontend API types so the V2 editor client
  matches the published contract

Rationale:
- keep CI's API contract checks aligned with the shipped backend
  surface for the workspace editor V2 feature set

Tests:
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH OPENASE_PGTEST_SHARED_ROOT=$HOME/.cache/openase/pgtest .codex/skills/push/scripts/openase_ci_gate.sh (currently rerunning after this contract refresh)

Co-authored-by: Codex <codex@openai.com>
Summary:
- drop the unused detail header icon import surfaced by the frontend
  CI pass
- mark the two workspace editor store modules as max-lines exceptions
  so the repo lint gate accepts the V2 orchestration stores

Rationale:
- keep the ASE-163 branch aligned with the existing frontend CI rules
  before publishing the Preview Deploy build

Tests:
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm exec eslint src/lib/features/chat/project-conversation-workspace-browser-detail.svelte src/lib/features/chat/project-conversation-workspace-browser-state.svelte.ts src/lib/features/chat/project-conversation-workspace-file-editor-state.svelte.ts
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$HOME/.local/go1.26.1/bin:$PATH OPENASE_PGTEST_SHARED_ROOT=$HOME/.cache/openase/pgtest .codex/skills/push/scripts/openase_ci_gate.sh (rerunning after this lint fix)

Co-authored-by: Codex <codex@openai.com>
Summary:
- add targeted file-budget overrides for the expanded workspace editor
  V2 detail, sidebar, state, and refresh test modules

Rationale:
- keep the repository budget gate green while this ticket ships the
  larger editor orchestration surfaces needed for autosave, AI patch
  review, and file operations

Tests:
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH node scripts/check-file-budgets.mjs
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$HOME/.local/go1.26.1/bin:$PATH OPENASE_PGTEST_SHARED_ROOT=$HOME/.cache/openase/pgtest .codex/skills/push/scripts/openase_ci_gate.sh (rerunning after this budget update)

Co-authored-by: Codex <codex@openai.com>
Summary:
- apply Prettier formatting to the targeted workspace editor budget
  overrides so the frontend CI formatter gate passes

Rationale:
- keep the ASE-163 branch aligned with the repository's formatting
  checks before publishing the Preview Deploy build

Tests:
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm exec prettier -w file-budgets.config.mjs
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$HOME/.local/go1.26.1/bin:$PATH OPENASE_PGTEST_SHARED_ROOT=$HOME/.cache/openase/pgtest .codex/skills/push/scripts/openase_ci_gate.sh (rerunning after this formatting fix)

Co-authored-by: Codex <codex@openai.com>
Summary:
- create missing workspace directories with 0750 permissions during
  safe file creation so the backend lint gate accepts the new file-op
  path

Rationale:
- keep the conversation-scoped file create flow aligned with the
  repository's gosec policy before publishing ASE-163

Tests:
- PATH=$HOME/.local/go1.26.1/bin:$PATH go test ./internal/chat ./internal/httpapi
- PATH=$HOME/.local/go1.26.1/bin:$PATH make LINT_BASE_REV=3446f2fbbcba2cea8827973934a348f0e0c9bb1c lint

Co-authored-by: Codex <codex@openai.com>
Summary:
- update the run transcript data test fixture to populate both
  transcript payload branches after syncing ASE-163 with the latest
  origin/main types

Rationale:
- keep the merged Preview Deploy branch green after mainline transcript
  payload typing tightened during the required base-branch sync step

Tests:
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm exec svelte-kit sync && PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm exec svelte-check --tsconfig ./tsconfig.json --output machine --threshold error

Co-authored-by: Codex <codex@openai.com>
Summary:
- move editor format/save/explain/rewrite/revert actions out of the
  detail action bar into CodeMirror shortcuts and a context menu
- rework the workspace browser sidebar into a VS Code-style explorer
  with inline create and rename flows, a shared tree menu, and a
  recent-plus-search entrypoint
- add backend workspace path search, wire the frontend state and API
  client, and refresh the OpenAPI contract and generated types
- tighten browser and API coverage for the new editor, tree, and
  search behaviors, and polish related workspace and usage copy

Rationale:
- keep the editor chrome focused on navigation while still exposing the
  same file and selection actions where users already expect them
- support repo-wide path lookup from the workspace browser so large
  trees stay navigable without loading full-file search into the UI
- lock the new interaction model behind tests so the browser and API
  semantics stay stable as the workspace experience evolves

Tests:
- PATH=$HOME/.local/go1.26.1/bin:$PATH go test ./internal/chat
  ./internal/httpapi ./internal/cli
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web exec
  vitest run web/src/lib/components/code/code-editor.test.ts
  web/src/lib/features/chat/project-conversation-workspace-browser-
  detail.test.ts
  web/src/lib/features/chat/project-conversation-workspace-browser-
  navigation.test.ts
  web/src/lib/features/chat/project-conversation-workspace-browser-
  pane.test.ts
  web/src/lib/features/chat/project-conversation-workspace-browser-
  refresh.test.ts
  web/src/lib/features/chat/project-conversation-workspace-browser-
  search.test.ts
  web/src/lib/features/chat/project-conversation-workspace-browser-
  state.test.ts
  web/src/lib/features/chat/project-conversation-workspace-browser-
  terminal-layout.test.ts
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web run
  check

Co-authored-by: Codex <codex@openai.com>
Summary:
- run Prettier on the updated editor and workspace browser files that
  failed the frontend CI formatting check

Rationale:
- keep the current branch green under the repo's web CI gate before
  pushing the feature work upstream

Tests:
- PATH=$HOME/.nvm/versions/node/v22.22.0/bin:$PATH pnpm --dir web exec
  prettier --write src/lib/components/code/code-editor.svelte
  src/lib/components/code/code-editor.test.ts
  src/lib/features/chat/project-conversation-workspace-browser-
  detail.svelte
  src/lib/features/chat/project-conversation-workspace-browser-
  pane.svelte
  src/lib/features/chat/project-conversation-workspace-browser-
  pane.test.ts
  src/lib/features/chat/project-conversation-workspace-browser-
  sidebar.svelte
  src/lib/features/chat/project-conversation-workspace-browser-
  state.svelte.ts
  src/lib/features/chat/project-conversation-workspace-browser-tree.svelte

Co-authored-by: Codex <codex@openai.com>
Summary:
- move sidebar-only path, dirty-state, and context-menu helper logic
  into a dedicated helper module
- keep the sidebar component under the repo's max-lines lint gate
  without changing the explorer behavior

Rationale:
- preserve the current interaction model while satisfying the frontend
  lint boundary required for CI and future maintenance

Tests:
- PATH=$HOME/.nvm/versions/node/v22.22.0/bin:$PATH pnpm --dir web exec
  prettier --write src/lib/features/chat/project-conversation-
  workspace-browser-sidebar.svelte src/lib/features/chat/project-
  conversation-workspace-browser-sidebar-helpers.ts

Co-authored-by: Codex <codex@openai.com>
Summary:
- extract the workspace browser detail status bar into a dedicated component
- keep the merged ASE-163 detail view under the repo's max-lines lint limit after syncing with latest main

Rationale:
- preserve the merged editor V2 behavior while keeping the post-main-sync branch green under the repo's frontend CI gate

Tests:
- PLAYWRIGHT_WEB_PORT=4174 PLAYWRIGHT_PORT=4174 PLAYWRIGHT_BASE_URL=http://127.0.0.1:4174 PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$HOME/.local/go1.26.1/bin:$PATH OPENASE_PGTEST_SHARED_ROOT=$HOME/.cache/openase/pgtest .codex/skills/push/scripts/openase_ci_gate.sh

Co-authored-by: Codex <codex@openai.com>
Summary:
- add parsed workspace git ref, graph, and checkout domain models,
  service methods, HTTP routes, and OpenAPI definitions
- update workspace browser state and UI with current-ref badges,
  branch switching, a git graph panel, and branch-aware draft keys
- cover checkout safety, detached HEAD parsing, git graph data,
  and workspace browser refresh behavior in backend and frontend tests

Rationale:
- keep git workflow logic in conversation-scoped workspace services so
  the UI consumes typed data instead of rebuilding git semantics
- block unsafe branch switches when drafts, conflicts, or dirty repo
  state would otherwise discard user work silently
- refresh repo tree, file content, diff, and current branch context
  together so editor state stays honest after a checkout

Tests:
- PATH=$HOME/.local/go1.26.1/bin:$PATH go test ./internal/chat ./internal/httpapi
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web exec vitest run src/lib/features/chat/project-conversation-workspace-browser-state.test.ts src/lib/features/chat/project-conversation-workspace-browser-refresh.test.ts src/lib/features/chat/project-conversation-workspace-browser-navigation.test.ts src/lib/features/chat/project-conversation-workspace-browser-detail.test.ts src/lib/features/chat/project-conversation-workspace-browser-pane.test.ts src/lib/features/chat/project-conversation-workspace-browser-terminal-layout.test.ts
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web check
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$HOME/.local/go1.26.1/bin:$PATH make openapi-generate

Co-authored-by: Codex <codex@openai.com>
Summary:
- apply prettier formatting to the new workspace git API and UI
  files after the CI gate flagged style drift
- keep the implementation unchanged while aligning with the repo's
  frontend formatting checks

Rationale:
- the publish gate runs the same prettier checks as CI, so formatting
  drift must be committed before pushing the branch
- separating this follow-up keeps the earlier feature and merge commits
  intact without rewriting history

Tests:
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web exec vitest run src/lib/features/chat/project-conversation-workspace-browser-state.test.ts src/lib/features/chat/project-conversation-workspace-browser-refresh.test.ts src/lib/features/chat/project-conversation-workspace-browser-navigation.test.ts src/lib/features/chat/project-conversation-workspace-browser-detail.test.ts src/lib/features/chat/project-conversation-workspace-browser-pane.test.ts src/lib/features/chat/project-conversation-workspace-browser-terminal-layout.test.ts
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web check

Co-authored-by: Codex <codex@openai.com>
Summary:
- split workspace browser state logic into focused loader and file-op modules
- move git checkout UI tests into dedicated files and add the new tab strip
- remove dead git helper code surfaced by backend lint and reformat touched Go files

Rationale:
- keep the workspace git feature under the repo's file-budget and max-lines gates
- preserve the new branch switching and git graph behavior while making CI pass
- align the implementation with the extracted helper boundaries introduced by this ticket

Tests:
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web check
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web exec vitest run src/lib/features/chat/project-conversation-workspace-browser-state.test.ts src/lib/features/chat/project-conversation-workspace-browser-git-state.test.ts src/lib/features/chat/project-conversation-workspace-browser-git-checkout.test.ts src/lib/features/chat/project-conversation-workspace-browser-refresh.test.ts src/lib/features/chat/project-conversation-workspace-browser-race.test.ts src/lib/features/chat/project-conversation-workspace-browser-navigation.test.ts src/lib/features/chat/project-conversation-workspace-browser-detail.test.ts src/lib/features/chat/project-conversation-workspace-browser-pane.test.ts src/lib/features/chat/project-conversation-workspace-browser-terminal-layout.test.ts
- PATH=$HOME/.local/go1.26.1/bin:$PATH go test ./internal/chat ./internal/httpapi
- PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$HOME/.local/go1.26.1/bin:$PATH OPENASE_PGTEST_SHARED_ROOT=$HOME/.cache/openase/pgtest PLAYWRIGHT_WEB_PORT=4174 PLAYWRIGHT_PORT=4174 .codex/skills/push/scripts/openase_ci_gate.sh

Co-authored-by: Codex <codex@openai.com>
- Added toggle functionality for Git Graph in the project conversation workspace.
- Refactored branch checkout logic to handle existing local branches when switching from remote tracking branches.
- Improved state management for repository references, including loading states and error handling.
- Updated UI components to display branch information and integrate branch picker for better user experience.
- Removed deprecated dialog for branch switching and replaced it with a more streamlined approach.
- Added Git graph visualization in the sidebar for better commit tracking.
- Implemented new functions for staging, unstaging, committing, and discarding files.
- Introduced context menu options for copying commit hashes and creating branches.
- Updated tests to cover new Git functionalities and ensure reliability.
- Improved handling of Git remote operations (fetch, pull, push) with loading states.
- Enhanced line diff computation to support patch diffs and empty line diff checks.
Summary:
- merge the approved ASE-173 workspace git branch with latest `origin/main`
  and restore the project-conversation HTTP handlers after main split them
  into `chat_api_project_conversation.go`
- regenerate the OpenAPI artifacts, tighten the workspace git lint fixes,
  and update the web budget/i18n baselines plus test expectations to match
  the current mainline UI copy and CI rules
- keep `internal/webui/static/.keep` tracked and validate the merged branch
  with backend tests, workspace browser suites, web CI, and an alternate-port
  Playwright run for the local 4173 port collision

Rationale:
- the PR was blocked in `Merging` because it had drifted behind `main` and no
  longer passed the repository's current contract, lint, and frontend gates
- landing the approved feature now requires preserving the branch-switching and
  git-graph behavior while adapting to the newer project-conversation slices,
  i18n checks, and budget rules on main

Tests:
- `PATH=$HOME/.local/go1.26.1/bin:$PATH go test ./internal/chat ./internal/httpapi`
- `PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web check`
- `PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web exec vitest run src/lib/features/chat/project-conversation-workspace-browser-state.test.ts src/lib/features/chat/project-conversation-workspace-browser-git-state.test.ts src/lib/features/chat/project-conversation-workspace-browser-git-checkout.test.ts src/lib/features/chat/project-conversation-workspace-browser-refresh.test.ts src/lib/features/chat/project-conversation-workspace-browser-race.test.ts src/lib/features/chat/project-conversation-workspace-browser-navigation.test.ts src/lib/features/chat/project-conversation-workspace-browser-detail.test.ts src/lib/features/chat/project-conversation-workspace-browser-pane.test.ts src/lib/features/chat/project-conversation-workspace-browser-terminal-layout.test.ts`
- `PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH pnpm --dir web run ci` (through build; default Playwright port `4173` was occupied locally)
- `PATH=$HOME/.nvm/versions/node/v22.22.1/bin:$PATH PLAYWRIGHT_WEB_PORT=4174 PLAYWRIGHT_PORT=4174 PLAYWRIGHT_BASE_URL=http://127.0.0.1:4174 pnpm --dir web exec playwright test --reporter=dot --quiet`
- `PATH=$HOME/.local/go1.26.1/bin:$PATH OPENASE_PGTEST_SHARED_ROOT=$HOME/.cache/openase/pgtest env OPENASE_BACKEND_TEST_GROUP_SIZE=8 make check`
- `PATH=$HOME/.local/go1.26.1/bin:$PATH make build`
- `PATH=$HOME/.local/go1.26.1/bin:$PATH make LINT_BASE_REV=92207ea483b0c4326096d6651d8e18fa1a92420a lint && make lint-depguard && make lint-architecture`

Co-authored-by: Codex <codex@openai.com>
Summary:
- clear inherited agent and human-session env vars in API HTTP tests
- record the new workspace git endpoints as intentional CLI/OpenAPI gaps

Rationale:
- the ticket runtime leaks OPENASE_* env vars into go test, which made the
  human-session tests skip cookie auth and fail in CI
- the ASE-173 workspace git API ships backend/frontend support without a
  first-class root CLI surface yet, so the parity allowlist must acknowledge
  those endpoints

Tests:
- PATH=$HOME/.local/go1.26.1/bin:$PATH go test ./internal/cli -run 'Test(APICommandContextUsesStoredHumanSessionForMutations|APICommandContextUsesStoredHumanSessionForReadsWithoutCSRF|APICommandContextPrefersBearerTokenOverStoredHumanSession|RootCLIAPICoverageMatchesOpenAPI)$' -count=1
- ./scripts/ci/with_clean_openase_test_env.sh env OPENASE_PGTEST_SHARED_ROOT=$HOME/.cache/openase/pgtest PATH=$HOME/.local/go1.26.1/bin:$PATH go test -count=1 -timeout=20m ./internal/provider ./internal/infra/userservice ./internal/cli

Co-authored-by: Codex <codex@openai.com>
@BetterAndBetterII
BetterAndBetterII merged commit e352a10 into main Apr 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant