2.9 KiB
APP-3919: Commit Dialog
Parent spec: specs/APP-3918/PRODUCT.md
Branch: edward/commit-dialog
Summary
Add a commit dialog overlay to the code review panel that lets users compose and execute a git commit directly from the code review header, without switching to the terminal.
Problem
The git operations button (from the parent branch) dispatches OpenCommitDialog but has no dialog to open. Users must switch to the terminal to run git commit. This breaks the inline workflow the button is designed to enable.
User Experience
Opening the dialog
The commit dialog opens when the user:
- Clicks the "Commit" primary button in the code review header
- Selects "Commit" from the chevron dropdown menu
The dialog renders as a centered modal overlay with a blurred background, consistent with the existing discard confirmation dialog.
Dialog layout
The dialog ("Commit your changes") contains four sections:
-
Branch — displays the current branch name with a git-branch icon. Read-only.
-
Changes — shows a summary of changed files with aggregate stats (file count, +additions, -deletions).
- A collapsible file list shows per-file stats (filename, directory, +/-, -)
- "Include unstaged" toggle (on by default) controls whether unstaged + untracked changes are included or only staged changes
- Toggling the switch reloads the file list from git
-
Commit message — a multi-line text editor with placeholder text "Leave blank to autogenerate a commit message".
- Supports soft-wrap and autogrow
- ESC dismisses the dialog
- Editor is focused on open
-
Intent selector — currently only "Commit" button. Future: "Commit and push", "Commit and create PR".
Footer
- Cancel button (left)
- Confirm "Commit" button (right) — disabled when no files or no commit message
After committing
On success:
- Dialog closes
- A toast notification shows "Changes successfully committed."
- Diffs are reloaded to reflect the new state
- Diff metadata and PR info are refreshed
On failure:
- Dialog closes
- A toast shows the error message
- Diffs are reloaded (state may have partially changed)
Closing the dialog
The dialog can be closed by:
- Clicking Cancel
- Clicking the X button
- Pressing ESC in the message editor
Non-goals
- Staging individual files/hunks from the dialog (the "Include unstaged" toggle is all-or-nothing)
- Commit amend
- Compound actions (commit+push, commit+create PR) — stubs exist but are wired in child branches
Success Criteria
- Clicking "Commit" in the header opens the dialog overlay
- The dialog shows the current branch, file changes with stats, and a message editor
- Toggling "Include unstaged" refreshes the file list (staged-only vs all changes)
- Confirming runs
git commitwith the entered message - Success/failure toasts appear after the commit
- The code review panel refreshes to reflect post-commit state
- ESC and Cancel close the dialog without committing