Skip to content

Add transaction management UI#51

Open
muk2 wants to merge 2 commits intomainfrom
feature/issue-36-transaction-mgmt
Open

Add transaction management UI#51
muk2 wants to merge 2 commits intomainfrom
feature/issue-36-transaction-mgmt

Conversation

@muk2
Copy link
Owner

@muk2 muk2 commented Feb 20, 2026

Summary

Adds a transaction management interface with keyboard shortcuts and visual indicators for working within explicit transactions.

  • Keyboard shortcuts: Ctrl+T (BEGIN), Ctrl+K (COMMIT), Ctrl+Shift+R (ROLLBACK)
  • Visual indicator: Header bar shows [TXN ACTIVE Xs, N queries] in warning color when inside a transaction
  • Auto-detection: Manually typed BEGIN/COMMIT/ROLLBACK commands automatically update transaction state
  • Safety: Warnings for duplicate BEGIN, commit/rollback without active transaction
  • Toast notifications: Status updates for all transaction events with duration and query count

Keyboard Shortcuts

Key Action
Ctrl+T Begin transaction
Ctrl+K Commit transaction
Ctrl+Shift+R Rollback transaction

Files Changed

File Description
src/ui/app.rs TransactionState enum, shortcuts, BEGIN/COMMIT/ROLLBACK methods, auto-detection
src/ui/components.rs Header transaction indicator, warning styling, help text

Test plan

  • cargo build passes
  • cargo test — all 225 tests pass
  • Ctrl+T starts transaction with toast notification
  • Header shows [TXN ACTIVE] indicator in warning color
  • Ctrl+K commits with duration/query count summary
  • Ctrl+Shift+R rolls back transaction
  • Manual BEGIN/COMMIT/ROLLBACK updates transaction state

Closes #36

🤖 Generated with Claude Code

muk2 and others added 2 commits February 20, 2026 14:59
Adds transaction controls with visual feedback for managing
BEGIN/COMMIT/ROLLBACK within the SQL editor.

- Ctrl+T to begin a transaction
- Ctrl+K to commit a transaction
- Ctrl+Shift+R to rollback a transaction
- Visual [TXN ACTIVE] indicator in header bar with duration and query count
- Header turns warning color when transaction is active
- Automatic detection of manually typed BEGIN/COMMIT/ROLLBACK
- Toast notifications for all transaction events
- Transaction query counting

Closes #36

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Combine identical COMMIT/ROLLBACK if-else blocks (clippy::if_same_then_else)
- Run cargo fmt for consistent formatting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Feature: Transaction management UI

1 participant