- 
                Notifications
    You must be signed in to change notification settings 
- Fork 110
          Pane.capture_pane helpers
          #568
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| Reviewer's Guide by SourceryThis pull request introduces snapshot and recording functionality for tmux panes. It adds  Sequence diagram for creating a PaneSnapshotsequenceDiagram
    participant User
    participant Pane
    participant PaneSnapshot
    User->>Pane: snapshot(start, end)
    Pane->>PaneSnapshot: from_pane(self, start, end)
    activate PaneSnapshot
    PaneSnapshot-->>Pane: PaneSnapshot instance
    deactivate PaneSnapshot
    Pane-->>User: PaneSnapshot instance
Sequence diagram for creating a PaneRecording and adding a snapshotsequenceDiagram
    participant User
    participant Pane
    participant PaneRecording
    participant PaneSnapshot
    User->>Pane: record()
    Pane->>PaneRecording: PaneRecording()
    activate PaneRecording
    PaneRecording-->>Pane: PaneRecording instance
    deactivate PaneRecording
    User->>PaneRecording: add_snapshot(pane, start, end)
    PaneRecording->>Pane: snapshot(start, end)
    Pane->>PaneSnapshot: from_pane(self, start, end)
    activate PaneSnapshot
    PaneSnapshot-->>Pane: PaneSnapshot instance
    deactivate PaneSnapshot
    Pane->>PaneRecording: append(PaneSnapshot)
    PaneRecording-->>User: void
Updated class diagram for Pane, PaneSnapshot, and PaneRecordingclassDiagram
    class Pane {
        +capture_pane()
        +snapshot()
        +record()
    }
    class PaneSnapshot {
        +content: list[str]
        +timestamp: datetime
        +pane_id: str
        +window_id: str
        +session_id: str
        +server_name: str
        +metadata: dict[str, str]
        +from_pane()
        +content_str
    }
    class PaneRecording {
        +snapshots: list[PaneSnapshot]
        +add_snapshot()
        +latest
        +get_snapshots_between()
    }
    Pane -- PaneSnapshot : creates
    Pane -- PaneRecording : creates
    PaneRecording -- PaneSnapshot : contains
File-Level Changes
 Tips and commandsInteracting with Sourcery
 Customizing Your ExperienceAccess your dashboard to: 
 Getting Help
 | 
| Codecov ReportAttention: Patch coverage is  
 
 Additional details and impacted files@@                 Coverage Diff                  @@
##           context-managers     #568      +/-   ##
====================================================
+ Coverage             88.84%   89.27%   +0.42%     
====================================================
  Files                    36       38       +2     
  Lines                  4080     4288     +208     
  Branches                376      378       +2     
====================================================
+ Hits                   3625     3828     +203     
- Misses                  310      313       +3     
- Partials                145      147       +2     ☔ View full report in Codecov by Sentry. | 
c58334b    to
    fc1d7f4      
    Compare
  
    fc1d7f4    to
    c61ba63      
    Compare
  
    c305c76    to
    6d91728      
    Compare
  
    6d91728    to
    3cc1d33      
    Compare
  
    3cc1d33    to
    42e0ac8      
    Compare
  
    0188aed    to
    ea5b0c4      
    Compare
  
    
Changes
feat: Add
test_snapshotTest plan
Coverage
Automatic
Summary by Sourcery
Introduce snapshot and recording functionality for tmux panes. This allows capturing and analyzing pane content and metadata at various points in time. Add tests to verify the correctness of the new features.
New Features:
Pane.snapshot()to create a snapshot of the pane's current state.Pane.record()to create a recording of pane snapshots.PaneSnapshotclass to store pane content and metadata.PaneRecordingclass to manage a time-series of pane snapshots.test_snapshotto test the snapshot functionality and ensure correctness of capturing pane content and metadata.test_pane_recordingto test the recording functionality, including adding snapshots, iterating through them, and filtering by time.Tests: