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 ¶
- func ExtractDomain(rawURL string) (string, error)
- type AddFavoriteInput
- type AddToStackOutput
- type CheckMediaInput
- type CheckMediaOutput
- type CheckMediaUseCase
- type CheckRuntimeDependenciesInput
- type CheckRuntimeDependenciesOutput
- type CheckRuntimeDependenciesUseCase
- type CopyURLUseCase
- type CreateStackOutput
- type CreateTabInput
- type CreateTabOutput
- type CreateTabWithPaneInput
- 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 IDGenerator
- type InstallDesktopInput
- type InstallDesktopOutput
- type InstallDesktopUseCase
- 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) 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) 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) 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 RemoveDesktopOutput
- type RemoveDesktopUseCase
- 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 SplitDirection
- type SplitPaneInput
- type SplitPaneOutput
- type StartSessionInput
- type StartSessionOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractDomain ¶
ExtractDomain extracts the host from a URL 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 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 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 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 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 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) 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) 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.
func NewManageZoomUseCase ¶
func NewManageZoomUseCase(zoomRepo repository.ZoomRepository, defaultZoom float64) *ManageZoomUseCase
NewManageZoomUseCase creates a new zoom management use case. defaultZoom is the zoom level to use when resetting (typically from config).
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.
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) 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 saves or updates the history entry. 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 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 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 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
}