Skip to content

Add per-file git metadata, diff view and comment-to-agent support in file editor#319

Closed
tbrandenburg wants to merge 2 commits intomainfrom
codex/add-git-information-and-diff-view-panels
Closed

Add per-file git metadata, diff view and comment-to-agent support in file editor#319
tbrandenburg wants to merge 2 commits intomainfrom
codex/add-git-information-and-diff-view-panels

Conversation

@tbrandenburg
Copy link
Copy Markdown
Owner

Motivation

  • Provide richer per-file Git insights in the editor so users can see tracked/untracked and ignored status, last commit info, line diff stats and a readable before/after diff view.
  • Allow fast feedback loops by letting users inject comments from the editor (Preview/Diff) directly into the agent chat as Regarding \\[file-path]\: [comment] and refresh git info after saves.

Description

  • Backend: added helpers _is_tracked_file, _is_ignored_file, _parse_diff_blocks, and a new get_repository_file_git_details(repo_name, file_path) that returns tracked/ignored flags, lineStats, last commit metadata, last modified, line count and parsed diff blocks; handles untracked files by synthesizing an all-added block. (file: packages/pybackend/repository_service.py)
  • Backend: exposed a new endpoint GET /api/repositories/{name}/git/file?path=... that returns the per-file git details. (file: packages/pybackend/app.py)
  • Frontend API: added RepositoryFileGitDetails type and api.getRepositoryFileGitDetails(name, filePath) client method. (file: packages/frontend/src/hooks/useApi.ts)
  • Frontend UI: updated RepositoryPage to show a top “Git File Info” panel and a conditional “Diff View” (before/after) when a file is opened and git is available, added Comment buttons on Preview and Diff panels that open a modal and inject Regarding \\[relative-file-path]\: [user-comment] into the agent chat, and refreshed file/git metadata after saving. (file: packages/frontend/src/pages/RepositoryPage.tsx)
  • Styling: added CSS for the diff grid/columns to packages/frontend/src/styles/index.css.
  • Tests: added unit tests for get_repository_file_git_details covering tracked and untracked file behavior. (file: packages/pybackend/tests/unit/test_repository_service.py)

Testing

  • Ran backend unit tests with python -m pytest packages/pybackend/tests/unit/test_repository_service.py and related focused runs; backend tests passed (17 passed initially; selected file-git-detail tests passed later).
  • Ran frontend unit test file src/components/GitTab.test.tsx with npm run -w packages/frontend test -- src/components/GitTab.test.tsx and it passed (1 file, 2 tests passed).
  • Built the frontend with npm run -w packages/frontend build and the build succeeded.
  • One attempted frontend test run using an invalid Vitest flag (--runInBand) failed due to the unknown option; this was a CLI invocation issue and not a code test failure.

Codex Task

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
made Ready Ready Preview, Comment Mar 28, 2026 8:23am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant