tui

package
v0.0.0-...-c5aa536 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitBrowseModel

func InitBrowseModel(orgDir, obsidianDir string, st *state.State, resolveFunc func(string, string, string) error, refreshFunc func()) browseModel

InitBrowseModel creates a new file browser model

func InitDaemonModel

func InitDaemonModel() daemonModel

InitDaemonModel creates a new daemon status model

func InitStatusModel

func InitStatusModel(orgDir, obsidianDir string, resolveFunc func(string, string, string) error, refreshFunc func()) statusModel

InitStatusModel creates a new status display model

func InitSyncModel

func InitSyncModel() syncModel

InitSyncModel creates a new sync progress model

Types

type BrowseData

type BrowseData struct {
	Files []FileInfo
}

BrowseData holds all tracked files and their status

type BrowseMsg

type BrowseMsg struct {
	Data *BrowseData
	Err  error
}

BrowseMsg is sent when browse data is ready

type DaemonData

type DaemonData struct {
	Running      bool
	PID          int
	StartTime    time.Time
	LastSyncTime time.Time
	FilesSynced  int
	LogLines     []string
}

DaemonData holds daemon status information

type DaemonMsg

type DaemonMsg struct {
	Data *DaemonData
	Err  error
}

DaemonMsg is sent when daemon data is ready

type DiffMsg

type DiffMsg struct {
	Content string
	Format  diff.Format
	Err     error
}

DiffMsg is sent when diff preview is ready

type FileInfo

type FileInfo struct {
	BaseName   string
	OrgPath    string
	MdPath     string
	Status     string // "synced", "pending-org", "pending-md", "conflict"
	StatusIcon string // "✓", "→", "←", "⚠"
	HasOrgFile bool
	HasMdFile  bool
}

FileInfo represents a tracked file pair with its status

type RefreshBrowseMsg

type RefreshBrowseMsg struct{}

RefreshBrowseMsg triggers a browse data refresh

type RefreshStatusMsg

type RefreshStatusMsg struct{}

RefreshStatusMsg triggers a status refresh

type ResolutionAction

type ResolutionAction string

ResolutionAction represents a conflict resolution choice

const (
	UseOrg        ResolutionAction = "org"
	UseMarkdown   ResolutionAction = "markdown"
	LastWriteWins ResolutionAction = "last-write-wins"
	Skip          ResolutionAction = "skip"
)

type ResolveMsg

type ResolveMsg struct {
	Action  ResolutionAction
	FileRow fileRow
}

ResolveMsg is sent when a file resolution is chosen

type StatusData

type StatusData struct {
	OrgDir       string
	ObsidianDir  string
	Interval     time.Duration
	OrgFileCount int
	MdFileCount  int
	TrackedPairs int
	PendingOrg   []string
	PendingMd    []string
	Conflicts    []string
	IDMapCount   int
	Scanning     bool
}

StatusData holds all the information for the status display

type StatusMsg

type StatusMsg struct {
	Data *StatusData
	Err  error
}

StatusMsg is sent when status data is ready

type SyncMsg

type SyncMsg struct {
	Result *SyncResult
	Err    error
}

SyncMsg is sent when sync completes

type SyncResult

type SyncResult struct {
	FilesProcessed int
	Errors         []error
	Duration       time.Duration
	Success        bool
}

SyncResult holds the result of a sync operation

type TickMsg

type TickMsg time.Time

TickMsg triggers a periodic refresh

type UpdateFilesScannedMsg

type UpdateFilesScannedMsg int

UpdateFilesScanned updates the scanned file count

type UpdateFilesSyncedMsg

type UpdateFilesSyncedMsg int

UpdateFilesSynced updates the synced file count

type UpdateStatusMsg

type UpdateStatusMsg string

UpdateStatus updates the status message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL