Skip to content

feat: finish commit composer actions - #135

Open
ruru-m07 wants to merge 1 commit into
devfrom
ruru/ruru-56-finish-commit-composer-controls-and-remove-inert-actions
Open

ruru-m07 wants to merge 1 commit into
devfrom
ruru/ruru-56-finish-commit-composer-controls-and-remove-inert-actions

Conversation

@ruru-m07

@ruru-m07 ruru-m07 commented Sep 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • wire up empty commits, amend-last-commit, and searchable co-author selection
  • preserve repository-scoped drafts and trailers across amend/rebase flows while guarding stale HEADs, repository switches, conflicts, and concurrent Git mutations
  • replace inert or invalid actions with state-aware controls and add frontend/Rust regression coverage

Testing

  • make verify
  • frontend tests (107 passed)
  • focused commit integration tests (26/26 passed)
  • focused rebase tests (12/12 passed)
  • typechecks, production build, Clippy, Rust formatting, and diff checks

Closes RURU-56.

Summary by CodeRabbit

  • New Features

    • Added amend-commit mode with safeguards against changing an unexpected commit.
    • Added empty-commit creation with confirmation.
    • Added co-author selection, deduplication, and preservation in commit messages.
    • Added commit-author suggestions based on repository history and configuration.
  • Bug Fixes

    • Improved rebase commit-message and conflict-resolution reliability.
    • Prevented stale drafts from overwriting newer repository or rebase changes.
    • Improved detection of unresolved conflicts in certain repository states.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0ac5eaff-4d81-496b-b23d-63c515f7c322

📥 Commits

Reviewing files that changed from the base of the PR and between a0da433 and c53f559.

📒 Files selected for processing (23)
  • apps/desktop/src-tauri/src/commands/commit.rs
  • apps/desktop/src-tauri/src/commands/rebase.rs
  • apps/desktop/src-tauri/src/lib.rs
  • apps/desktop/src/features/git/components/write-commit-box.tsx
  • apps/desktop/src/features/git/rebase/rebase-actions-bar.tsx
  • apps/desktop/src/hooks/use-rebase.ts
  • apps/desktop/src/hooks/use-repository.ts
  • apps/desktop/src/state/domains/repository-state.ts
  • apps/desktop/src/store/use-commit-draft-store.ts
  • apps/desktop/tests/rebase-draft-transitions.test.tsx
  • apps/desktop/tests/write-commit-box.test.tsx
  • crates/git/parsers/commit.rs
  • crates/git/runner.rs
  • crates/git/service/commit.rs
  • crates/git/service/graph.rs
  • crates/git/service/operation.rs
  • crates/git/service/rebase.rs
  • crates/git/service/rebase_tests.rs
  • crates/git/tests/commit_service.rs
  • packages/commands/src/.typecache
  • packages/commands/src/commands.ts
  • packages/commands/src/index.ts
  • packages/commands/src/types.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds create, empty, and amend commit actions with co-author support. It adds commit-author lookup and commit validation. Git command transactions now coordinate commit and rebase operations. Rebase draft handling preserves newer drafts during asynchronous operations.

Changes

Commit and rebase workflows

Layer / File(s) Summary
Commit contracts and author lookup
apps/desktop/src-tauri/..., packages/commands/src/..., apps/desktop/src/hooks/..., apps/desktop/src/state/...
Commit commands accept amend parameters. A commit_authors command, binding, cache method, and query hook are added. Generated command schemas are regenerated.
Draft state and commit actions
apps/desktop/src/store/use-commit-draft-store.ts, apps/desktop/src/features/git/components/write-commit-box.tsx
The draft stores co-authors and amend snapshots. The commit box supports create, empty, and amend actions, trailer editing, availability checks, confirmation, and amend cancellation.
Commit validation and amend execution
crates/git/service/commit.rs, crates/git/parsers/commit.rs, crates/git/service/graph.rs, crates/git/service/operation.rs, crates/git/tests/commit_service.rs
The service validates commit requests and repository operations, checks expected HEAD values, executes amend and empty commits, discovers authors, and preserves Git trailers. Parser logic is shared and accepts case-insensitive co-author labels.
Repository transactions for rebase operations
crates/git/runner.rs, crates/git/service/rebase.rs, apps/desktop/src-tauri/src/commands/rebase.rs, crates/git/service/rebase_tests.rs
Git command transactions hold the repository lock across command sequences. Rebase mutations use the transaction, and asynchronous rebase service calls are awaited.
Rebase draft preservation and validation
apps/desktop/src/features/git/rebase/rebase-actions-bar.tsx, apps/desktop/src/hooks/use-rebase.ts, apps/desktop/tests/*
Rebase actions clear drafts only when their repository and autofill identities are unchanged. Rebase start refreshes commit data. Tests cover action availability, amend flows, co-authors, and asynchronous draft transitions.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant WriteCommitBox
  participant useCreateCommit
  participant CommitService
  participant GitCommandTransaction
  participant GitRepository
  WriteCommitBox->>useCreateCommit: submit commit action
  useCreateCommit->>CommitService: create_commit metadata and amend parameters
  CommitService->>GitCommandTransaction: acquire repository transaction
  CommitService->>GitRepository: validate operation and expected HEAD
  CommitService->>GitCommandTransaction: run commit command
  GitCommandTransaction-->>CommitService: return commit result
  CommitService-->>useCreateCommit: return new HEAD
  useCreateCommit-->>WriteCommitBox: invalidate repository state
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 174 functions across 22 files. (1 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: completing commit composer actions for empty commits, amend commits, and related controls.
Description check ✅ Passed The description explains what changed, why it changed, how it was tested, and links the related issue. It is complete enough for review, although it uses a Linear “Closes” link instead of the template…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 29.89% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 174 functions across 22 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit trims trailers neat
And stores each co-author’s seat
Amend guards the moving head
Rebase drafts stay where they’re led
Locked commands hop in time
Commits land with messages prime

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying gitru with  Cloudflare Pages  Cloudflare Pages

Latest commit: c53f559
Status: ✅  Deploy successful!
Preview URL: https://ff7b9d13.gitru.pages.dev
Branch Preview URL: https://ruru-ruru-56-finish-commit-c.gitru.pages.dev

View logs

This branch has not been deployed

No deployments
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