Documentation
¶
Overview ¶
Package diffview implements the file-list + unified-diff screen.
Index ¶
- func LoadCmd(requestID uint64, req app.LoadRequest, prog *progress.Tracker) tea.Cmd
- type Model
- func (m *Model) CancelActivity()
- func (m *Model) Close() tea.Cmd
- func (m Model) Connection() remote.Client
- func (m *Model) ConnectionLost(conn remote.Client, err error) bool
- func (m Model) Init() tea.Cmd
- func (m Model) LoadingActivity() (string, *progress.Tracker, bool)
- func (m *Model) SetScope(scope syncpolicy.ScopeSummary, options syncpolicy.ScopeOptions)
- func (m *Model) SetSize(w, h int)
- func (m *Model) SetSyncResult(status string, failures []syncpolicy.Failure)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- type MsgBackToBrowser
- type MsgBulkSyncDone
- type MsgDiffError
- type MsgDiffLoaded
- type MsgScopeReloadRequested
- type MsgSyncError
- type MsgSyncProgress
- type MsgSynced
- type SyncDir
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Model ¶
Model is the diff view screen.
func New ¶
func New(sessions []diff.Session, host config.Host, conn remote.Client, root *fs.Root, width, height int) Model
New creates a Model with pre-loaded sessions. syncDirs are pre-filled by autoDir so the user starts with a sensible selection.
func (*Model) CancelActivity ¶
func (m *Model) CancelActivity()
CancelActivity asks an in-flight sync, refresh, or upload to stop. Work already written is kept; remaining files are left alone.
func (*Model) Close ¶
Close detaches ownership and cancels pending work immediately. Network close may wait for an active operation, so resource cleanup belongs in the command.
func (Model) Connection ¶
Connection returns the owned connection, even after failure, until Close detaches it.
func (*Model) ConnectionLost ¶
ConnectionLost applies only to the current connection. Commands retain their captured handles and report their outcomes; no new work is allowed afterwards.
func (Model) LoadingActivity ¶
LoadingActivity exposes the current network activity to the root indicator.
func (*Model) SetScope ¶
func (m *Model) SetScope(scope syncpolicy.ScopeSummary, options syncpolicy.ScopeOptions)
SetScope attaches the immutable scope summary used to build these sessions.
func (*Model) SetSyncResult ¶
func (m *Model) SetSyncResult(status string, failures []syncpolicy.Failure)
SetSyncResult restores the result of a transfer across a full scope reload.
type MsgBackToBrowser ¶
type MsgBackToBrowser struct{}
MsgBackToBrowser is sent when the user quits the diff view.
type MsgBulkSyncDone ¶
type MsgBulkSyncDone struct {
Conn remote.Client
Done int // number of successfully synced files
Completed []int // session indices with confirmed successful operations
Errors []syncpolicy.Failure // one entry per failed file
Err error // terminal connection failure; remaining jobs were not started
}
MsgBulkSyncDone is sent when bulk sync has finished.
type MsgDiffError ¶
MsgDiffError is sent when SSH/SFTP connection or diff loading fails. RequestID and Host identify the failed request, see MsgDiffLoaded.
type MsgDiffLoaded ¶
type MsgDiffLoaded struct {
RequestID uint64
Host config.Host
Sessions []diff.Session
Conn remote.Client
Root *fs.Root // project root for local reads and writes; caller must close it
Scope syncpolicy.ScopeSummary
Options syncpolicy.ScopeOptions
}
MsgDiffLoaded is sent when all sessions have been computed. Conn is kept open for subsequent sync operations — caller must close it. RequestID and Host identify the LoadCmd call this result belongs to: results can arrive after the app has moved on (another project was opened), and the caller must be able to tell those apart from the result it is waiting for.
type MsgScopeReloadRequested ¶
type MsgScopeReloadRequested struct {
IncludeIgnored bool
Status string
Errors []syncpolicy.Failure
DeletedLocal []string
DeletedRemote []string
}
MsgScopeReloadRequested asks the root model to rebuild the comparison with different recursive ignore handling.
type MsgSyncError ¶
MsgSyncError is sent when a sync operation fails.
type MsgSyncProgress ¶
MsgSyncProgress is emitted periodically while a bulk sync is running.