Skip to content

Mavnezz feature/git webui integration#249

Merged
Timmoth merged 5 commits intostagingfrom
mavnezz-feature/git-webui-integration
Mar 7, 2026
Merged

Mavnezz feature/git webui integration#249
Timmoth merged 5 commits intostagingfrom
mavnezz-feature/git-webui-integration

Conversation

@Timmoth
Copy link
Owner

@Timmoth Timmoth commented Mar 7, 2026

No description provided.

mavnezz and others added 4 commits March 7, 2026 18:49
Add a minimal git integration to the web UI that shows the current
branch name, change status, and provides save/diff/discard/history
controls directly in the header.

- GitService wrapping git CLI for status, commit, diff, restore, log
- NullGitService for WASM Viewer where git is not available
- GitStatusIndicator component with auto-polling every 5s
- Branch name clickable to open commit history modal
- Save button with dropdown for diff view and discard
- Color-coded diff output and changed file listing
- Gracefully hidden when git is not installed or not a repo

Ref #131
- Add push/pull support with automatic upstream tracking on first push
- Add separate Sync button for manual remote fetch (no auto-polling)
- Add diff viewer modal with color-coded output
- Add discard changes with confirmation prompt
- Add commit history modal via branch name click
- Split save dropdown (diff/discard) from sync dropdown (push/pull)
Replace CLI-based git implementation with LibGit2Sharp native library,
restructure the git module following hexagonal architecture, DDD, CQS
and SRP principles.

Architecture:
- Port: IGitRepository interface for low-level repository access
- Adapter: LibGit2GitRepository (libgit2sharp) and NullGitRepository (WASM)
- UseCases (commands): InitRepo, CommitAll, RestoreAll, Push, Pull, AddRemote
- Queries (reads): GetStatus, GetBranch, GetDiff, GetChangedFiles, GetLog, GetSyncStatus

Features:
- Git init via web UI with confirmation dialog
- Add HTTPS remote via web UI with URL validation (SSH not supported)
- Manual sync button with fetch, push and pull controls
- Sync status display (ahead/behind) with fetch error reporting
- Token-based auth via GIT_TOKEN environment variable for Docker/CI
- 5-second local status polling (no remote fetch in polling loop)

Removed:
- CLI-based GitService, IGitService and NullGitService
@Timmoth Timmoth marked this pull request as ready for review March 7, 2026 19:42
@Timmoth Timmoth merged commit df9c410 into staging Mar 7, 2026
1 check passed
@Timmoth Timmoth deleted the mavnezz-feature/git-webui-integration branch March 7, 2026 19:43
@Timmoth
Copy link
Owner Author

Timmoth commented Mar 7, 2026

Many thanks @mavnezz!! Please give it a test on the nightly docker build if you have the time

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