Documentation
¶
Overview ¶
Package tuistate provides persistent TUI state storage (tabs, recent/favorite directories).
Index ¶
- type Store
- func (s *Store) AddFavoriteDir(ctx context.Context, path string) error
- func (s *Store) AddTab(ctx context.Context, sessionID, workingDir string) error
- func (s *Store) ClearTabs(ctx context.Context) error
- func (s *Store) Close() error
- func (s *Store) GetFavoriteDirs(ctx context.Context) ([]string, error)
- func (s *Store) GetRecentDirs(ctx context.Context, limit int) ([]string, error)
- func (s *Store) GetTabs(ctx context.Context) ([]TabEntry, string, error)
- func (s *Store) IsFavoriteDir(ctx context.Context, path string) (bool, error)
- func (s *Store) RemoveFavoriteDir(ctx context.Context, path string) error
- func (s *Store) RemoveTab(ctx context.Context, sessionID string) error
- func (s *Store) ReorderTab(ctx context.Context, sessionIDs []string) error
- func (s *Store) SetActiveTab(ctx context.Context, sessionID string) error
- func (s *Store) ToggleFavoriteDir(ctx context.Context, path string) (bool, error)
- func (s *Store) ToggleSidebarCollapsed(ctx context.Context, sessionID string) error
- func (s *Store) UpdateTabSessionID(ctx context.Context, oldID, newID string) error
- func (s *Store) UpdateTabWorkingDir(ctx context.Context, sessionID, workingDir string) error
- type TabEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages persistent TUI state in a SQLite database.
func (*Store) AddFavoriteDir ¶
AddFavoriteDir adds a directory to the favorites list.
func (*Store) ClearTabs ¶
ClearTabs removes all tabs from the store. Used when starting fresh (no tabs to restore).
func (*Store) GetFavoriteDirs ¶
GetFavoriteDirs returns all favorite directories, ordered by most recently added.
func (*Store) GetRecentDirs ¶
GetRecentDirs returns the most recently used directories.
func (*Store) GetTabs ¶
GetTabs returns all persisted tabs in position order, along with the active tab's session ID.
func (*Store) IsFavoriteDir ¶
IsFavoriteDir checks if a directory is in the favorites list.
func (*Store) RemoveFavoriteDir ¶
RemoveFavoriteDir removes a directory from the favorites list.
func (*Store) RemoveTab ¶
RemoveTab removes a tab from the store and compacts the remaining positions.
func (*Store) ReorderTab ¶
ReorderTab persists a new tab order. sessionIDs must contain every tab's persisted session ID in the desired order; positions are assigned 0..N-1.
func (*Store) SetActiveTab ¶
SetActiveTab sets the currently active tab.
func (*Store) ToggleFavoriteDir ¶
ToggleFavoriteDir adds or removes a directory from favorites. Returns the new state (true = now favorite).
func (*Store) ToggleSidebarCollapsed ¶
ToggleSidebarCollapsed inverts the sidebar collapsed state for a tab.
func (*Store) UpdateTabSessionID ¶
UpdateTabSessionID replaces the session ID for a tab entry. Used after restoring a session: the tab store initially holds an ephemeral runner ID, which must be updated to the actual session store ID so that the session can be found on the next restart.