Documentation
¶
Overview ¶
Package usecase contains application business logic.
Package usecase contains application business logic.
Package usecase contains application business logic.
Package usecase contains application use cases that orchestrate domain logic.
Package usecase contains application business logic.
Index ¶
- Variables
- func ExtractDomain(rawURL string) (string, error)
- func GetRelativeTime(t time.Time) string
- type AddFavoriteInput
- type AddToStackOutput
- type ApplyUpdateInput
- type ApplyUpdateOutput
- type ApplyUpdateUseCase
- func (uc *ApplyUpdateUseCase) ClearPendingUpdate(ctx context.Context) error
- func (uc *ApplyUpdateUseCase) Execute(ctx context.Context, input ApplyUpdateInput) (*ApplyUpdateOutput, error)
- func (uc *ApplyUpdateUseCase) FinalizeOnExit(ctx context.Context) error
- func (uc *ApplyUpdateUseCase) HasPendingUpdate(ctx context.Context) bool
- type CheckMediaInput
- type CheckMediaOutput
- type CheckMediaUseCase
- type CheckRuntimeDependenciesInput
- type CheckRuntimeDependenciesOutput
- type CheckRuntimeDependenciesUseCase
- type CheckUpdateInput
- type CheckUpdateOutput
- type CheckUpdateUseCase
- type CleanupSessionsInput
- type CleanupSessionsOutput
- type CleanupSessionsUseCase
- type ConsumeOrExpelDirection
- type ConsumeOrExpelResult
- type CopyURLUseCase
- type CreateStackOutput
- type CreateTabInput
- type CreateTabOutput
- type CreateTabWithPaneInput
- type DeleteSessionInput
- type DeleteSessionUseCase
- type FindInPageUseCase
- func (uc *FindInPageUseCase) Bind(controller port.FindController)
- func (uc *FindInPageUseCase) Finish()
- func (uc *FindInPageUseCase) History() []string
- func (uc *FindInPageUseCase) NextHistory() (string, bool)
- func (uc *FindInPageUseCase) PrevHistory() (string, bool)
- func (uc *FindInPageUseCase) SearchNext()
- func (uc *FindInPageUseCase) SearchPrevious()
- func (uc *FindInPageUseCase) SetAtWordStarts(enabled bool)
- func (uc *FindInPageUseCase) SetCaseSensitiveEnabled(enabled bool)
- func (uc *FindInPageUseCase) SetHighlightEnabled(enabled bool)
- func (uc *FindInPageUseCase) SetOnStateChange(fn func(state FindState))
- func (uc *FindInPageUseCase) SetQuery(text string)
- func (uc *FindInPageUseCase) SetWrapAround(enabled bool)
- func (uc *FindInPageUseCase) Unbind()
- type FindState
- type GeometricNavigationInput
- type GeometricNavigationOutput
- type GetLastRestorableSessionInput
- type GetLastRestorableSessionOutput
- type GetLastRestorableSessionUseCase
- type IDGenerator
- type InstallDesktopInput
- type InstallDesktopOutput
- type InstallDesktopUseCase
- type ListSessionsOutput
- type ListSessionsUseCase
- func (uc *ListSessionsUseCase) Execute(ctx context.Context, currentSessionID entity.SessionID, limit int) (*ListSessionsOutput, error)
- func (uc *ListSessionsUseCase) GetPurgeableSessions(ctx context.Context) (*PurgeableSessionsOutput, error)
- func (uc *ListSessionsUseCase) GetSessionInfo(ctx context.Context, sessionID, currentSessionID entity.SessionID) (*entity.SessionInfo, error)
- type ManageFavoritesUseCase
- func (uc *ManageFavoritesUseCase) Add(ctx context.Context, input AddFavoriteInput) (*entity.Favorite, error)
- func (uc *ManageFavoritesUseCase) AddTag(ctx context.Context, name, color string) (*entity.Tag, error)
- func (uc *ManageFavoritesUseCase) CreateFolder(ctx context.Context, name string, parentID *entity.FolderID) (*entity.Folder, error)
- func (uc *ManageFavoritesUseCase) DeleteFolder(ctx context.Context, id entity.FolderID) error
- func (uc *ManageFavoritesUseCase) DeleteTag(ctx context.Context, id entity.TagID) error
- func (uc *ManageFavoritesUseCase) GetAll(ctx context.Context) ([]*entity.Favorite, error)
- func (uc *ManageFavoritesUseCase) GetAllFolders(ctx context.Context) ([]*entity.Folder, error)
- func (uc *ManageFavoritesUseCase) GetAllTags(ctx context.Context) ([]*entity.Tag, error)
- func (uc *ManageFavoritesUseCase) GetByShortcut(ctx context.Context, key int) (*entity.Favorite, error)
- func (uc *ManageFavoritesUseCase) GetByURL(ctx context.Context, url string) (*entity.Favorite, error)
- func (uc *ManageFavoritesUseCase) GetTagsForFavorite(ctx context.Context, favID entity.FavoriteID) ([]*entity.Tag, error)
- func (uc *ManageFavoritesUseCase) GetTree(ctx context.Context) (*entity.FavoriteTree, error)
- func (uc *ManageFavoritesUseCase) IsFavorite(ctx context.Context, url string) (bool, error)
- func (uc *ManageFavoritesUseCase) Move(ctx context.Context, id entity.FavoriteID, folderID *entity.FolderID) error
- func (uc *ManageFavoritesUseCase) Remove(ctx context.Context, id entity.FavoriteID) error
- func (uc *ManageFavoritesUseCase) RemoveByURL(ctx context.Context, url string) error
- func (uc *ManageFavoritesUseCase) SetShortcut(ctx context.Context, id entity.FavoriteID, key *int) error
- func (uc *ManageFavoritesUseCase) TagFavorite(ctx context.Context, favID entity.FavoriteID, tagID entity.TagID) error
- func (uc *ManageFavoritesUseCase) UntagFavorite(ctx context.Context, favID entity.FavoriteID, tagID entity.TagID) error
- func (uc *ManageFavoritesUseCase) Update(ctx context.Context, fav *entity.Favorite) error
- func (uc *ManageFavoritesUseCase) UpdateFolder(ctx context.Context, id entity.FolderID, name, icon string) error
- func (uc *ManageFavoritesUseCase) UpdateTag(ctx context.Context, id entity.TagID, name, color string) error
- type ManagePanesUseCase
- func (uc *ManagePanesUseCase) AddToStack(ctx context.Context, ws *entity.Workspace, stackNode *entity.PaneNode, ...) (*AddToStackOutput, error)
- func (uc *ManagePanesUseCase) Close(ctx context.Context, ws *entity.Workspace, paneNode *entity.PaneNode) (*entity.PaneNode, error)
- func (uc *ManagePanesUseCase) ConsumeOrExpel(ctx context.Context, ws *entity.Workspace, activeNode *entity.PaneNode, ...) (*ConsumeOrExpelResult, error)
- func (uc *ManagePanesUseCase) CountPanes(ws *entity.Workspace) int
- func (uc *ManagePanesUseCase) CreateStack(ctx context.Context, ws *entity.Workspace, paneNode *entity.PaneNode) (*CreateStackOutput, error)
- func (uc *ManagePanesUseCase) Focus(ctx context.Context, ws *entity.Workspace, paneID entity.PaneID) error
- func (uc *ManagePanesUseCase) GetAllPanes(ws *entity.Workspace) []*entity.Pane
- func (uc *ManagePanesUseCase) NavigateFocus(ctx context.Context, ws *entity.Workspace, direction NavigateDirection) (*entity.PaneNode, error)
- func (uc *ManagePanesUseCase) NavigateFocusGeometric(ctx context.Context, input GeometricNavigationInput) (*GeometricNavigationOutput, error)
- func (uc *ManagePanesUseCase) NavigateStack(ctx context.Context, stackNode *entity.PaneNode, direction NavigateDirection) (*entity.Pane, error)
- func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *entity.PaneNode, paneID entity.PaneID) error
- func (uc *ManagePanesUseCase) Resize(ctx context.Context, ws *entity.Workspace, paneNode *entity.PaneNode, ...) error
- func (uc *ManagePanesUseCase) SetSplitRatio(ctx context.Context, input SetSplitRatioInput) error
- func (uc *ManagePanesUseCase) Split(ctx context.Context, input SplitPaneInput) (*SplitPaneOutput, error)
- type ManageSessionUseCase
- func (uc *ManageSessionUseCase) EndSession(ctx context.Context, sessionID entity.SessionID, endedAt time.Time) error
- func (uc *ManageSessionUseCase) GetActiveSession(ctx context.Context) (*entity.Session, error)
- func (uc *ManageSessionUseCase) GetRecentSessions(ctx context.Context, limit int) ([]*entity.Session, error)
- func (uc *ManageSessionUseCase) StartSession(ctx context.Context, input StartSessionInput) (*StartSessionOutput, error)
- type ManageTabsUseCase
- func (uc *ManageTabsUseCase) Close(ctx context.Context, tabs *entity.TabList, tabID entity.TabID) (wasLast bool, err error)
- func (uc *ManageTabsUseCase) Create(ctx context.Context, input CreateTabInput) (*CreateTabOutput, error)
- func (uc *ManageTabsUseCase) CreateWithPane(ctx context.Context, input CreateTabWithPaneInput) (*CreateTabOutput, error)
- func (uc *ManageTabsUseCase) GetNext(tabs *entity.TabList, direction int) entity.TabID
- func (uc *ManageTabsUseCase) Move(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, newPosition int) error
- func (uc *ManageTabsUseCase) Pin(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, pinned bool) error
- func (uc *ManageTabsUseCase) Rename(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, name string) error
- func (uc *ManageTabsUseCase) Switch(ctx context.Context, tabs *entity.TabList, tabID entity.TabID) error
- func (uc *ManageTabsUseCase) SwitchByIndex(ctx context.Context, tabs *entity.TabList, index int) error
- func (uc *ManageTabsUseCase) SwitchNext(ctx context.Context, tabs *entity.TabList) error
- func (uc *ManageTabsUseCase) SwitchPrevious(ctx context.Context, tabs *entity.TabList) error
- func (uc *ManageTabsUseCase) SwitchToLastActive(ctx context.Context, tabs *entity.TabList) error
- type ManageZoomUseCase
- func (uc *ManageZoomUseCase) ApplyToWebView(ctx context.Context, webview port.WebView, domain string) error
- func (uc *ManageZoomUseCase) DefaultZoom() float64
- func (uc *ManageZoomUseCase) GetAll(ctx context.Context) ([]*entity.ZoomLevel, error)
- func (uc *ManageZoomUseCase) GetZoom(ctx context.Context, domain string) (*entity.ZoomLevel, error)
- func (uc *ManageZoomUseCase) ResetZoom(ctx context.Context, domain string) error
- func (uc *ManageZoomUseCase) SetZoom(ctx context.Context, domain string, factor float64) error
- func (uc *ManageZoomUseCase) ZoomIn(ctx context.Context, domain string, current float64) (*entity.ZoomLevel, error)
- func (uc *ManageZoomUseCase) ZoomOut(ctx context.Context, domain string, current float64) (*entity.ZoomLevel, error)
- type NavigateDirection
- type NavigateInput
- type NavigateOutput
- type NavigateUseCase
- func (uc *NavigateUseCase) Close()
- func (uc *NavigateUseCase) Execute(ctx context.Context, input NavigateInput) (*NavigateOutput, error)
- func (uc *NavigateUseCase) GoBack(ctx context.Context, webview port.WebView) error
- func (uc *NavigateUseCase) GoForward(ctx context.Context, webview port.WebView) error
- func (uc *NavigateUseCase) RecordHistory(ctx context.Context, url string)
- func (uc *NavigateUseCase) Reload(ctx context.Context, webview port.WebView, bypassCache bool) error
- func (uc *NavigateUseCase) Stop(ctx context.Context, webview port.WebView) error
- func (uc *NavigateUseCase) UpdateHistoryTitle(ctx context.Context, url, title string) error
- type PrepareWebUIThemeInput
- type PrepareWebUIThemeUseCase
- type PurgeDataUseCase
- type PurgeInput
- type PurgeOutput
- type PurgeableSessionsOutput
- type RemoveDesktopOutput
- type RemoveDesktopUseCase
- type ResizeDirection
- type RestoreInput
- type RestoreOutput
- type RestoreSessionUseCase
- type RunMediaDiagnosticsInput
- type RunMediaDiagnosticsOutput
- type RunMediaDiagnosticsUseCase
- type RuntimeDependencyID
- type RuntimeDependencyStatus
- type SaveWebUIConfigUseCase
- type SearchHistoryUseCase
- func (uc *SearchHistoryUseCase) ClearAll(ctx context.Context) error
- func (uc *SearchHistoryUseCase) ClearOlderThan(ctx context.Context, before time.Time) error
- func (uc *SearchHistoryUseCase) Delete(ctx context.Context, id int64) error
- func (uc *SearchHistoryUseCase) DeleteByDomain(ctx context.Context, domain string) error
- func (uc *SearchHistoryUseCase) FindByURL(ctx context.Context, url string) (*entity.HistoryEntry, error)
- func (uc *SearchHistoryUseCase) GetAnalytics(ctx context.Context) (*entity.HistoryAnalytics, error)
- func (uc *SearchHistoryUseCase) GetDomainStats(ctx context.Context, limit int) ([]*entity.DomainStat, error)
- func (uc *SearchHistoryUseCase) GetRecent(ctx context.Context, limit, offset int) ([]*entity.HistoryEntry, error)
- func (uc *SearchHistoryUseCase) Search(ctx context.Context, input SearchInput) (*SearchOutput, error)
- type SearchInput
- type SearchOutput
- type SetDefaultBrowserUseCase
- type SetDefaultOutput
- type SetSplitRatioInput
- type SnapshotInput
- type SnapshotSessionUseCase
- type SplitDirection
- type SplitPaneInput
- type SplitPaneOutput
- type StartSessionInput
- type StartSessionOutput
Constants ¶
This section is empty.
Variables ¶
var ( ErrCannotDeleteCurrentSession = errors.New("cannot delete current session") ErrCannotDeleteActiveSession = errors.New("cannot delete active session") )
DeleteSessionUseCase errors.
var ErrNothingToResize = errors.New("nothing to resize")
var ErrSessionNotFound = errors.New("session not found")
ErrSessionNotFound is returned when a session state cannot be found.
var ErrVersionMismatch = errors.New("session state version mismatch")
ErrVersionMismatch is returned when the session state version is incompatible.
Functions ¶
func ExtractDomain ¶
ExtractDomain extracts the host from a URL string.
func GetRelativeTime ¶ added in v0.21.0
GetRelativeTime returns a human-readable relative time string.
Types ¶
type AddFavoriteInput ¶
type AddFavoriteInput struct {
URL string
Title string
FaviconURL string
FolderID *entity.FolderID
Tags []entity.TagID
}
AddFavoriteInput contains parameters for adding a favorite.
type AddToStackOutput ¶
type AddToStackOutput struct {
NewPaneNode *entity.PaneNode // The new pane node added to the stack
StackIndex int // Index of the new pane in the stack
}
AddToStackOutput contains the result of adding a pane to a stack.
type ApplyUpdateInput ¶ added in v0.21.0
type ApplyUpdateInput struct {
// DownloadURL is the URL to download the update from.
DownloadURL string
}
ApplyUpdateInput holds the input for the apply update use case.
type ApplyUpdateOutput ¶ added in v0.21.0
type ApplyUpdateOutput struct {
// Status is the current update status.
Status entity.UpdateStatus
// Message is a human-readable status message.
Message string
// StagedPath is the path to the staged binary (if status is Ready).
StagedPath string
}
ApplyUpdateOutput holds the result of the update application.
type ApplyUpdateUseCase ¶ added in v0.21.0
type ApplyUpdateUseCase struct {
// contains filtered or unexported fields
}
ApplyUpdateUseCase downloads and stages updates for application on exit.
func NewApplyUpdateUseCase ¶ added in v0.21.0
func NewApplyUpdateUseCase( downloader port.UpdateDownloader, applier port.UpdateApplier, cacheDir string, ) *ApplyUpdateUseCase
NewApplyUpdateUseCase creates a new apply update use case.
func (*ApplyUpdateUseCase) ClearPendingUpdate ¶ added in v0.21.0
func (uc *ApplyUpdateUseCase) ClearPendingUpdate(ctx context.Context) error
ClearPendingUpdate removes any staged update.
func (*ApplyUpdateUseCase) Execute ¶ added in v0.21.0
func (uc *ApplyUpdateUseCase) Execute(ctx context.Context, input ApplyUpdateInput) (*ApplyUpdateOutput, error)
Execute downloads and stages the update for application on exit.
func (*ApplyUpdateUseCase) FinalizeOnExit ¶ added in v0.21.0
func (uc *ApplyUpdateUseCase) FinalizeOnExit(ctx context.Context) error
FinalizeOnExit applies the staged update during shutdown. This should be called from the app's shutdown handler.
func (*ApplyUpdateUseCase) HasPendingUpdate ¶ added in v0.21.0
func (uc *ApplyUpdateUseCase) HasPendingUpdate(ctx context.Context) bool
HasPendingUpdate checks if there's an update waiting to be applied on exit.
type CheckMediaInput ¶
type CheckMediaInput struct {
ShowDiagnostics bool // Log diagnostics warnings
}
CheckMediaInput contains options for the media check.
type CheckMediaOutput ¶
type CheckMediaOutput struct {
GStreamerAvailable bool
HWAccelAvailable bool
AV1HWAvailable bool
Warnings []string
}
CheckMediaOutput contains the result of the media check.
type CheckMediaUseCase ¶
type CheckMediaUseCase struct {
// contains filtered or unexported fields
}
CheckMediaUseCase validates media playback requirements at startup.
func NewCheckMediaUseCase ¶
func NewCheckMediaUseCase(diagnostics port.MediaDiagnostics) *CheckMediaUseCase
NewCheckMediaUseCase creates a new CheckMediaUseCase.
func (*CheckMediaUseCase) Execute ¶
func (uc *CheckMediaUseCase) Execute(ctx context.Context, input CheckMediaInput) (*CheckMediaOutput, error)
Execute checks media playback requirements. Returns error if GStreamer is not installed (fatal). Returns warnings for missing hardware acceleration (non-fatal).
type CheckRuntimeDependenciesInput ¶
type CheckRuntimeDependenciesInput struct {
// Prefix optionally points to a custom runtime prefix (e.g. /opt/webkitgtk).
// Implementations may use this to influence pkg-config search paths.
Prefix string
// Min versions. If empty, defaults are used.
MinGTK4Version string
MinWebKitGTKVersion string
MinGLibVersion string
}
CheckRuntimeDependenciesInput contains options for runtime dependency checks.
type CheckRuntimeDependenciesOutput ¶
type CheckRuntimeDependenciesOutput struct {
Prefix string
OK bool
Checks []RuntimeDependencyStatus
}
CheckRuntimeDependenciesOutput contains the result of the runtime dependency checks.
type CheckRuntimeDependenciesUseCase ¶
type CheckRuntimeDependenciesUseCase struct {
// contains filtered or unexported fields
}
CheckRuntimeDependenciesUseCase validates runtime requirements for the GUI browser.
func NewCheckRuntimeDependenciesUseCase ¶
func NewCheckRuntimeDependenciesUseCase(probe port.RuntimeVersionProbe) *CheckRuntimeDependenciesUseCase
NewCheckRuntimeDependenciesUseCase creates a new use case.
func (*CheckRuntimeDependenciesUseCase) Execute ¶
func (uc *CheckRuntimeDependenciesUseCase) Execute( ctx context.Context, input CheckRuntimeDependenciesInput, ) (*CheckRuntimeDependenciesOutput, error)
Execute checks WebKitGTK and GTK runtime versions.
type CheckUpdateInput ¶ added in v0.21.0
type CheckUpdateInput struct{}
CheckUpdateInput holds the input for the check update use case.
type CheckUpdateOutput ¶ added in v0.21.0
type CheckUpdateOutput struct {
// UpdateAvailable is true if a newer version exists.
UpdateAvailable bool
// CanAutoUpdate is true if the binary is writable and auto-update is possible.
CanAutoUpdate bool
// CurrentVersion is the version of the running binary.
CurrentVersion string
// LatestVersion is the latest available version.
LatestVersion string
// ReleaseURL is the URL to the GitHub release page.
ReleaseURL string
// DownloadURL is the direct download URL for the archive.
DownloadURL string
}
CheckUpdateOutput holds the result of the update check.
type CheckUpdateUseCase ¶ added in v0.21.0
type CheckUpdateUseCase struct {
// contains filtered or unexported fields
}
CheckUpdateUseCase checks for available updates.
func NewCheckUpdateUseCase ¶ added in v0.21.0
func NewCheckUpdateUseCase( checker port.UpdateChecker, applier port.UpdateApplier, buildInfo build.Info, ) *CheckUpdateUseCase
NewCheckUpdateUseCase creates a new check update use case.
func (*CheckUpdateUseCase) Execute ¶ added in v0.21.0
func (uc *CheckUpdateUseCase) Execute(ctx context.Context, _ CheckUpdateInput) (*CheckUpdateOutput, error)
Execute checks for available updates.
type CleanupSessionsInput ¶ added in v0.21.0
type CleanupSessionsInput struct {
// MaxExitedSessions is the maximum number of exited sessions to keep.
// Sessions beyond this count will be deleted (oldest first).
MaxExitedSessions int
// MaxExitedSessionAgeDays is the maximum age in days for exited sessions.
// Sessions older than this will be deleted.
// A value of 0 disables age-based cleanup.
MaxExitedSessionAgeDays int
}
CleanupSessionsInput contains the cleanup configuration.
type CleanupSessionsOutput ¶ added in v0.21.0
type CleanupSessionsOutput struct {
// DeletedByAge is the number of sessions deleted due to age.
DeletedByAge int64
// DeletedByCount is the number of sessions deleted due to count limit.
DeletedByCount int64
// TotalDeleted is the total number of sessions deleted.
TotalDeleted int64
}
CleanupSessionsOutput contains the cleanup results.
type CleanupSessionsUseCase ¶ added in v0.21.0
type CleanupSessionsUseCase struct {
// contains filtered or unexported fields
}
CleanupSessionsUseCase handles automatic cleanup of old exited sessions.
func NewCleanupSessionsUseCase ¶ added in v0.21.0
func NewCleanupSessionsUseCase(sessionRepo repository.SessionRepository) *CleanupSessionsUseCase
NewCleanupSessionsUseCase creates a new CleanupSessionsUseCase.
func (*CleanupSessionsUseCase) Execute ¶ added in v0.21.0
func (uc *CleanupSessionsUseCase) Execute(ctx context.Context, input CleanupSessionsInput) (CleanupSessionsOutput, error)
Execute cleans up old exited sessions based on the provided configuration. It first deletes sessions older than MaxExitedSessionAgeDays, then enforces the MaxExitedSessions count limit.
type ConsumeOrExpelDirection ¶ added in v0.21.0
type ConsumeOrExpelDirection string
const ( ConsumeOrExpelLeft ConsumeOrExpelDirection = "left" ConsumeOrExpelRight ConsumeOrExpelDirection = "right" ConsumeOrExpelUp ConsumeOrExpelDirection = "up" ConsumeOrExpelDown ConsumeOrExpelDirection = "down" )
type ConsumeOrExpelResult ¶ added in v0.21.0
type CopyURLUseCase ¶
type CopyURLUseCase struct {
// contains filtered or unexported fields
}
CopyURLUseCase handles copying URLs to the system clipboard.
func NewCopyURLUseCase ¶
func NewCopyURLUseCase(clipboard port.Clipboard) *CopyURLUseCase
NewCopyURLUseCase creates a new CopyURLUseCase.
type CreateStackOutput ¶
type CreateStackOutput struct {
StackNode *entity.PaneNode // The stack container node
OriginalNode *entity.PaneNode // The original pane, now a child of the stack
NewPaneNode *entity.PaneNode // The new pane added to the stack
NewPane *entity.Pane // The new pane entity
}
CreateStackOutput contains the result of creating a stack from a pane.
type CreateTabInput ¶
type CreateTabInput struct {
TabList *entity.TabList
Name string // Optional custom name
InitialURL string // URL to load (default: about:blank)
IsPinned bool
}
CreateTabInput contains parameters for creating a new tab.
type CreateTabOutput ¶
CreateTabOutput contains the result of tab creation.
type CreateTabWithPaneInput ¶
type CreateTabWithPaneInput struct {
TabList *entity.TabList
Name string // Optional custom name
Pane *entity.Pane // Pre-created pane (for popups)
InitialURL string // URL for the pane
}
CreateTabWithPaneInput contains parameters for creating a tab with an existing pane.
type DeleteSessionInput ¶ added in v0.21.0
DeleteSessionInput contains the parameters for session deletion.
type DeleteSessionUseCase ¶ added in v0.21.0
type DeleteSessionUseCase struct {
// contains filtered or unexported fields
}
DeleteSessionUseCase handles session deletion with proper validation.
func NewDeleteSessionUseCase ¶ added in v0.21.0
func NewDeleteSessionUseCase( stateRepo repository.SessionStateRepository, sessionRepo repository.SessionRepository, lockDir string, ) *DeleteSessionUseCase
NewDeleteSessionUseCase creates a new DeleteSessionUseCase.
func (*DeleteSessionUseCase) Execute ¶ added in v0.21.0
func (uc *DeleteSessionUseCase) Execute(ctx context.Context, input DeleteSessionInput) error
Execute deletes a session and its state snapshot. It validates that the session is not current or active before deletion.
type FindInPageUseCase ¶
type FindInPageUseCase struct {
// contains filtered or unexported fields
}
FindInPageUseCase manages find-in-page business logic.
func NewFindInPageUseCase ¶
func NewFindInPageUseCase(ctx context.Context) *FindInPageUseCase
NewFindInPageUseCase creates a new find-in-page use case.
func (*FindInPageUseCase) Bind ¶
func (uc *FindInPageUseCase) Bind(controller port.FindController)
Bind attaches a FindController and connects its signals.
func (*FindInPageUseCase) Finish ¶
func (uc *FindInPageUseCase) Finish()
Finish clears the current search and highlights.
func (*FindInPageUseCase) History ¶
func (uc *FindInPageUseCase) History() []string
History returns a copy of the search history.
func (*FindInPageUseCase) NextHistory ¶
func (uc *FindInPageUseCase) NextHistory() (string, bool)
NextHistory selects the next history item.
func (*FindInPageUseCase) PrevHistory ¶
func (uc *FindInPageUseCase) PrevHistory() (string, bool)
PrevHistory selects the previous history item.
func (*FindInPageUseCase) SearchNext ¶
func (uc *FindInPageUseCase) SearchNext()
SearchNext selects the next match.
func (*FindInPageUseCase) SearchPrevious ¶
func (uc *FindInPageUseCase) SearchPrevious()
SearchPrevious selects the previous match.
func (*FindInPageUseCase) SetAtWordStarts ¶
func (uc *FindInPageUseCase) SetAtWordStarts(enabled bool)
SetAtWordStarts toggles word-start matching.
func (*FindInPageUseCase) SetCaseSensitiveEnabled ¶
func (uc *FindInPageUseCase) SetCaseSensitiveEnabled(enabled bool)
SetCaseSensitiveEnabled toggles manual case sensitivity.
func (*FindInPageUseCase) SetHighlightEnabled ¶
func (uc *FindInPageUseCase) SetHighlightEnabled(enabled bool)
SetHighlightEnabled toggles match highlighting.
func (*FindInPageUseCase) SetOnStateChange ¶
func (uc *FindInPageUseCase) SetOnStateChange(fn func(state FindState))
SetOnStateChange sets a callback for state changes.
func (*FindInPageUseCase) SetQuery ¶
func (uc *FindInPageUseCase) SetQuery(text string)
SetQuery updates the search query with debouncing.
func (*FindInPageUseCase) SetWrapAround ¶
func (uc *FindInPageUseCase) SetWrapAround(enabled bool)
SetWrapAround toggles wrap-around searching.
func (*FindInPageUseCase) Unbind ¶
func (uc *FindInPageUseCase) Unbind()
Unbind detaches the FindController and disconnects signals.
type FindState ¶
type FindState struct {
Query string
MatchCount uint
CurrentIndex uint
NotFound bool
CaseSensitive bool
AtWordStarts bool
WrapAround bool
HighlightOn bool
HistoryEnabled bool
}
FindState represents the current find-in-page state.
type GeometricNavigationInput ¶
type GeometricNavigationInput struct {
}
GeometricNavigationInput contains data for geometric focus navigation.
type GeometricNavigationOutput ¶
type GeometricNavigationOutput struct {
}
GeometricNavigationOutput contains the result.
type GetLastRestorableSessionInput ¶ added in v0.21.0
type GetLastRestorableSessionInput struct {
// ExcludeSessionID is the current session ID to exclude from results.
ExcludeSessionID entity.SessionID
}
GetLastRestorableSessionInput contains the parameters for finding a restorable session.
type GetLastRestorableSessionOutput ¶ added in v0.21.0
type GetLastRestorableSessionOutput struct {
// SessionID is the ID of the restorable session, or empty if none found.
SessionID entity.SessionID
// State is the session state to restore, or nil if none found.
State *entity.SessionState
}
GetLastRestorableSessionOutput contains the found restorable session, if any.
type GetLastRestorableSessionUseCase ¶ added in v0.21.0
type GetLastRestorableSessionUseCase struct {
// contains filtered or unexported fields
}
GetLastRestorableSessionUseCase finds the most recent session that can be auto-restored. A session is restorable if:
- It is not the current session
- It is not actively running (has ended or crashed without lock file)
- It has a valid snapshot with at least one tab
func NewGetLastRestorableSessionUseCase ¶ added in v0.21.0
func NewGetLastRestorableSessionUseCase( sessionRepo repository.SessionRepository, stateRepo repository.SessionStateRepository, lockDir string, ) *GetLastRestorableSessionUseCase
NewGetLastRestorableSessionUseCase creates a new GetLastRestorableSessionUseCase.
func (*GetLastRestorableSessionUseCase) Execute ¶ added in v0.21.0
func (uc *GetLastRestorableSessionUseCase) Execute( ctx context.Context, input GetLastRestorableSessionInput, ) (*GetLastRestorableSessionOutput, error)
Execute finds the most recent restorable session. Returns an empty output (not an error) if no restorable session is found.
type IDGenerator ¶
type IDGenerator func() string
IDGenerator is a function type for generating unique IDs.
type InstallDesktopInput ¶
type InstallDesktopInput struct {
IconData []byte
}
InstallDesktopInput contains the input for the install operation.
type InstallDesktopOutput ¶
type InstallDesktopOutput struct {
DesktopPath string
IconPath string
WasDesktopExisting bool
WasIconExisting bool
}
InstallDesktopOutput contains the result of the install operation.
type InstallDesktopUseCase ¶
type InstallDesktopUseCase struct {
// contains filtered or unexported fields
}
InstallDesktopUseCase installs the desktop file for system integration.
func NewInstallDesktopUseCase ¶
func NewInstallDesktopUseCase(desktop port.DesktopIntegration) *InstallDesktopUseCase
NewInstallDesktopUseCase creates a new InstallDesktopUseCase.
func (*InstallDesktopUseCase) Execute ¶
func (uc *InstallDesktopUseCase) Execute(ctx context.Context, input InstallDesktopInput) (*InstallDesktopOutput, error)
Execute installs the desktop file and icon.
type ListSessionsOutput ¶ added in v0.21.0
type ListSessionsOutput struct {
Sessions []entity.SessionInfo
}
ListSessionsOutput contains the list of sessions with their info.
type ListSessionsUseCase ¶ added in v0.21.0
type ListSessionsUseCase struct {
// contains filtered or unexported fields
}
ListSessionsUseCase handles listing sessions with their state information.
func NewListSessionsUseCase ¶ added in v0.21.0
func NewListSessionsUseCase( sessionRepo repository.SessionRepository, stateRepo repository.SessionStateRepository, lockDir string, ) *ListSessionsUseCase
NewListSessionsUseCase creates a new ListSessionsUseCase.
func (*ListSessionsUseCase) Execute ¶ added in v0.21.0
func (uc *ListSessionsUseCase) Execute(ctx context.Context, currentSessionID entity.SessionID, limit int) (*ListSessionsOutput, error)
Execute returns a list of sessions with their state information. Sessions are sorted with active first, then by date (most recent first).
func (*ListSessionsUseCase) GetPurgeableSessions ¶ added in v0.21.0
func (uc *ListSessionsUseCase) GetPurgeableSessions(ctx context.Context) (*PurgeableSessionsOutput, error)
GetPurgeableSessions returns all inactive sessions that can be safely deleted. These are sessions that have ended and have no active lock file.
func (*ListSessionsUseCase) GetSessionInfo ¶ added in v0.21.0
func (uc *ListSessionsUseCase) GetSessionInfo( ctx context.Context, sessionID, currentSessionID entity.SessionID, ) (*entity.SessionInfo, error)
GetSessionInfo returns info for a specific session.
type ManageFavoritesUseCase ¶
type ManageFavoritesUseCase struct {
// contains filtered or unexported fields
}
ManageFavoritesUseCase handles favorite, folder, and tag operations.
func NewManageFavoritesUseCase ¶
func NewManageFavoritesUseCase( favoriteRepo repository.FavoriteRepository, folderRepo repository.FolderRepository, tagRepo repository.TagRepository, ) *ManageFavoritesUseCase
NewManageFavoritesUseCase creates a new favorites management use case.
func (*ManageFavoritesUseCase) Add ¶
func (uc *ManageFavoritesUseCase) Add(ctx context.Context, input AddFavoriteInput) (*entity.Favorite, error)
Add creates a new favorite.
func (*ManageFavoritesUseCase) AddTag ¶
func (uc *ManageFavoritesUseCase) AddTag(ctx context.Context, name, color string) (*entity.Tag, error)
AddTag creates a new tag.
func (*ManageFavoritesUseCase) CreateFolder ¶
func (uc *ManageFavoritesUseCase) CreateFolder(ctx context.Context, name string, parentID *entity.FolderID) (*entity.Folder, error)
CreateFolder creates a new folder.
func (*ManageFavoritesUseCase) DeleteFolder ¶
DeleteFolder removes a folder. Favorites in the folder are moved to root.
func (*ManageFavoritesUseCase) GetAllFolders ¶
GetAllFolders retrieves all folders.
func (*ManageFavoritesUseCase) GetAllTags ¶
GetAllTags retrieves all tags.
func (*ManageFavoritesUseCase) GetByShortcut ¶
func (uc *ManageFavoritesUseCase) GetByShortcut(ctx context.Context, key int) (*entity.Favorite, error)
GetByShortcut finds the favorite with the given shortcut key.
func (*ManageFavoritesUseCase) GetByURL ¶
func (uc *ManageFavoritesUseCase) GetByURL(ctx context.Context, url string) (*entity.Favorite, error)
GetByURL finds a favorite by its URL.
func (*ManageFavoritesUseCase) GetTagsForFavorite ¶
func (uc *ManageFavoritesUseCase) GetTagsForFavorite(ctx context.Context, favID entity.FavoriteID) ([]*entity.Tag, error)
GetTagsForFavorite retrieves all tags for a favorite.
func (*ManageFavoritesUseCase) GetTree ¶
func (uc *ManageFavoritesUseCase) GetTree(ctx context.Context) (*entity.FavoriteTree, error)
GetTree builds a complete hierarchical view of folders and favorites.
func (*ManageFavoritesUseCase) IsFavorite ¶
IsFavorite checks if a URL is favorited.
func (*ManageFavoritesUseCase) Move ¶
func (uc *ManageFavoritesUseCase) Move(ctx context.Context, id entity.FavoriteID, folderID *entity.FolderID) error
Move changes a favorite's folder.
func (*ManageFavoritesUseCase) Remove ¶
func (uc *ManageFavoritesUseCase) Remove(ctx context.Context, id entity.FavoriteID) error
Remove deletes a favorite by ID.
func (*ManageFavoritesUseCase) RemoveByURL ¶
func (uc *ManageFavoritesUseCase) RemoveByURL(ctx context.Context, url string) error
RemoveByURL deletes a favorite by its URL.
func (*ManageFavoritesUseCase) SetShortcut ¶
func (uc *ManageFavoritesUseCase) SetShortcut(ctx context.Context, id entity.FavoriteID, key *int) error
SetShortcut assigns or removes a keyboard shortcut (1-9).
func (*ManageFavoritesUseCase) TagFavorite ¶
func (uc *ManageFavoritesUseCase) TagFavorite(ctx context.Context, favID entity.FavoriteID, tagID entity.TagID) error
TagFavorite assigns a tag to a favorite.
func (*ManageFavoritesUseCase) UntagFavorite ¶
func (uc *ManageFavoritesUseCase) UntagFavorite(ctx context.Context, favID entity.FavoriteID, tagID entity.TagID) error
UntagFavorite removes a tag from a favorite.
func (*ManageFavoritesUseCase) UpdateFolder ¶
func (uc *ManageFavoritesUseCase) UpdateFolder(ctx context.Context, id entity.FolderID, name, icon string) error
UpdateFolder updates a folder's name and icon.
type ManagePanesUseCase ¶
type ManagePanesUseCase struct {
// contains filtered or unexported fields
}
ManagePanesUseCase handles pane tree operations.
func NewManagePanesUseCase ¶
func NewManagePanesUseCase(idGenerator IDGenerator) *ManagePanesUseCase
NewManagePanesUseCase creates a new pane management use case.
func (*ManagePanesUseCase) AddToStack ¶
func (uc *ManagePanesUseCase) AddToStack( ctx context.Context, ws *entity.Workspace, stackNode *entity.PaneNode, pane *entity.Pane, ) (*AddToStackOutput, error)
AddToStack adds a new pane to an existing stack. Optionally pass a pre-created pane, or nil to create a new one.
func (*ManagePanesUseCase) Close ¶
func (uc *ManagePanesUseCase) Close(ctx context.Context, ws *entity.Workspace, paneNode *entity.PaneNode) (*entity.PaneNode, error)
Close removes a pane and promotes its sibling. Returns the sibling node that was promoted, or nil if this was the last pane.
func (*ManagePanesUseCase) ConsumeOrExpel ¶ added in v0.21.0
func (uc *ManagePanesUseCase) ConsumeOrExpel( ctx context.Context, ws *entity.Workspace, activeNode *entity.PaneNode, direction ConsumeOrExpelDirection, ) (*ConsumeOrExpelResult, error)
func (*ManagePanesUseCase) CountPanes ¶
func (uc *ManagePanesUseCase) CountPanes(ws *entity.Workspace) int
CountPanes returns the number of panes in a workspace.
func (*ManagePanesUseCase) CreateStack ¶
func (uc *ManagePanesUseCase) CreateStack( ctx context.Context, ws *entity.Workspace, paneNode *entity.PaneNode, ) (*CreateStackOutput, error)
CreateStack converts a pane into a stacked container and adds a new pane. The original pane becomes the first child, a new pane becomes the second child. Returns the stack node and the new pane node for UI operations.
Domain tree transformation:
Before: parent -> targetNode (leaf with pane) After: parent -> targetNode (stack) -> [originalChild (leaf), newChild (leaf)]
The targetNode keeps its ID but becomes a stack container. This allows the UI layer to update widget mappings incrementally.
func (*ManagePanesUseCase) Focus ¶
func (uc *ManagePanesUseCase) Focus(ctx context.Context, ws *entity.Workspace, paneID entity.PaneID) error
Focus sets the active pane in the workspace.
func (*ManagePanesUseCase) GetAllPanes ¶
func (uc *ManagePanesUseCase) GetAllPanes(ws *entity.Workspace) []*entity.Pane
GetAllPanes returns all leaf panes in a workspace.
func (*ManagePanesUseCase) NavigateFocus ¶
func (uc *ManagePanesUseCase) NavigateFocus( ctx context.Context, ws *entity.Workspace, direction NavigateDirection, ) (*entity.PaneNode, error)
NavigateFocus moves focus to an adjacent pane. Returns the newly focused pane, or nil if navigation not possible.
func (*ManagePanesUseCase) NavigateFocusGeometric ¶
func (uc *ManagePanesUseCase) NavigateFocusGeometric( ctx context.Context, input GeometricNavigationInput, ) (*GeometricNavigationOutput, error)
NavigateFocusGeometric finds the nearest pane in the given direction using geometry. Algorithm:
- Get center of active pane
- Filter candidates that are in the direction (dx < 0 for Left, etc.)
- Score by: primary_distance * 1000 + perpendicular_distance
- Return lowest scoring candidate
func (*ManagePanesUseCase) NavigateStack ¶
func (uc *ManagePanesUseCase) NavigateStack( ctx context.Context, stackNode *entity.PaneNode, direction NavigateDirection, ) (*entity.Pane, error)
NavigateStack cycles through stacked panes. direction: NavUp for previous, NavDown for next.
func (*ManagePanesUseCase) RemoveFromStack ¶
func (uc *ManagePanesUseCase) RemoveFromStack(ctx context.Context, stackNode *entity.PaneNode, paneID entity.PaneID) error
RemoveFromStack removes a pane from a stack. If only one pane remains, the stack is dissolved.
func (*ManagePanesUseCase) Resize ¶ added in v0.21.0
func (uc *ManagePanesUseCase) Resize( ctx context.Context, ws *entity.Workspace, paneNode *entity.PaneNode, dir ResizeDirection, stepPercent float64, minPanePercent float64, ) error
Resize adjusts the nearest applicable split ratio for the given direction. stepPercent is applied per keystroke (e.g. 5.0 means 5%). minPanePercent enforces a minimum size for each side of a split.
func (*ManagePanesUseCase) SetSplitRatio ¶ added in v0.21.0
func (uc *ManagePanesUseCase) SetSplitRatio(ctx context.Context, input SetSplitRatioInput) error
func (*ManagePanesUseCase) Split ¶
func (uc *ManagePanesUseCase) Split(ctx context.Context, input SplitPaneInput) (*SplitPaneOutput, error)
Split creates a new pane adjacent to the target pane.
type ManageSessionUseCase ¶
type ManageSessionUseCase struct {
// contains filtered or unexported fields
}
func NewManageSessionUseCase ¶
func NewManageSessionUseCase(sessionRepo repository.SessionRepository, loggerPort port.SessionLogger) *ManageSessionUseCase
func (*ManageSessionUseCase) EndSession ¶
func (*ManageSessionUseCase) GetActiveSession ¶
func (*ManageSessionUseCase) GetRecentSessions ¶
func (*ManageSessionUseCase) StartSession ¶
func (uc *ManageSessionUseCase) StartSession(ctx context.Context, input StartSessionInput) (*StartSessionOutput, error)
type ManageTabsUseCase ¶
type ManageTabsUseCase struct {
// contains filtered or unexported fields
}
ManageTabsUseCase handles tab lifecycle operations.
func NewManageTabsUseCase ¶
func NewManageTabsUseCase(idGenerator IDGenerator) *ManageTabsUseCase
NewManageTabsUseCase creates a new tab management use case.
func (*ManageTabsUseCase) Close ¶
func (uc *ManageTabsUseCase) Close(ctx context.Context, tabs *entity.TabList, tabID entity.TabID) (wasLast bool, err error)
Close removes a tab from the list. Returns true if this was the last tab (caller should handle app exit).
func (*ManageTabsUseCase) Create ¶
func (uc *ManageTabsUseCase) Create(ctx context.Context, input CreateTabInput) (*CreateTabOutput, error)
Create creates a new tab with a workspace and initial pane.
func (*ManageTabsUseCase) CreateWithPane ¶
func (uc *ManageTabsUseCase) CreateWithPane(ctx context.Context, input CreateTabWithPaneInput) (*CreateTabOutput, error)
CreateWithPane creates a new tab using a pre-existing pane. This is used for tabbed popup behavior where the popup pane is already created.
func (*ManageTabsUseCase) GetNext ¶
GetNext returns the next tab ID in the given direction. direction: 1 for next, -1 for previous.
func (*ManageTabsUseCase) Move ¶
func (uc *ManageTabsUseCase) Move(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, newPosition int) error
Move repositions a tab within the tab bar.
func (*ManageTabsUseCase) Pin ¶
func (uc *ManageTabsUseCase) Pin(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, pinned bool) error
Pin toggles the pinned state of a tab.
func (*ManageTabsUseCase) Rename ¶
func (uc *ManageTabsUseCase) Rename(ctx context.Context, tabs *entity.TabList, tabID entity.TabID, name string) error
Rename changes a tab's custom name.
func (*ManageTabsUseCase) Switch ¶
func (uc *ManageTabsUseCase) Switch(ctx context.Context, tabs *entity.TabList, tabID entity.TabID) error
Switch changes the active tab.
func (*ManageTabsUseCase) SwitchByIndex ¶
func (uc *ManageTabsUseCase) SwitchByIndex(ctx context.Context, tabs *entity.TabList, index int) error
SwitchByIndex switches to tab at the given index (0-based).
func (*ManageTabsUseCase) SwitchNext ¶
SwitchNext switches to the next tab (wraps around).
func (*ManageTabsUseCase) SwitchPrevious ¶
SwitchPrevious switches to the previous tab (wraps around).
func (*ManageTabsUseCase) SwitchToLastActive ¶
SwitchToLastActive switches to the previously active tab (Alt+Tab style).
type ManageZoomUseCase ¶
type ManageZoomUseCase struct {
// contains filtered or unexported fields
}
ManageZoomUseCase handles per-domain zoom level operations. It uses an LRU cache to avoid database queries on every navigation.
func NewManageZoomUseCase ¶
func NewManageZoomUseCase( zoomRepo repository.ZoomRepository, defaultZoom float64, cache port.Cache[string, *entity.ZoomLevel], ) *ManageZoomUseCase
NewManageZoomUseCase creates a new zoom management use case. defaultZoom is the zoom level to use when resetting (typically from config). cache is an LRU cache for zoom levels to avoid database queries on repeat visits.
func (*ManageZoomUseCase) ApplyToWebView ¶
func (uc *ManageZoomUseCase) ApplyToWebView(ctx context.Context, webview port.WebView, domain string) error
ApplyToWebView loads the saved zoom level and applies it to a webview.
func (*ManageZoomUseCase) DefaultZoom ¶
func (uc *ManageZoomUseCase) DefaultZoom() float64
DefaultZoom returns the configured default zoom level.
func (*ManageZoomUseCase) GetZoom ¶
GetZoom retrieves the zoom level for a domain. Returns the configured default zoom level if none is set. Uses LRU cache to avoid database queries on repeat visits.
func (*ManageZoomUseCase) ResetZoom ¶
func (uc *ManageZoomUseCase) ResetZoom(ctx context.Context, domain string) error
ResetZoom removes the custom zoom level for a domain.
type NavigateDirection ¶
type NavigateDirection string
NavigateDirection indicates the direction for focus navigation.
const ( )
type NavigateInput ¶
type NavigateInput struct {
}
NavigateInput contains parameters for navigation.
type NavigateOutput ¶
type NavigateOutput struct {
}
NavigateOutput contains the result of navigation.
type NavigateUseCase ¶
type NavigateUseCase struct {
// contains filtered or unexported fields
}
NavigateUseCase handles URL navigation with history recording and zoom application.
func NewNavigateUseCase ¶
func NewNavigateUseCase( historyRepo repository.HistoryRepository, zoomRepo repository.ZoomRepository, defaultZoom float64, ) *NavigateUseCase
NewNavigateUseCase creates a new navigation use case. defaultZoom is the zoom level to use when no per-domain zoom is saved (typically from config).
func (*NavigateUseCase) Close ¶ added in v0.20.1
func (uc *NavigateUseCase) Close()
Close shuts down the background history worker and drains any pending records. This should be called when the application is shutting down.
func (*NavigateUseCase) Execute ¶
func (uc *NavigateUseCase) Execute(ctx context.Context, input NavigateInput) (*NavigateOutput, error)
Execute navigates to a URL and records history. Zoom is applied later via LoadCommitted event in ContentCoordinator.
func (*NavigateUseCase) RecordHistory ¶
func (uc *NavigateUseCase) RecordHistory(ctx context.Context, url string)
RecordHistory queues a history entry for async recording. This is non-blocking to avoid SQLite I/O on the GTK main thread. Should be called on LoadCommitted when URI is guaranteed correct.
func (*NavigateUseCase) Reload ¶
func (uc *NavigateUseCase) Reload(ctx context.Context, webview port.WebView, bypassCache bool) error
Reload reloads the current page.
func (*NavigateUseCase) UpdateHistoryTitle ¶
func (uc *NavigateUseCase) UpdateHistoryTitle(ctx context.Context, url, title string) error
UpdateHistoryTitle updates the title of a history entry after page load.
type PrepareWebUIThemeInput ¶
type PrepareWebUIThemeInput struct {
// CSSVars is the CSS custom property declarations to inject.
// Should be generated from palette.ToWebCSSVars().
CSSVars string
}
PrepareWebUIThemeInput contains parameters for theme preparation.
type PrepareWebUIThemeUseCase ¶
type PrepareWebUIThemeUseCase struct {
// contains filtered or unexported fields
}
PrepareWebUIThemeUseCase handles theme CSS injection for internal web pages.
func NewPrepareWebUIThemeUseCase ¶
func NewPrepareWebUIThemeUseCase(injector port.ContentInjector) *PrepareWebUIThemeUseCase
NewPrepareWebUIThemeUseCase creates a new theme preparation use case.
func (*PrepareWebUIThemeUseCase) Execute ¶
func (uc *PrepareWebUIThemeUseCase) Execute(ctx context.Context, input PrepareWebUIThemeInput) error
Execute injects theme CSS variables into the web view.
type PurgeDataUseCase ¶
type PurgeDataUseCase struct {
// contains filtered or unexported fields
}
PurgeDataUseCase handles discovering and purging application data.
func NewPurgeDataUseCase ¶
func NewPurgeDataUseCase(fs port.FileSystem, xdg port.XDGPaths, desktop port.DesktopIntegration) *PurgeDataUseCase
NewPurgeDataUseCase creates a new PurgeDataUseCase.
func (*PurgeDataUseCase) Execute ¶
func (uc *PurgeDataUseCase) Execute(ctx context.Context, input PurgeInput) (*PurgeOutput, error)
Execute purges the selected target types. Continues on errors, collecting all results.
func (*PurgeDataUseCase) GetPurgeTargets ¶
func (uc *PurgeDataUseCase) GetPurgeTargets(ctx context.Context) ([]entity.PurgeTarget, error)
GetPurgeTargets returns all available purge targets with their current state.
func (*PurgeDataUseCase) PurgeAll ¶
func (uc *PurgeDataUseCase) PurgeAll(ctx context.Context) (*PurgeOutput, error)
PurgeAll purges all existing targets (for --force mode).
type PurgeInput ¶
type PurgeInput struct {
TargetTypes []entity.PurgeTargetType
}
PurgeInput specifies which target types to purge.
type PurgeOutput ¶
type PurgeOutput struct {
Results []entity.PurgeResult
TotalSize int64
SuccessCount int
FailureCount int
}
PurgeOutput contains the results of the purge operation.
type PurgeableSessionsOutput ¶ added in v0.21.0
type PurgeableSessionsOutput struct {
Sessions []entity.SessionPurgeItem
TotalSize int64
}
PurgeableSessionsOutput contains inactive sessions that can be purged.
type RemoveDesktopOutput ¶
type RemoveDesktopOutput struct {
WasDesktopInstalled bool
WasIconInstalled bool
WasDefault bool
RemovedDesktopPath string
RemovedIconPath string
}
RemoveDesktopOutput contains the result of the remove operation.
type RemoveDesktopUseCase ¶
type RemoveDesktopUseCase struct {
// contains filtered or unexported fields
}
RemoveDesktopUseCase removes desktop integration files.
func NewRemoveDesktopUseCase ¶
func NewRemoveDesktopUseCase(desktop port.DesktopIntegration) *RemoveDesktopUseCase
NewRemoveDesktopUseCase creates a new RemoveDesktopUseCase.
func (*RemoveDesktopUseCase) Execute ¶
func (uc *RemoveDesktopUseCase) Execute(ctx context.Context) (*RemoveDesktopOutput, error)
Execute removes desktop integration.
type ResizeDirection ¶ added in v0.21.0
type ResizeDirection string
ResizeDirection indicates the direction for pane resizing.
const ( ResizeIncreaseLeft ResizeDirection = "increase_left" ResizeIncreaseRight ResizeDirection = "increase_right" ResizeIncreaseUp ResizeDirection = "increase_up" ResizeIncreaseDown ResizeDirection = "increase_down" ResizeDecreaseLeft ResizeDirection = "decrease_left" ResizeDecreaseRight ResizeDirection = "decrease_right" ResizeDecreaseUp ResizeDirection = "decrease_up" ResizeDecreaseDown ResizeDirection = "decrease_down" ResizeIncrease ResizeDirection = "increase" ResizeDecrease ResizeDirection = "decrease" )
type RestoreInput ¶ added in v0.21.0
RestoreInput contains the parameters for restoring a session.
type RestoreOutput ¶ added in v0.21.0
type RestoreOutput struct {
State *entity.SessionState
}
RestoreOutput contains the restored session state.
type RestoreSessionUseCase ¶ added in v0.21.0
type RestoreSessionUseCase struct {
// contains filtered or unexported fields
}
RestoreSessionUseCase handles restoring session state from a snapshot.
func NewRestoreSessionUseCase ¶ added in v0.21.0
func NewRestoreSessionUseCase( stateRepo repository.SessionStateRepository, sessionRepo repository.SessionRepository, ) *RestoreSessionUseCase
NewRestoreSessionUseCase creates a new RestoreSessionUseCase.
func (*RestoreSessionUseCase) DeleteSnapshot ¶ added in v0.21.0
func (uc *RestoreSessionUseCase) DeleteSnapshot(ctx context.Context, sessionID entity.SessionID) error
DeleteSnapshot removes a session's snapshot (for cleanup after failed restore or user deletion).
func (*RestoreSessionUseCase) Execute ¶ added in v0.21.0
func (uc *RestoreSessionUseCase) Execute(ctx context.Context, input RestoreInput) (*RestoreOutput, error)
Execute loads and validates a session state for restoration.
type RunMediaDiagnosticsInput ¶
type RunMediaDiagnosticsInput struct{}
type RunMediaDiagnosticsOutput ¶
type RunMediaDiagnosticsOutput struct {
GStreamerAvailable bool
HasVAPlugin bool
HasVAAPIPlugin bool
HasNVCodecPlugin bool
AV1Decoders []string
H264Decoders []string
H265Decoders []string
VP9Decoders []string
VAAPIAvailable bool
VAAPIDriver string
VAAPIVersion string
HWAccelAvailable bool
AV1HWAvailable bool
Warnings []string
}
type RunMediaDiagnosticsUseCase ¶
type RunMediaDiagnosticsUseCase struct {
// contains filtered or unexported fields
}
RunMediaDiagnosticsUseCase retrieves detailed media playback diagnostics.
func NewRunMediaDiagnosticsUseCase ¶
func NewRunMediaDiagnosticsUseCase(diagnostics port.MediaDiagnostics) *RunMediaDiagnosticsUseCase
func (*RunMediaDiagnosticsUseCase) Execute ¶
func (uc *RunMediaDiagnosticsUseCase) Execute(ctx context.Context, _ RunMediaDiagnosticsInput) (*RunMediaDiagnosticsOutput, error)
type RuntimeDependencyID ¶
type RuntimeDependencyID string
const ( RuntimeDependencyGTK4 RuntimeDependencyID = "gtk4" RuntimeDependencyWebKitGTK RuntimeDependencyID = "webkitgtk-6.0" )
type RuntimeDependencyStatus ¶
type RuntimeDependencyStatus struct {
ID RuntimeDependencyID
PkgConfigName string
DisplayName string
Installed bool
Version string
RequiredVersion string
MeetsRequirement bool
Error string
}
RuntimeDependencyStatus contains the result of checking a runtime dependency.
type SaveWebUIConfigUseCase ¶
type SaveWebUIConfigUseCase struct {
// contains filtered or unexported fields
}
func NewSaveWebUIConfigUseCase ¶
func NewSaveWebUIConfigUseCase(saver port.WebUIConfigSaver) *SaveWebUIConfigUseCase
func (*SaveWebUIConfigUseCase) Execute ¶
func (uc *SaveWebUIConfigUseCase) Execute(ctx context.Context, cfg port.WebUIConfig) error
type SearchHistoryUseCase ¶
type SearchHistoryUseCase struct {
// contains filtered or unexported fields
}
SearchHistoryUseCase handles history search and retrieval operations.
func NewSearchHistoryUseCase ¶
func NewSearchHistoryUseCase(historyRepo repository.HistoryRepository) *SearchHistoryUseCase
NewSearchHistoryUseCase creates a new history search use case.
func (*SearchHistoryUseCase) ClearAll ¶
func (uc *SearchHistoryUseCase) ClearAll(ctx context.Context) error
ClearAll deletes all history entries.
func (*SearchHistoryUseCase) ClearOlderThan ¶
ClearOlderThan deletes history entries older than the specified time.
func (*SearchHistoryUseCase) Delete ¶
func (uc *SearchHistoryUseCase) Delete(ctx context.Context, id int64) error
Delete removes a single history entry by ID.
func (*SearchHistoryUseCase) DeleteByDomain ¶
func (uc *SearchHistoryUseCase) DeleteByDomain(ctx context.Context, domain string) error
DeleteByDomain removes all history entries for a domain.
func (*SearchHistoryUseCase) FindByURL ¶
func (uc *SearchHistoryUseCase) FindByURL(ctx context.Context, url string) (*entity.HistoryEntry, error)
FindByURL retrieves a history entry by its URL.
func (*SearchHistoryUseCase) GetAnalytics ¶
func (uc *SearchHistoryUseCase) GetAnalytics(ctx context.Context) (*entity.HistoryAnalytics, error)
GetAnalytics retrieves aggregated history analytics for the homepage.
func (*SearchHistoryUseCase) GetDomainStats ¶
func (uc *SearchHistoryUseCase) GetDomainStats(ctx context.Context, limit int) ([]*entity.DomainStat, error)
GetDomainStats retrieves per-domain visit statistics.
func (*SearchHistoryUseCase) GetRecent ¶
func (uc *SearchHistoryUseCase) GetRecent(ctx context.Context, limit, offset int) ([]*entity.HistoryEntry, error)
GetRecent retrieves recent history entries with pagination.
func (*SearchHistoryUseCase) Search ¶
func (uc *SearchHistoryUseCase) Search(ctx context.Context, input SearchInput) (*SearchOutput, error)
Search performs a full-text search on history entries using SQLite FTS5. Returns only entries that actually match the query terms.
type SearchInput ¶
SearchInput contains search parameters.
type SearchOutput ¶
type SearchOutput struct {
Matches []entity.HistoryMatch
}
SearchOutput contains search results.
type SetDefaultBrowserUseCase ¶
type SetDefaultBrowserUseCase struct {
// contains filtered or unexported fields
}
SetDefaultBrowserUseCase sets dumber as the default web browser.
func NewSetDefaultBrowserUseCase ¶
func NewSetDefaultBrowserUseCase(desktop port.DesktopIntegration) *SetDefaultBrowserUseCase
NewSetDefaultBrowserUseCase creates a new SetDefaultBrowserUseCase.
func (*SetDefaultBrowserUseCase) Execute ¶
func (uc *SetDefaultBrowserUseCase) Execute(ctx context.Context) (*SetDefaultOutput, error)
Execute sets dumber as the default browser.
type SetDefaultOutput ¶
type SetDefaultOutput struct {
WasAlreadyDefault bool
}
SetDefaultOutput contains the result of the set-default operation.
type SetSplitRatioInput ¶ added in v0.21.0
type SnapshotInput ¶ added in v0.21.0
SnapshotInput contains the parameters for creating a session snapshot.
type SnapshotSessionUseCase ¶ added in v0.21.0
type SnapshotSessionUseCase struct {
// contains filtered or unexported fields
}
SnapshotSessionUseCase handles saving session state snapshots.
func NewSnapshotSessionUseCase ¶ added in v0.21.0
func NewSnapshotSessionUseCase(stateRepo repository.SessionStateRepository) *SnapshotSessionUseCase
NewSnapshotSessionUseCase creates a new SnapshotSessionUseCase.
func (*SnapshotSessionUseCase) Execute ¶ added in v0.21.0
func (uc *SnapshotSessionUseCase) Execute(ctx context.Context, input SnapshotInput) error
Execute creates a snapshot of the current session state and saves it.
type SplitDirection ¶
type SplitDirection string
SplitDirection indicates the direction of a pane split.
const ( SplitLeft SplitDirection = "left" SplitRight SplitDirection = "right" SplitUp SplitDirection = "up" SplitDown SplitDirection = "down" )
type SplitPaneInput ¶
type SplitPaneInput struct {
Workspace *entity.Workspace
TargetPane *entity.PaneNode
Direction SplitDirection
NewPane *entity.Pane // Optional: existing pane to insert (for popups)
InitialURL string // URL for new pane (default: about:blank)
}
SplitPaneInput contains parameters for splitting a pane.
type SplitPaneOutput ¶
type SplitPaneOutput struct {
NewPaneNode *entity.PaneNode
ParentNode *entity.PaneNode // New parent container
SplitRatio float64 // Always 0.5 for new splits
}
SplitPaneOutput contains the result of a split operation.
type StartSessionInput ¶
type StartSessionInput struct {
Type entity.SessionType
SessionID entity.SessionID
Now time.Time
LogConfig port.SessionLogConfig
}
Source Files
¶
- apply_update.go
- check_media.go
- check_runtime_dependencies.go
- check_update.go
- cleanup_sessions.go
- copy_url.go
- delete_session.go
- find_in_page.go
- get_last_restorable_session.go
- list_sessions.go
- manage_favorites.go
- manage_panes.go
- manage_session.go
- manage_tabs.go
- manage_zoom.go
- navigate.go
- prepare_webui_theme.go
- purge_data.go
- restore_session.go
- run_media_diagnostics.go
- save_webui_config.go
- search_history.go
- session_lock.go
- setup_desktop.go
- snapshot_session.go