Documentation
¶
Overview ¶
Package ui implements the Bubble Tea TUI for scry.
Index ¶
- type CommitEditedMsg
- type CommitExecutedMsg
- type CommitExecutor
- type CommitGeneratedMsg
- type CommitProvider
- type CompareReResolver
- type DrillDownLoadedMsg
- type DrillDownProvider
- type DrillDownResult
- type MetadataLoadedMsg
- type MetadataLoader
- type Model
- type ModelOption
- func WithCommitExecutor(ce CommitExecutor) ModelOption
- func WithCommitProvider(cp CommitProvider) ModelOption
- func WithCompareResolver(cr CompareReResolver, req model.CompareRequest) ModelOption
- func WithDrillDownProvider(dp DrillDownProvider) ModelOption
- func WithMetadataLoader(ml MetadataLoader) ModelOption
- func WithPatchLoader(pl PatchLoader) ModelOption
- func WithWatch(fp WatchFingerprinter, baseRef string) ModelOption
- func WithWorktreeLoader(wl WorktreeLoader) ModelOption
- type PatchLoadedMsg
- type PatchLoader
- type WatchFingerprinter
- type WorktreeLoader
- type WorktreeRefreshedMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitEditedMsg ¶ added in v0.2.0
CommitEditedMsg is sent when the user finishes editing a commit message in $EDITOR.
type CommitExecutedMsg ¶ added in v0.2.0
CommitExecutedMsg is sent when an async git commit completes.
type CommitExecutor ¶ added in v0.2.0
CommitExecutor runs git commit with a message and returns the short SHA.
type CommitGeneratedMsg ¶ added in v0.2.0
type CommitGeneratedMsg struct {
Message string
Err error
Generation int // matches CommitState.Generation to detect stale results
}
CommitGeneratedMsg is sent when an async commit message generation completes.
type CommitProvider ¶ added in v0.2.0
CommitProvider generates commit messages. The implementation is responsible for collecting any diff/file data it needs (e.g. from the git index).
type CompareReResolver ¶ added in v0.2.0
type CompareReResolver interface {
Resolve(ctx context.Context, req model.CompareRequest) (model.ResolvedCompare, error)
}
CompareReResolver re-resolves the compare specification against current refs.
type DrillDownLoadedMsg ¶ added in v0.2.0
type DrillDownLoadedMsg struct {
Result DrillDownResult
Err error
Generation int // matches DashboardState.DrillGeneration to detect stale results
}
DrillDownLoadedMsg is sent when a worktree drill-down finishes loading.
type DrillDownProvider ¶ added in v0.2.0
type DrillDownProvider interface {
LoadDrillDown(ctx context.Context, worktreePath string) (DrillDownResult, error)
}
DrillDownProvider creates the diff context for a specific worktree.
type DrillDownResult ¶ added in v0.2.0
type DrillDownResult struct {
Compare model.ResolvedCompare
Files []model.FileSummary
PatchLoader PatchLoader
}
DrillDownResult holds the resolved data for a worktree drill-down.
type MetadataLoadedMsg ¶
type MetadataLoadedMsg struct {
Compare *model.ResolvedCompare // non-nil when compare was re-resolved
Files []model.FileSummary
Gen int
Err error
}
MetadataLoadedMsg is sent when an async metadata reload completes.
type MetadataLoader ¶
type MetadataLoader interface {
ListFiles(ctx context.Context, cmp model.ResolvedCompare) ([]model.FileSummary, error)
}
MetadataLoader lists changed files for a compare range.
type Model ¶
Model is the top-level Bubble Tea model for scry.
func NewModel ¶
func NewModel(state model.AppState, opts ...ModelOption) Model
NewModel creates a Model from bootstrap data. Sets SelectedFile to -1 when the file list is empty, 0 otherwise.
type ModelOption ¶
type ModelOption func(*Model)
ModelOption configures optional Model dependencies.
func WithCommitExecutor ¶ added in v0.2.0
func WithCommitExecutor(ce CommitExecutor) ModelOption
WithCommitExecutor sets the CommitExecutor used to run git commit.
func WithCommitProvider ¶ added in v0.2.0
func WithCommitProvider(cp CommitProvider) ModelOption
WithCommitProvider sets the CommitProvider used for AI commit message generation.
func WithCompareResolver ¶ added in v0.2.0
func WithCompareResolver(cr CompareReResolver, req model.CompareRequest) ModelOption
WithCompareResolver sets the resolver used to re-resolve compare refs on refresh.
func WithDrillDownProvider ¶ added in v0.2.0
func WithDrillDownProvider(dp DrillDownProvider) ModelOption
WithDrillDownProvider sets the provider for loading worktree diffs on drill-down.
func WithMetadataLoader ¶
func WithMetadataLoader(ml MetadataLoader) ModelOption
WithMetadataLoader sets the MetadataLoader used to reload file lists on refresh.
func WithPatchLoader ¶
func WithPatchLoader(pl PatchLoader) ModelOption
WithPatchLoader sets the PatchLoader used to load file diffs on Enter.
func WithWatch ¶ added in v0.2.0
func WithWatch(fp WatchFingerprinter, baseRef string) ModelOption
WithWatch sets the WatchFingerprinter and symbolic base ref for watch mode.
func WithWorktreeLoader ¶ added in v0.2.0
func WithWorktreeLoader(wl WorktreeLoader) ModelOption
WithWorktreeLoader sets the WorktreeLoader used for dashboard auto-refresh.
type PatchLoadedMsg ¶
PatchLoadedMsg is sent when an async patch load completes.
type PatchLoader ¶
type PatchLoader interface {
LoadPatch(ctx context.Context, cmp model.ResolvedCompare, filePath string, ignoreWhitespace bool) (model.FilePatch, error)
}
PatchLoader loads a file's unified diff.
type WatchFingerprinter ¶ added in v0.2.0
type WatchFingerprinter interface {
Fingerprint(ctx context.Context, baseRef string, workingTree bool) (string, error)
}
WatchFingerprinter computes a repo state fingerprint for watch mode.
type WorktreeLoader ¶ added in v0.2.0
type WorktreeLoader interface {
LoadWorktrees(ctx context.Context) ([]model.WorktreeInfo, error)
}
WorktreeLoader loads the worktree list with dirty state and commit info.
type WorktreeRefreshedMsg ¶ added in v0.2.0
type WorktreeRefreshedMsg struct {
Worktrees []model.WorktreeInfo
Err error
}
WorktreeRefreshedMsg is sent when an async worktree list reload completes.