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 use cases that orchestrate domain logic.
Package usecase contains application use cases that orchestrate domain logic.
Package usecase contains application business logic.
Index ¶
- Constants
- 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 AutocompleteUseCase
- func (uc *AutocompleteUseCase) GetSuggestion(ctx context.Context, input GetSuggestionInput) *GetSuggestionOutput
- func (*AutocompleteUseCase) GetSuggestionForURL(_ context.Context, input, targetURL string) *GetSuggestionOutput
- func (uc *AutocompleteUseCase) ResolveCompletion(ctx context.Context, input string, opts CompletionOptions) *autocomplete.Suggestion
- type BangSuggestion
- type BuildNavigationTextInput
- type BuildNavigationTextOutput
- type CheckConfigMigrationInput
- type CheckConfigMigrationOutput
- 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 CompletionOptions
- type ConsumeOrExpelDirection
- type ConsumeOrExpelResult
- type CopyURLUseCase
- type CreateStackOutput
- type CreateTabInput
- type CreateTabOutput
- type CreateTabWithPaneInput
- type DeleteSessionInput
- type DeleteSessionUseCase
- type DetectBangKeyInput
- type DetectBangKeyOutput
- type DetectChangesInput
- type DetectChangesOutput
- type FilterBangsInput
- type FilterBangsOutput
- 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 GetConfigSchemaInput
- type GetConfigSchemaOutput
- type GetConfigSchemaUseCase
- type GetKeybindingsUseCase
- type GetLastRestorableSessionInput
- type GetLastRestorableSessionOutput
- type GetLastRestorableSessionUseCase
- type GetSuggestionInput
- type GetSuggestionOutput
- type HandlePermissionUseCase
- func (uc *HandlePermissionUseCase) GetManualPermissionDecision(ctx context.Context, origin string, permType entity.PermissionType) (*entity.PermissionRecord, error)
- func (uc *HandlePermissionUseCase) HandlePermissionRequest(ctx context.Context, origin string, permTypes []entity.PermissionType, ...)
- func (uc *HandlePermissionUseCase) QueryPermissionState(ctx context.Context, origin string, permType entity.PermissionType) entity.PermissionDecision
- func (uc *HandlePermissionUseCase) ResetManualPermissionDecision(ctx context.Context, origin string, permType entity.PermissionType) error
- func (uc *HandlePermissionUseCase) SetDialogPresenter(dialog port.PermissionDialogPresenter)
- func (uc *HandlePermissionUseCase) SetManualPermissionDecision(ctx context.Context, origin string, permType entity.PermissionType, ...) error
- type IDGenerator
- type InsertAccentUseCase
- 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) GetAllURLs(ctx context.Context) (map[string]struct{}, 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) Toggle(ctx context.Context, url, title string) (*ToggleResult, 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) ApplyFocusChange(ctx context.Context, ws *entity.Workspace, targetPaneID entity.PaneID) (*entity.PaneNode, 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 MigrateConfigInput
- type MigrateConfigOutput
- type MigrateConfigUseCase
- func (uc *MigrateConfigUseCase) Check(ctx context.Context, _ CheckConfigMigrationInput) (*CheckConfigMigrationOutput, error)
- func (uc *MigrateConfigUseCase) DetectChanges(ctx context.Context, _ DetectChangesInput) (*DetectChangesOutput, error)
- func (uc *MigrateConfigUseCase) Execute(ctx context.Context, _ MigrateConfigInput) (*MigrateConfigOutput, error)
- type MovePaneToTabInput
- type MovePaneToTabOutput
- type MovePaneToTabUseCase
- type NavigateDirection
- type NavigateInput
- type NavigateOutput
- type NavigateUseCase
- func (uc *NavigateUseCase) ClearPaneHistory(paneID string)
- func (uc *NavigateUseCase) Close()
- func (uc *NavigateUseCase) Execute(ctx context.Context, input NavigateInput) (*NavigateOutput, error)
- func (uc *NavigateUseCase) RecordHistory(ctx context.Context, paneID, rawURL 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, historyURL, title string) error
- type PermissionCallback
- type PrepareDownloadInput
- type PrepareDownloadOutput
- type PrepareDownloadUseCase
- type PrepareWebUIThemeInput
- type PrepareWebUIThemeUseCase
- type PurgeDataUseCase
- type PurgeInput
- type PurgeOutput
- type PurgeableSessionsOutput
- type RemoveDesktopOutput
- type RemoveDesktopUseCase
- type ResetAllKeybindingsUseCase
- type ResetKeybindingUseCase
- 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) GetMostVisited(ctx context.Context, days int) ([]*entity.HistoryEntry, error)
- func (uc *SearchHistoryUseCase) GetRecent(ctx context.Context, limit, offset int) ([]*entity.HistoryEntry, error)
- func (uc *SearchHistoryUseCase) GetRecentSince(ctx context.Context, days int) ([]*entity.HistoryEntry, error)
- func (uc *SearchHistoryUseCase) Search(ctx context.Context, input SearchInput) (*SearchOutput, error)
- type SearchInput
- type SearchOutput
- type SearchShortcut
- type SearchShortcutsUseCase
- func (uc *SearchShortcutsUseCase) BuildNavigationText(ctx context.Context, input BuildNavigationTextInput) *BuildNavigationTextOutput
- func (uc *SearchShortcutsUseCase) DetectBangKey(ctx context.Context, input DetectBangKeyInput) *DetectBangKeyOutput
- func (uc *SearchShortcutsUseCase) FilterBangs(ctx context.Context, input FilterBangsInput) *FilterBangsOutput
- func (uc *SearchShortcutsUseCase) GetShortcut(key string) (SearchShortcut, bool)
- func (uc *SearchShortcutsUseCase) ShortcutURLs() map[string]string
- type SetDefaultBrowserUseCase
- type SetDefaultOutput
- type SetKeybindingUseCase
- type SetSplitRatioInput
- type SnapshotInput
- type SnapshotSessionUseCase
- type SplitDirection
- type SplitPaneInput
- type SplitPaneOutput
- type StartSessionInput
- type StartSessionOutput
- type ToggleResult
- type TransformLegacyConfigUseCase
Constants ¶
const LongPressDelay = 400 * time.Millisecond
LongPressDelay is the duration a key must be held to trigger the accent picker.
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 AutocompleteUseCase ¶ added in v0.26.0
type AutocompleteUseCase struct {
// contains filtered or unexported fields
}
AutocompleteUseCase handles inline autocomplete suggestions.
func NewAutocompleteUseCase ¶ added in v0.26.0
func NewAutocompleteUseCase( historyUC *SearchHistoryUseCase, favoritesUC *ManageFavoritesUseCase, shortcutsUC *SearchShortcutsUseCase, ) *AutocompleteUseCase
NewAutocompleteUseCase creates a new autocomplete use case.
func (*AutocompleteUseCase) GetSuggestion ¶ added in v0.26.0
func (uc *AutocompleteUseCase) GetSuggestion(ctx context.Context, input GetSuggestionInput) *GetSuggestionOutput
GetSuggestion returns the best autocomplete suggestion for the given input. Priority: Favorites > History (by frecency) > Bang shortcuts.
func (*AutocompleteUseCase) GetSuggestionForURL ¶ added in v0.26.0
func (*AutocompleteUseCase) GetSuggestionForURL(_ context.Context, input, targetURL string) *GetSuggestionOutput
GetSuggestionForURL returns an autocomplete suggestion specifically for a URL. This is used when the user selects a row from the list to update ghost text.
func (*AutocompleteUseCase) ResolveCompletion ¶ added in v0.26.2
func (uc *AutocompleteUseCase) ResolveCompletion(ctx context.Context, input string, opts CompletionOptions) *autocomplete.Suggestion
ResolveCompletion resolves the best completion using visible list order first, then cached favorites/history as fallback.
type BangSuggestion ¶ added in v0.22.0
BangSuggestion represents a configured bang shortcut for display.
type BuildNavigationTextInput ¶ added in v0.22.0
type BuildNavigationTextInput struct {
}
BuildNavigationTextInput contains parameters for building navigation text.
type BuildNavigationTextOutput ¶ added in v0.22.0
type BuildNavigationTextOutput struct {
}
BuildNavigationTextOutput contains the normalized navigation text.
type CheckConfigMigrationInput ¶ added in v0.22.0
type CheckConfigMigrationInput struct{}
CheckConfigMigrationInput holds the input for checking config migration.
type CheckConfigMigrationOutput ¶ added in v0.22.0
type CheckConfigMigrationOutput struct {
// NeedsMigration is true if there are missing keys.
NeedsMigration bool
// MissingKeys contains info about each missing key.
MissingKeys []port.KeyInfo
// ConfigFile is the path to the config file.
ConfigFile string
}
CheckConfigMigrationOutput holds the result of the migration check.
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 CompletionOptions ¶ added in v0.26.2
CompletionOptions controls how URL completions are resolved.
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 DetectBangKeyInput ¶ added in v0.22.0
type DetectBangKeyInput struct {
Query string // e.g., "!gh query"
}
DetectBangKeyInput contains parameters for detecting a completed bang key.
type DetectBangKeyOutput ¶ added in v0.22.0
type DetectBangKeyOutput struct {
Key string // The matched key (empty if not found)
Description string // Description of the matched shortcut
}
DetectBangKeyOutput contains the detected bang key if found.
type DetectChangesInput ¶ added in v0.22.0
type DetectChangesInput struct{}
DetectChangesInput holds the input for detecting config changes.
type DetectChangesOutput ¶ added in v0.22.0
type DetectChangesOutput struct {
// HasChanges is true if any changes were detected.
HasChanges bool
// Changes contains all detected changes.
Changes []port.KeyChange
// DiffText is a formatted diff-like string representation.
DiffText string
}
DetectChangesOutput holds the result of change detection.
type FilterBangsInput ¶ added in v0.22.0
type FilterBangsInput struct {
Query string // e.g., "!" or "!g" or "!g query"
}
FilterBangsInput contains parameters for filtering bang suggestions.
type FilterBangsOutput ¶ added in v0.22.0
type FilterBangsOutput struct {
Suggestions []BangSuggestion
}
FilterBangsOutput contains filtered bang suggestions.
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 GetConfigSchemaInput ¶ added in v0.22.0
type GetConfigSchemaInput struct {
}
GetConfigSchemaInput contains input parameters for schema retrieval.
type GetConfigSchemaOutput ¶ added in v0.22.0
type GetConfigSchemaOutput struct {
Keys []entity.ConfigKeyInfo
}
GetConfigSchemaOutput contains the schema information.
type GetConfigSchemaUseCase ¶ added in v0.22.0
type GetConfigSchemaUseCase struct {
// contains filtered or unexported fields
}
GetConfigSchemaUseCase retrieves configuration schema information.
func NewGetConfigSchemaUseCase ¶ added in v0.22.0
func NewGetConfigSchemaUseCase(provider port.ConfigSchemaProvider) *GetConfigSchemaUseCase
NewGetConfigSchemaUseCase creates a new GetConfigSchemaUseCase.
func (*GetConfigSchemaUseCase) Execute ¶ added in v0.22.0
func (uc *GetConfigSchemaUseCase) Execute(_ context.Context, _ GetConfigSchemaInput) (*GetConfigSchemaOutput, error)
Execute retrieves all configuration keys with their metadata.
type GetKeybindingsUseCase ¶ added in v0.26.0
type GetKeybindingsUseCase struct {
// contains filtered or unexported fields
}
GetKeybindingsUseCase retrieves all keybindings.
func NewGetKeybindingsUseCase ¶ added in v0.26.0
func NewGetKeybindingsUseCase(provider port.KeybindingsProvider) *GetKeybindingsUseCase
NewGetKeybindingsUseCase creates a new GetKeybindingsUseCase.
func (*GetKeybindingsUseCase) Execute ¶ added in v0.26.0
func (uc *GetKeybindingsUseCase) Execute(ctx context.Context) (port.KeybindingsConfig, error)
Execute retrieves all keybindings.
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 GetSuggestionInput ¶ added in v0.26.0
type GetSuggestionInput struct {
Input string // Current user input
}
GetSuggestionInput contains parameters for getting an autocomplete suggestion.
type GetSuggestionOutput ¶ added in v0.26.0
type GetSuggestionOutput struct {
Suggestion *autocomplete.Suggestion
Found bool
}
GetSuggestionOutput contains the best autocomplete suggestion.
type HandlePermissionUseCase ¶ added in v0.27.0
type HandlePermissionUseCase struct {
// contains filtered or unexported fields
}
HandlePermissionUseCase handles media permission requests from WebKit. It implements the permission strategy defined in the architecture: - Display capture: auto-allow (XDG portal handles UI) - Device enumeration: auto-allow (low risk) - Mic/Camera: check stored → dialog → persist if "Always"
func NewHandlePermissionUseCase ¶ added in v0.27.0
func NewHandlePermissionUseCase( permRepo port.PermissionRepository, dialog port.PermissionDialogPresenter, loggerFromContext port.LoggerFromContext, ) *HandlePermissionUseCase
NewHandlePermissionUseCase creates a new permission handling use case.
func (*HandlePermissionUseCase) GetManualPermissionDecision ¶ added in v0.27.0
func (uc *HandlePermissionUseCase) GetManualPermissionDecision( ctx context.Context, origin string, permType entity.PermissionType, ) (*entity.PermissionRecord, error)
GetManualPermissionDecision returns the stored decision (if any) for origin/type.
func (*HandlePermissionUseCase) HandlePermissionRequest ¶ added in v0.27.0
func (uc *HandlePermissionUseCase) HandlePermissionRequest( ctx context.Context, origin string, permTypes []entity.PermissionType, callback PermissionCallback, )
HandlePermissionRequest processes a permission request from WebKit. This is the main entry point for the permission use case.
Parameters:
- ctx: context for cancellation and logging
- origin: the website origin (URI) requesting permission
- permTypes: the types of permissions being requested
- callback: callbacks to allow or deny the request (must call one)
func (*HandlePermissionUseCase) QueryPermissionState ¶ added in v0.27.0
func (uc *HandlePermissionUseCase) QueryPermissionState( ctx context.Context, origin string, permType entity.PermissionType, ) entity.PermissionDecision
QueryPermissionState returns the current permission state for the W3C Permissions API. This is used by websites to check if they already have permission before calling getUserMedia().
func (*HandlePermissionUseCase) ResetManualPermissionDecision ¶ added in v0.27.0
func (uc *HandlePermissionUseCase) ResetManualPermissionDecision( ctx context.Context, origin string, permType entity.PermissionType, ) error
ResetManualPermissionDecision clears any stored decision for origin/type.
func (*HandlePermissionUseCase) SetDialogPresenter ¶ added in v0.27.0
func (uc *HandlePermissionUseCase) SetDialogPresenter(dialog port.PermissionDialogPresenter)
SetDialogPresenter sets the dialog presenter. This can be called after initialization when the UI window is available.
func (*HandlePermissionUseCase) SetManualPermissionDecision ¶ added in v0.27.0
func (uc *HandlePermissionUseCase) SetManualPermissionDecision( ctx context.Context, origin string, permType entity.PermissionType, decision entity.PermissionDecision, ) error
SetManualPermissionDecision stores an explicit decision for origin/type. This is used by the UI permission indicator as the source of truth for lock state.
type IDGenerator ¶
type IDGenerator func() string
IDGenerator is a function type for generating unique IDs.
type InsertAccentUseCase ¶ added in v0.23.0
type InsertAccentUseCase struct {
// contains filtered or unexported fields
}
InsertAccentUseCase handles long-press detection and accent selection. When a key with accent variants is held for 400ms, it shows an accent picker and inserts the selected accent into the focused text input.
func NewInsertAccentUseCase ¶ added in v0.23.0
func NewInsertAccentUseCase( focusProvider port.FocusedInputProvider, accentPicker port.AccentPickerUI, showOnMainThread func(fn func()), ) *InsertAccentUseCase
NewInsertAccentUseCase creates a new accent insertion use case. showOnMainThread is a callback that runs a function on the GTK main thread (typically using glib.IdleAdd). This is required because the timer fires on a background goroutine.
func (*InsertAccentUseCase) Cancel ¶ added in v0.23.0
func (uc *InsertAccentUseCase) Cancel(ctx context.Context)
Cancel cancels any pending long-press detection and hides the picker.
func (*InsertAccentUseCase) IsPickerVisible ¶ added in v0.23.0
func (uc *InsertAccentUseCase) IsPickerVisible() bool
IsPickerVisible returns true if the accent picker is currently visible.
func (*InsertAccentUseCase) OnKeyPressed ¶ added in v0.23.0
OnKeyPressed handles a key press event. Returns true if the use case is handling this key and the caller should suppress it. Note: Due to WebKit's input handling, key suppression may not be fully effective. When the picker shows, we delete any repeated characters that slipped through.
func (*InsertAccentUseCase) OnKeyReleased ¶ added in v0.23.0
func (uc *InsertAccentUseCase) OnKeyReleased(ctx context.Context, char rune)
OnKeyReleased handles a key release event. This cancels any pending long-press detection.
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) GetAllURLs ¶ added in v0.22.0
func (uc *ManageFavoritesUseCase) GetAllURLs(ctx context.Context) (map[string]struct{}, error)
GetAllURLs returns a set of all favorited URLs for efficient batch lookup.
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) Toggle ¶ added in v0.22.0
func (uc *ManageFavoritesUseCase) Toggle(ctx context.Context, url, title string) (*ToggleResult, error)
Toggle adds or removes a URL from favorites based on current state. If the URL is already a favorite, it removes it. Otherwise, it adds it.
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) ApplyFocusChange ¶ added in v0.24.0
func (uc *ManagePanesUseCase) ApplyFocusChange( ctx context.Context, ws *entity.Workspace, targetPaneID entity.PaneID, ) (*entity.PaneNode, error)
ApplyFocusChange sets the active pane and updates the stack index if the target pane is in a stack. This is the canonical way to change focus to a pane, ensuring stack state is kept in sync.
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. For stacked panes, removes the pane from the stack via RemoveFromStack.
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. Delegates to ApplyFocusChange to ensure stack index is updated when focusing a stacked pane.
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 active pane rectangle
- Filter candidates that are in the direction (dx < 0 for Left, etc.)
- Prioritize panes with perpendicular overlap (same row for left/right, same column for up/down)
- Score by: overlap_penalty + 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 MigrateConfigInput ¶ added in v0.22.0
type MigrateConfigInput struct{}
MigrateConfigInput holds the input for migrating config.
type MigrateConfigOutput ¶ added in v0.22.0
type MigrateConfigOutput struct {
// AddedKeys contains the keys that were added.
AddedKeys []string
// ConfigFile is the path to the config file.
ConfigFile string
}
MigrateConfigOutput holds the result of the migration.
type MigrateConfigUseCase ¶ added in v0.22.0
type MigrateConfigUseCase struct {
// contains filtered or unexported fields
}
MigrateConfigUseCase handles config migration operations.
func NewMigrateConfigUseCase ¶ added in v0.22.0
func NewMigrateConfigUseCase(migrator port.ConfigMigrator, diffFormatter port.DiffFormatter) *MigrateConfigUseCase
NewMigrateConfigUseCase creates a new migrate config use case.
func (*MigrateConfigUseCase) Check ¶ added in v0.22.0
func (uc *MigrateConfigUseCase) Check(ctx context.Context, _ CheckConfigMigrationInput) (*CheckConfigMigrationOutput, error)
Check checks if the user config is missing any default keys.
func (*MigrateConfigUseCase) DetectChanges ¶ added in v0.22.0
func (uc *MigrateConfigUseCase) DetectChanges(ctx context.Context, _ DetectChangesInput) (*DetectChangesOutput, error)
DetectChanges detects all config changes and returns a diff-like output.
func (*MigrateConfigUseCase) Execute ¶ added in v0.22.0
func (uc *MigrateConfigUseCase) Execute(ctx context.Context, _ MigrateConfigInput) (*MigrateConfigOutput, error)
Execute adds missing default keys and removes deprecated keys from the user's config file.
type MovePaneToTabInput ¶ added in v0.22.0
type MovePaneToTabOutput ¶ added in v0.22.0
type MovePaneToTabUseCase ¶ added in v0.22.0
type MovePaneToTabUseCase struct {
// contains filtered or unexported fields
}
MovePaneToTabUseCase moves a pane from one tab's workspace to another.
It is pure domain manipulation: it depends only on entities and an ID generator.
func NewMovePaneToTabUseCase ¶ added in v0.22.0
func NewMovePaneToTabUseCase(idGenerator IDGenerator) *MovePaneToTabUseCase
func (*MovePaneToTabUseCase) Execute ¶ added in v0.22.0
func (uc *MovePaneToTabUseCase) Execute(input MovePaneToTabInput) (*MovePaneToTabOutput, error)
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) ClearPaneHistory ¶ added in v0.27.0
func (uc *NavigateUseCase) ClearPaneHistory(paneID string)
ClearPaneHistory removes per-pane deduplication state to prevent unbounded growth. Callers should invoke this when a pane is closed.
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, paneID, rawURL 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, historyURL, title string) error
UpdateHistoryTitle updates the title of a history entry after page load.
type PermissionCallback ¶ added in v0.27.0
type PermissionCallback struct {
Allow func()
Deny func()
}
PermissionCallback provides allow/deny functions for the permission request.
type PrepareDownloadInput ¶ added in v0.26.0
type PrepareDownloadInput struct {
// SuggestedFilename is the filename suggested by WebKit (from Content-Disposition or other sources).
SuggestedFilename string
// Response provides additional metadata (MIME type, URI) for filename resolution.
// May be nil if not available.
Response port.DownloadResponse
// DownloadDir is the directory where downloads should be saved.
DownloadDir string
}
PrepareDownloadInput contains the inputs for preparing a download destination.
type PrepareDownloadOutput ¶ added in v0.26.0
type PrepareDownloadOutput struct {
// Filename is the sanitized, safe filename to use.
Filename string
// DestinationPath is the full path where the download should be saved.
DestinationPath string
}
PrepareDownloadOutput contains the resolved download destination.
type PrepareDownloadUseCase ¶ added in v0.26.0
type PrepareDownloadUseCase struct {
// contains filtered or unexported fields
}
PrepareDownloadUseCase orchestrates filename resolution for downloads. It combines multiple sources (suggested name, response headers, URI) to determine the best filename, then sanitizes it to prevent path traversal.
func NewPrepareDownloadUseCase ¶ added in v0.26.0
func NewPrepareDownloadUseCase(fs port.FileSystem) *PrepareDownloadUseCase
NewPrepareDownloadUseCase creates a new PrepareDownloadUseCase. If fs is nil, filename deduplication is disabled.
func (*PrepareDownloadUseCase) Execute ¶ added in v0.26.0
func (u *PrepareDownloadUseCase) Execute(ctx context.Context, input PrepareDownloadInput) *PrepareDownloadOutput
Execute resolves the download filename and destination path.
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 ResetAllKeybindingsUseCase ¶ added in v0.26.0
type ResetAllKeybindingsUseCase struct {
// contains filtered or unexported fields
}
ResetAllKeybindingsUseCase resets all keybindings to defaults.
func NewResetAllKeybindingsUseCase ¶ added in v0.26.0
func NewResetAllKeybindingsUseCase(saver port.KeybindingsSaver) *ResetAllKeybindingsUseCase
NewResetAllKeybindingsUseCase creates a new ResetAllKeybindingsUseCase.
type ResetKeybindingUseCase ¶ added in v0.26.0
type ResetKeybindingUseCase struct {
// contains filtered or unexported fields
}
ResetKeybindingUseCase resets a keybinding to default.
func NewResetKeybindingUseCase ¶ added in v0.26.0
func NewResetKeybindingUseCase(saver port.KeybindingsSaver) *ResetKeybindingUseCase
NewResetKeybindingUseCase creates a new ResetKeybindingUseCase.
func (*ResetKeybindingUseCase) Execute ¶ added in v0.26.0
func (uc *ResetKeybindingUseCase) Execute(ctx context.Context, req port.ResetKeybindingRequest) error
Execute resets a keybinding to default.
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) GetMostVisited ¶ added in v0.23.0
func (uc *SearchHistoryUseCase) GetMostVisited(ctx context.Context, days int) ([]*entity.HistoryEntry, error)
GetMostVisited retrieves history entries sorted by visit count within the last N days. If days is 0, returns all history entries sorted by visit count. If days is negative, defaults to 30 days.
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) GetRecentSince ¶ added in v0.23.0
func (uc *SearchHistoryUseCase) GetRecentSince(ctx context.Context, days int) ([]*entity.HistoryEntry, error)
GetRecentSince retrieves history entries visited within the last N days. If days is 0, returns all history entries. If days is negative, defaults to 30 days.
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 SearchShortcut ¶ added in v0.22.0
SearchShortcut represents a search shortcut configuration. This is a domain-level type to avoid depending on infrastructure config.
type SearchShortcutsUseCase ¶ added in v0.22.0
type SearchShortcutsUseCase struct {
// contains filtered or unexported fields
}
SearchShortcutsUseCase handles bang shortcut filtering and resolution.
func NewSearchShortcutsUseCase ¶ added in v0.22.0
func NewSearchShortcutsUseCase(shortcuts map[string]SearchShortcut) *SearchShortcutsUseCase
NewSearchShortcutsUseCase creates a new search shortcuts use case.
func (*SearchShortcutsUseCase) BuildNavigationText ¶ added in v0.22.0
func (uc *SearchShortcutsUseCase) BuildNavigationText(ctx context.Context, input BuildNavigationTextInput) *BuildNavigationTextOutput
BuildNavigationText normalizes a bang query for navigation. Returns the normalized text with the canonical key case.
func (*SearchShortcutsUseCase) DetectBangKey ¶ added in v0.22.0
func (uc *SearchShortcutsUseCase) DetectBangKey(ctx context.Context, input DetectBangKeyInput) *DetectBangKeyOutput
DetectBangKey checks if the query contains a valid, completed bang key. A completed bang key requires "!<key> " with a space after the key.
func (*SearchShortcutsUseCase) FilterBangs ¶ added in v0.22.0
func (uc *SearchShortcutsUseCase) FilterBangs(ctx context.Context, input FilterBangsInput) *FilterBangsOutput
FilterBangs returns bang shortcuts matching the query prefix. Query should start with "!". The prefix is extracted before any space.
func (*SearchShortcutsUseCase) GetShortcut ¶ added in v0.22.0
func (uc *SearchShortcutsUseCase) GetShortcut(key string) (SearchShortcut, bool)
GetShortcut returns a shortcut by key (case-insensitive).
func (*SearchShortcutsUseCase) ShortcutURLs ¶ added in v0.22.0
func (uc *SearchShortcutsUseCase) ShortcutURLs() map[string]string
ShortcutURLs returns a map of shortcut keys to URL templates. This is useful for passing to url.BuildSearchURL.
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 SetKeybindingUseCase ¶ added in v0.26.0
type SetKeybindingUseCase struct {
// contains filtered or unexported fields
}
SetKeybindingUseCase updates a single keybinding.
func NewSetKeybindingUseCase ¶ added in v0.26.0
func NewSetKeybindingUseCase(provider port.KeybindingsProvider, saver port.KeybindingsSaver) *SetKeybindingUseCase
NewSetKeybindingUseCase creates a new SetKeybindingUseCase.
func (*SetKeybindingUseCase) Execute ¶ added in v0.26.0
func (uc *SetKeybindingUseCase) Execute(ctx context.Context, req port.SetKeybindingRequest) (port.SetKeybindingResponse, error)
Execute updates a keybinding and returns any conflicts.
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
}
type StartSessionOutput ¶
type ToggleResult ¶ added in v0.22.0
type ToggleResult struct {
Added bool // true if favorite was added, false if removed
URL string
Title string
Message string // User-friendly message
}
ToggleResult indicates the result of a toggle operation.
type TransformLegacyConfigUseCase ¶ added in v0.26.0
type TransformLegacyConfigUseCase struct {
// contains filtered or unexported fields
}
TransformLegacyConfigUseCase handles legacy config format transformation.
func NewTransformLegacyConfigUseCase ¶ added in v0.26.0
func NewTransformLegacyConfigUseCase(transformer port.ConfigTransformer) *TransformLegacyConfigUseCase
NewTransformLegacyConfigUseCase creates a new use case instance.
func (*TransformLegacyConfigUseCase) Execute ¶ added in v0.26.0
func (uc *TransformLegacyConfigUseCase) Execute(rawConfig map[string]any)
Execute transforms legacy config format in place.
Source Files
¶
- apply_update.go
- autocomplete.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_config_schema.go
- get_last_restorable_session.go
- handle_permission.go
- insert_accent.go
- keybindings.go
- list_sessions.go
- manage_favorites.go
- manage_panes.go
- manage_session.go
- manage_tabs.go
- manage_zoom.go
- migrate_config.go
- move_pane_to_tab.go
- navigate.go
- prepare_download.go
- prepare_webui_theme.go
- purge_data.go
- restore_session.go
- run_media_diagnostics.go
- save_webui_config.go
- search_history.go
- search_shortcuts.go
- session_lock.go
- setup_desktop.go
- snapshot_session.go
- transform_legacy_config.go