Skip to content

Add toast notifications for better user feedback during git operations #209

@jellydn

Description

@jellydn

What

Add toast notification system to provide real-time feedback during git operations (branch creation, syncing, checkout) to improve user experience and eliminate confusion during silent operations.

Why

Current Pain Points:

  • Users experience silent periods during git operations (fetch, sync, checkout) with no indication of progress
  • Sync operations feel like the app is frozen or unresponsive
  • No clear feedback when operations succeed or fail
  • Users are unclear when git operations are happening vs when waiting for input
  • Branch creation workflow lacks progress indicators for multi-step operations

User Experience Issues:

  • Long git fetch operations appear to hang the interface
  • No confirmation when sync operations complete successfully
  • Error states are not immediately visible to users
  • Missing feedback creates uncertainty about operation status

How

Implementation Strategy:

1. Toast Component Architecture

  • Create ui/overlay/toast.go following existing overlay pattern
  • Implement toast queue system with auto-dismissal timers
  • Support success/error/info/warning states with appropriate styling
  • Use Bubble Tea tea.Cmd for concurrent updates and timer management

2. Integration Points

  • Branch Creation: "Checking remote...", "Creating branch...", "✓ Branch ready!"
  • Sync Operations: "Syncing with remote...", progress indication, "✓ Sync complete"
  • Git Operations: "Fetching updates...", "Switching branch...", error states
  • Validation: "Validating branch name...", "Checking conflicts..."

3. Technical Implementation

type ToastType int
const (
    ToastInfo ToastType = iota
    ToastSuccess  
    ToastWarning
    ToastError
)

type Toast struct {
    Message string
    Type ToastType
    Duration time.Duration
    Dismissible bool
}

4. UX Enhancements

  • Non-intrusive positioning (top-right corner)
  • Smooth fade-in/fade-out animations
  • Stack multiple toasts when operations overlap
  • Auto-dismiss with configurable timers
  • Manual dismiss option for important messages

5. Accessibility

  • Screen reader compatible announcements
  • High contrast color schemes
  • Keyboard navigation support
  • Respect reduced motion preferences

Proposed Workflow Enhancement:

Current: [User input] → [Silent operations] → [Success/Error]
Enhanced: [User input] → [Toast: Operation progress] → [Toast: Completion status]

Priority Integration Points:

  1. Branch sync operations (highest impact)
  2. Remote branch checking
  3. Branch creation workflow
  4. Git fetch operations
  5. Error state communication

This enhancement will significantly improve perceived performance and user confidence during git operations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions