Skip to content

Conversation

@Kvadratni
Copy link
Collaborator

@Kvadratni Kvadratni commented Jan 11, 2026

Summary

Adds a new "Pull Requests" tab to Staged that displays open PRs for the current repository with automatic refresh and one-click checkout capabilities.

Key Features:

  • Tab-based UI: New tab switcher in TopBar for seamless navigation between Diff View and Pull Requests
  • Auto-refresh: Automatically fetches updated PR list every 2 minutes (configurable from 1-10 minutes)
  • Configurable settings: Refresh interval, PR fetch limit (10-100), and auto-refresh toggle
  • View without checkout: "View Diff" button previews PR changes without affecting working tree
  • Safe checkout: "Checkout" button creates tracking branch (e.g., pr-123) with uncommitted changes protection
  • GitHub CLI integration: Shows setup instructions when not authenticated
  • Comprehensive UI states: Loading, error, empty, and auth required states

Backend Changes:

  • Added has_uncommitted_changes() to check for dirty working tree before checkout
  • Added checkout_pr_branch() to safely create/update PR tracking branches
  • New Tauri commands expose these git operations to frontend

Frontend Changes:

  • New stores:
    • viewState.svelte.ts: Tab management state
    • prSettings.svelte.ts: User preferences with localStorage persistence
    • prState.svelte.ts: PR data, loading states, and polling mechanism
  • New components:
    • PRListView.svelte: Main PR list container with refresh/settings controls
    • PRListItem.svelte: Individual PR display with action buttons
    • PRSettingsModal.svelte: Settings UI for refresh interval and PR limit
    • ErrorModal.svelte: Error display for checkout failures
  • Modified TopBar.svelte: Added tab switcher UI with active state styling
  • Modified App.svelte: Conditional view rendering and PR event handlers
image image

🤖 Generated with Claude Code

Kvadratni and others added 2 commits January 10, 2026 21:55
Adds a new "Pull Requests" tab that displays open PRs for the current
repository with automatic refresh every 2 minutes (configurable). Users
can view PR diffs without checking out or create local tracking branches
(pr-123) for full review workflows.

Features:
- Tab switcher in TopBar for seamless navigation between Diff and PR views
- Auto-refresh with configurable interval (1-10 minutes) and PR limit
- One-click "View Diff" to preview PR changes without affecting working tree
- One-click "Checkout" to create local branch with uncommitted changes safety check
- Settings modal for refresh interval, PR limit, and auto-refresh toggle
- Comprehensive error handling and empty/loading states
- GitHub CLI authentication flow with setup instructions

Backend changes:
- Added has_uncommitted_changes() to prevent dirty checkout attempts
- Added checkout_pr_branch() for safe PR branch creation
- New Tauri commands expose git operations to frontend

Frontend changes:
- New stores: viewState (tab management), prSettings (localStorage config), prState (PR data/polling)
- New components: PRListView, PRListItem, PRSettingsModal, ErrorModal
- Modified TopBar with tab switcher UI
- Modified App.svelte with conditional view rendering and checkout handlers

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Resolves conflicts from the major Git operations refactoring that moved
from libgit2 to CLI-based git commands. Updates PR list feature to use
the new architecture.

Key changes:
- Migrated has_uncommitted_changes() and checkout_pr_branch() from libgit2 to CLI
- Created new git/checkout.rs module using git CLI commands
- Updated frontend to use new API signatures (listRefs, DiffSpec, etc.)
- Fixed App.svelte to use new watcher system (initWatcher/watchRepo)
- Updated prState to use invalidatePRCache() for force refresh
- Removed PullRequest.additions/deletions fields (no longer in API)
- Fixed component props for refactored Sidebar/DiffViewer/TopBar

All TypeScript checks pass.

Co-Authored-By: Claude Sonnet 4.5 <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.

2 participants