Documentation
¶
Index ¶
- type NavigationCoordinator
- func (c *NavigationCoordinator) ActiveWebView(ctx context.Context) port.WebView
- func (c *NavigationCoordinator) ClearPaneHistory(paneID entity.PaneID)
- func (c *NavigationCoordinator) GoBack(ctx context.Context) error
- func (c *NavigationCoordinator) GoForward(ctx context.Context) error
- func (c *NavigationCoordinator) HardReload(ctx context.Context) error
- func (c *NavigationCoordinator) Navigate(ctx context.Context, url string) error
- func (c *NavigationCoordinator) NotifyZoomChanged(ctx context.Context, factor float64)
- func (c *NavigationCoordinator) OpenDevTools(ctx context.Context) error
- func (c *NavigationCoordinator) OpenOmnibox(ctx context.Context) error
- func (c *NavigationCoordinator) PrintPage(ctx context.Context) error
- func (c *NavigationCoordinator) RecordHistory(ctx context.Context, paneID entity.PaneID, url string)
- func (c *NavigationCoordinator) Reload(ctx context.Context) error
- func (c *NavigationCoordinator) SetOmniboxProvider(provider OmniboxProvider)
- func (c *NavigationCoordinator) UpdateHistoryTitle(ctx context.Context, paneID entity.PaneID, url, title string)
- type OmniboxProvider
- type TabCoordinator
- func (c *TabCoordinator) Close(ctx context.Context) error
- func (c *TabCoordinator) Create(ctx context.Context, initialURL string) (*entity.Tab, error)
- func (c *TabCoordinator) CreateWithPane(ctx context.Context, pane *entity.Pane, wv port.WebView, initialURL string) (*entity.Tab, error)
- func (c *TabCoordinator) GetTabBar() *component.TabBar
- func (c *TabCoordinator) SetOnAttachPopupToTab(...)
- func (c *TabCoordinator) SetOnQuit(fn func())
- func (c *TabCoordinator) SetOnStateChanged(fn func())
- func (c *TabCoordinator) SetOnTabCreated(fn func(ctx context.Context, tab *entity.Tab))
- func (c *TabCoordinator) SetOnTabSwitched(fn func(ctx context.Context, tab *entity.Tab))
- func (c *TabCoordinator) Switch(ctx context.Context, tabID entity.TabID) error
- func (c *TabCoordinator) SwitchByIndex(ctx context.Context, index int) error
- func (c *TabCoordinator) SwitchNext(ctx context.Context) error
- func (c *TabCoordinator) SwitchPrev(ctx context.Context) error
- func (c *TabCoordinator) SwitchToLastActive(ctx context.Context) error
- func (c *TabCoordinator) UpdateBarVisibility(ctx context.Context)
- type TabCoordinatorConfig
- type UpdateCoordinator
- func (c *UpdateCoordinator) CheckOnStartup(ctx context.Context)
- func (c *UpdateCoordinator) FinalizeOnExit(ctx context.Context) error
- func (c *UpdateCoordinator) HasPendingUpdate(ctx context.Context) bool
- func (c *UpdateCoordinator) LastCheckResult() *usecase.CheckUpdateOutput
- func (c *UpdateCoordinator) Status() entity.UpdateStatus
- type WorkspaceCoordinator
- func (c *WorkspaceCoordinator) ClosePane(ctx context.Context) error
- func (c *WorkspaceCoordinator) ClosePaneByID(ctx context.Context, paneID entity.PaneID) error
- func (c *WorkspaceCoordinator) ConsumeOrExpelPane(ctx context.Context, direction usecase.ConsumeOrExpelDirection) error
- func (c *WorkspaceCoordinator) FocusPane(ctx context.Context, direction usecase.NavigateDirection) error
- func (c *WorkspaceCoordinator) InsertPopup(ctx context.Context, input content.InsertPopupInput) error
- func (c *WorkspaceCoordinator) NavigateStack(ctx context.Context, direction string) error
- func (c *WorkspaceCoordinator) Resize(ctx context.Context, dir usecase.ResizeDirection) error
- func (c *WorkspaceCoordinator) SetOnCloseLastPane(fn func(ctx context.Context) error)
- func (c *WorkspaceCoordinator) SetOnCreatePopupTab(fn func(ctx context.Context, input content.InsertPopupInput) error)
- func (c *WorkspaceCoordinator) SetOnPaneClosed(fn func(paneID entity.PaneID))
- func (c *WorkspaceCoordinator) SetOnStateChanged(fn func())
- func (c *WorkspaceCoordinator) SetSplitRatio(ctx context.Context, splitNodeID string, ratio float64) error
- func (c *WorkspaceCoordinator) SetupStackedPaneCallbacks(ctx context.Context, ws *entity.Workspace, wsView *component.WorkspaceView)
- func (c *WorkspaceCoordinator) ShowToastOnActivePane(ctx context.Context, message string, level component.ToastLevel)
- func (c *WorkspaceCoordinator) ShowZoomToast(ctx context.Context, zoomPercent int)
- func (c *WorkspaceCoordinator) Split(ctx context.Context, direction usecase.SplitDirection) error
- func (c *WorkspaceCoordinator) StackPane(ctx context.Context) error
- type WorkspaceCoordinatorConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NavigationCoordinator ¶
type NavigationCoordinator struct {
// contains filtered or unexported fields
}
NavigationCoordinator handles URL navigation, history, and browser controls.
func NewNavigationCoordinator ¶
func NewNavigationCoordinator( ctx context.Context, navigateUC *usecase.NavigateUseCase, contentCoord *content.Coordinator, ) *NavigationCoordinator
NewNavigationCoordinator creates a new NavigationCoordinator.
func (*NavigationCoordinator) ActiveWebView ¶
func (c *NavigationCoordinator) ActiveWebView(ctx context.Context) port.WebView
ActiveWebView returns the WebView for the active pane (for zoom operations).
func (*NavigationCoordinator) ClearPaneHistory ¶ added in v0.27.0
func (c *NavigationCoordinator) ClearPaneHistory(paneID entity.PaneID)
ClearPaneHistory clears per-pane navigation history deduplication state.
func (*NavigationCoordinator) GoBack ¶
func (c *NavigationCoordinator) GoBack(ctx context.Context) error
GoBack navigates back in history. Calls webview directly - the webview layer handles SPA navigation via JS fallback.
func (*NavigationCoordinator) GoForward ¶
func (c *NavigationCoordinator) GoForward(ctx context.Context) error
GoForward navigates forward in history. Calls webview directly - the webview layer handles SPA navigation via JS fallback.
func (*NavigationCoordinator) HardReload ¶
func (c *NavigationCoordinator) HardReload(ctx context.Context) error
HardReload reloads the current page bypassing cache.
func (*NavigationCoordinator) Navigate ¶
func (c *NavigationCoordinator) Navigate(ctx context.Context, url string) error
Navigate loads a URL in the active pane using NavigateUseCase. This properly handles history recording and zoom application.
func (*NavigationCoordinator) NotifyZoomChanged ¶
func (c *NavigationCoordinator) NotifyZoomChanged(ctx context.Context, factor float64)
NotifyZoomChanged updates the omnibox zoom indicator.
func (*NavigationCoordinator) OpenDevTools ¶
func (c *NavigationCoordinator) OpenDevTools(ctx context.Context) error
OpenDevTools opens the WebKit inspector for the active WebView.
func (*NavigationCoordinator) OpenOmnibox ¶
func (c *NavigationCoordinator) OpenOmnibox(ctx context.Context) error
OpenOmnibox toggles the omnibox visibility.
func (*NavigationCoordinator) PrintPage ¶ added in v0.25.0
func (c *NavigationCoordinator) PrintPage(ctx context.Context) error
PrintPage opens the print dialog for the active WebView.
func (*NavigationCoordinator) RecordHistory ¶
func (c *NavigationCoordinator) RecordHistory(ctx context.Context, paneID entity.PaneID, url string)
RecordHistory records a URL in history on page commit.
func (*NavigationCoordinator) Reload ¶
func (c *NavigationCoordinator) Reload(ctx context.Context) error
Reload reloads the current page.
func (*NavigationCoordinator) SetOmniboxProvider ¶
func (c *NavigationCoordinator) SetOmniboxProvider(provider OmniboxProvider)
SetOmniboxProvider sets the omnibox provider for toggle/zoom operations.
func (*NavigationCoordinator) UpdateHistoryTitle ¶
func (c *NavigationCoordinator) UpdateHistoryTitle(ctx context.Context, paneID entity.PaneID, url, title string)
UpdateHistoryTitle updates the title of a history entry after page load.
type OmniboxProvider ¶
type OmniboxProvider interface {
ToggleOmnibox(ctx context.Context)
UpdateOmniboxZoom(factor float64)
}
OmniboxProvider provides access to omnibox operations.
type TabCoordinator ¶
type TabCoordinator struct {
// contains filtered or unexported fields
}
TabCoordinator manages tab lifecycle operations.
func NewTabCoordinator ¶
func NewTabCoordinator(ctx context.Context, cfg TabCoordinatorConfig) *TabCoordinator
NewTabCoordinator creates a new TabCoordinator.
func (*TabCoordinator) Close ¶
func (c *TabCoordinator) Close(ctx context.Context) error
Close closes the active tab.
func (*TabCoordinator) CreateWithPane ¶
func (c *TabCoordinator) CreateWithPane( ctx context.Context, pane *entity.Pane, wv port.WebView, initialURL string, ) (*entity.Tab, error)
CreateWithPane creates a new tab with a pre-created pane and WebView. This is used for tabbed popup behavior where the popup pane already exists.
func (*TabCoordinator) GetTabBar ¶
func (c *TabCoordinator) GetTabBar() *component.TabBar
GetTabBar returns the tab bar component.
func (*TabCoordinator) SetOnAttachPopupToTab ¶
func (c *TabCoordinator) SetOnAttachPopupToTab(fn func(ctx context.Context, tabID entity.TabID, pane *entity.Pane, wv port.WebView))
SetOnAttachPopupToTab sets the callback for attaching popup WebViews to tabs.
func (*TabCoordinator) SetOnQuit ¶
func (c *TabCoordinator) SetOnQuit(fn func())
SetOnQuit sets the callback for when the last tab is closed.
func (*TabCoordinator) SetOnStateChanged ¶ added in v0.21.0
func (c *TabCoordinator) SetOnStateChanged(fn func())
SetOnStateChanged sets the callback for when tab state changes (for session snapshots).
func (*TabCoordinator) SetOnTabCreated ¶
func (c *TabCoordinator) SetOnTabCreated(fn func(ctx context.Context, tab *entity.Tab))
SetOnTabCreated sets the callback for when a tab is created.
func (*TabCoordinator) SetOnTabSwitched ¶
func (c *TabCoordinator) SetOnTabSwitched(fn func(ctx context.Context, tab *entity.Tab))
SetOnTabSwitched sets the callback for when a tab switch occurs. This is used to swap workspace views in the content area.
func (*TabCoordinator) SwitchByIndex ¶
func (c *TabCoordinator) SwitchByIndex(ctx context.Context, index int) error
SwitchByIndex switches to a tab by 0-based index.
func (*TabCoordinator) SwitchNext ¶
func (c *TabCoordinator) SwitchNext(ctx context.Context) error
SwitchNext switches to the next tab.
func (*TabCoordinator) SwitchPrev ¶
func (c *TabCoordinator) SwitchPrev(ctx context.Context) error
SwitchPrev switches to the previous tab.
func (*TabCoordinator) SwitchToLastActive ¶
func (c *TabCoordinator) SwitchToLastActive(ctx context.Context) error
SwitchToLastActive switches to the previously active tab (Alt+Tab style).
func (*TabCoordinator) UpdateBarVisibility ¶
func (c *TabCoordinator) UpdateBarVisibility(ctx context.Context)
UpdateBarVisibility shows or hides the tab bar based on tab count.
type TabCoordinatorConfig ¶
type TabCoordinatorConfig struct {
TabsUC *usecase.ManageTabsUseCase
Tabs *entity.TabList
MainWindow *window.MainWindow
HideTabBarWhenSingleTab bool
}
TabCoordinatorConfig holds configuration for TabCoordinator.
type UpdateCoordinator ¶ added in v0.21.0
type UpdateCoordinator struct {
// contains filtered or unexported fields
}
UpdateCoordinator handles update checking and notification.
func NewUpdateCoordinator ¶ added in v0.21.0
func NewUpdateCoordinator( checkUC *usecase.CheckUpdateUseCase, applyUC *usecase.ApplyUpdateUseCase, toaster *component.Toaster, enableOnStartup bool, autoDownload bool, ) *UpdateCoordinator
NewUpdateCoordinator creates a new update coordinator. enableOnStartup controls whether an update check runs at startup. autoDownload controls whether updates are downloaded automatically in the background.
func (*UpdateCoordinator) CheckOnStartup ¶ added in v0.21.0
func (c *UpdateCoordinator) CheckOnStartup(ctx context.Context)
CheckOnStartup triggers an update check if enabled via the enableOnStartup constructor flag.
func (*UpdateCoordinator) FinalizeOnExit ¶ added in v0.21.0
func (c *UpdateCoordinator) FinalizeOnExit(ctx context.Context) error
FinalizeOnExit applies a staged update on process exit.
func (*UpdateCoordinator) HasPendingUpdate ¶ added in v0.21.0
func (c *UpdateCoordinator) HasPendingUpdate(ctx context.Context) bool
HasPendingUpdate returns true if a downloaded update is waiting to be applied.
func (*UpdateCoordinator) LastCheckResult ¶ added in v0.21.0
func (c *UpdateCoordinator) LastCheckResult() *usecase.CheckUpdateOutput
LastCheckResult returns the most recent update check result.
func (*UpdateCoordinator) Status ¶ added in v0.21.0
func (c *UpdateCoordinator) Status() entity.UpdateStatus
Status returns the current update status.
type WorkspaceCoordinator ¶
type WorkspaceCoordinator struct {
// contains filtered or unexported fields
}
WorkspaceCoordinator manages pane operations within a workspace.
func NewWorkspaceCoordinator ¶
func NewWorkspaceCoordinator(ctx context.Context, cfg WorkspaceCoordinatorConfig) *WorkspaceCoordinator
NewWorkspaceCoordinator creates a new WorkspaceCoordinator.
func (*WorkspaceCoordinator) ClosePane ¶
func (c *WorkspaceCoordinator) ClosePane(ctx context.Context) error
ClosePane closes the active pane.
func (*WorkspaceCoordinator) ClosePaneByID ¶
ClosePaneByID closes a specific pane by ID. This is used for closing popup panes when window.close() is called.
func (*WorkspaceCoordinator) ConsumeOrExpelPane ¶ added in v0.21.0
func (c *WorkspaceCoordinator) ConsumeOrExpelPane(ctx context.Context, direction usecase.ConsumeOrExpelDirection) error
func (*WorkspaceCoordinator) FocusPane ¶
func (c *WorkspaceCoordinator) FocusPane(ctx context.Context, direction usecase.NavigateDirection) error
FocusPane navigates focus to an adjacent pane.
func (*WorkspaceCoordinator) InsertPopup ¶
func (c *WorkspaceCoordinator) InsertPopup(ctx context.Context, input content.InsertPopupInput) error
InsertPopup inserts a popup pane into the workspace based on the specified behavior. Supports split, stacked, and tabbed behaviors.
func (*WorkspaceCoordinator) NavigateStack ¶
func (c *WorkspaceCoordinator) NavigateStack(ctx context.Context, direction string) error
NavigateStack navigates up or down within a stacked pane container.
func (*WorkspaceCoordinator) Resize ¶ added in v0.21.0
func (c *WorkspaceCoordinator) Resize(ctx context.Context, dir usecase.ResizeDirection) error
Resize updates the active split ratio and applies it to GTK widgets.
func (*WorkspaceCoordinator) SetOnCloseLastPane ¶
func (c *WorkspaceCoordinator) SetOnCloseLastPane(fn func(ctx context.Context) error)
SetOnCloseLastPane sets the callback for when the last pane is closed.
func (*WorkspaceCoordinator) SetOnCreatePopupTab ¶
func (c *WorkspaceCoordinator) SetOnCreatePopupTab(fn func(ctx context.Context, input content.InsertPopupInput) error)
SetOnCreatePopupTab sets the callback for creating popup tabs. This is used when popup behavior is "tabbed".
func (*WorkspaceCoordinator) SetOnPaneClosed ¶ added in v0.27.0
func (c *WorkspaceCoordinator) SetOnPaneClosed(fn func(paneID entity.PaneID))
SetOnPaneClosed sets a callback invoked after a pane is successfully closed.
func (*WorkspaceCoordinator) SetOnStateChanged ¶ added in v0.21.0
func (c *WorkspaceCoordinator) SetOnStateChanged(fn func())
SetOnStateChanged sets the callback for when workspace state changes (for session snapshots).
func (*WorkspaceCoordinator) SetSplitRatio ¶ added in v0.21.0
func (*WorkspaceCoordinator) SetupStackedPaneCallbacks ¶ added in v0.25.0
func (c *WorkspaceCoordinator) SetupStackedPaneCallbacks(ctx context.Context, ws *entity.Workspace, wsView *component.WorkspaceView)
SetupStackedPaneCallbacks sets up title bar click and close callbacks for all stacked panes. This must be called after Rebuild() to restore callbacks on newly created StackedView instances.
func (*WorkspaceCoordinator) ShowToastOnActivePane ¶
func (c *WorkspaceCoordinator) ShowToastOnActivePane(ctx context.Context, message string, level component.ToastLevel)
ShowToastOnActivePane displays a toast notification on the active pane.
func (*WorkspaceCoordinator) ShowZoomToast ¶
func (c *WorkspaceCoordinator) ShowZoomToast(ctx context.Context, zoomPercent int)
ShowZoomToast displays a zoom level toast on the active pane.
func (*WorkspaceCoordinator) Split ¶
func (c *WorkspaceCoordinator) Split(ctx context.Context, direction usecase.SplitDirection) error
Split splits the active pane in the given direction.
type WorkspaceCoordinatorConfig ¶
type WorkspaceCoordinatorConfig struct {
PanesUC *usecase.ManagePanesUseCase
FocusMgr *focus.Manager
StackedPaneMgr *component.StackedPaneManager
WidgetFactory layout.WidgetFactory
ContentCoord *content.Coordinator
GetActiveWS func() (*entity.Workspace, *component.WorkspaceView)
GenerateID func() string
NewPaneURL string
ResizeStepPercent float64
ResizeMinPanePercent float64
}
WorkspaceCoordinatorConfig holds configuration for WorkspaceCoordinator.