Documentation
¶
Overview ¶
Package shell is the main window's frame: the header band, the feature rail, the sidebar column and the right panel beside the page, each column opening, closing and resizing with the reference's motion, and the window's shortcuts, search, activity centre and knowledge viewer.
Index ¶
- Constants
- Variables
- func Accelerator(mods ui.Modifiers, key ui.Key) string
- func ClampNav(w float32) float32
- func ClampPanel(width, w, nav float32) float32
- func HeaderInsets(bar ui.TitleBar) float32
- func NoticeAge(d time.Duration) (key string, count int)
- func NoticeHeading(n *viewmodel.Notice, language string) string
- func PanelFits(w, nav, panel float32) bool
- func SavePrefs(dir string, p Prefs) error
- func SortNotices(list []*preview.Notice) []*preview.Notice
- type App
- func (a *App) ActiveTerminal() string
- func (a *App) ActiveWorkspacePane() panes.Target
- func (a *App) AllPanelTabs() []panel.Tab
- func (a *App) ApplyData(d *viewmodel.Data)
- func (a *App) BindAppActions(scope AppActionScope, current func() bool) *AppActionSource
- func (a *App) BindAppNavigation(scope AppActionScope, current func() bool, ...) *AppActionSource
- func (a *App) BindPanelResources(assembly Assembly, host PanelResourceHost)
- func (a *App) BindWindow(ctx context.Context)
- func (a *App) CancelPanelClose(t panel.Tab)
- func (a *App) CancelTerminalClose(id string)
- func (a *App) CloseKnowledge()
- func (a *App) ClosePage() bool
- func (a *App) CloseWindowBindings()
- func (a *App) CloseWorkspacePane(kind panes.Kind, id string)
- func (a *App) Closing() bool
- func (a *App) Composer(id string) *composer.State
- func (a *App) ConfirmClose(r CloseRequest)
- func (a *App) ConversationActiveTab(id string) panel.Tab
- func (a *App) ConversationTabs(id string) []panel.Tab
- func (a *App) Demo() bool
- func (a *App) DemoConversation(id string) *viewmodel.Conversation
- func (a *App) DemoOn() bool
- func (a *App) DemoReveal(id string, index int)
- func (a *App) DemoUsage() *preview.Usage
- func (a *App) DispatchLink(c *ui.Context, target LinkTarget, actions LinkActions) (bool, error)
- func (a *App) Do(id string)
- func (a *App) DraftComposer(id string) *composer.State
- func (a *App) DropComposer(id string) *composer.State
- func (a *App) DropPanel(id string)
- func (a *App) DropPanelTab(t panel.Tab)
- func (a *App) DropWorkspaceTerminal(id string)
- func (a *App) FeaturePreferences() ([]string, map[string]bool)
- func (a *App) FocusedConversation() string
- func (a *App) ForgetSession(id string)
- func (a *App) HasDraft(state *composer.State) bool
- func (a *App) HasNavigation() bool
- func (a *App) HasPanelTab(t panel.Tab) bool
- func (a *App) HasWorkspacePane(kind panes.Kind) bool
- func (a *App) HasWorkspaceResource(kind panel.Kind) bool
- func (a *App) HasWorkspaceTerminal(id string) bool
- func (a *App) InheritPackagePreferences(node, packageName string)
- func (a *App) KeepWorkspacePane(kind panes.Kind, id string)
- func (a *App) KeepWorkspaceTerminal(id string)
- func (a *App) Menu(lang string, send func(id string)) []*mygo.MenuItem
- func (a *App) MetricLead(c *ui.Context, scope ComposerMetricScope) []conversation.Metric
- func (a *App) MetricStatistics(c *ui.Context, scope ComposerMetricScope) [][]conversation.Metric
- func (a *App) MountPanel()
- func (a *App) MovePanelTab(t panel.Tab, id string)
- func (a *App) NativePageEnabled(p Page) bool
- func (a *App) NativePageUsage() protocol.FeatureUse
- func (a *App) NavShown() bool
- func (a *App) Navigate(p Page)
- func (a *App) OpenConversation(id string)
- func (a *App) OpenHost(id string)
- func (a *App) OpenKnowledge(c *ui.Context, session, link string)
- func (a *App) OpenProject(project *viewmodel.Project, actions ProjectActions)
- func (a *App) OpenSessionIDs() map[string]bool
- func (a *App) OpenWorkspacePane(kind panes.Kind, id string) bool
- func (a *App) OpenWorkspaceTerminal(id, title string)
- func (a *App) PanelConversations() []string
- func (a *App) PluginFeature() string
- func (a *App) Prefs() Prefs
- func (a *App) ProjectOwner() (node, project string, shown bool)
- func (a *App) ProviderUsage(c *ui.Context, node, channel string) *settings.ChannelUsage
- func (a *App) PruneComposers(keep func(id string) bool) map[string]*composer.State
- func (a *App) Reading() *Reading
- func (a *App) RegisterAppAction(action AppAction) (release func(), err error)
- func (a *App) RegisterDefaultLinkHandler(route LinkRoute, handler LinkHandler) error
- func (a *App) RegisterLinkContribution(route LinkRoute, scope LinkScope, handler func(LinkTarget) error, ...) (*LinkContribution, error)
- func (a *App) RegisterLinkHandler(route LinkRoute, handler LinkHandler) (release func(), err error)
- func (a *App) RegisterLinkHandlerWithPriority(route LinkRoute, priority int, handler LinkHandler) (release func(), err error)
- func (a *App) RegisterProjectResourceAction(action sidebar.ProjectResourceAction)
- func (a *App) RenderResource(c *ui.Context, render func(*panel.Project))
- func (a *App) ReplaceConversationID(before, after string)
- func (a *App) ReplacementFeature(packageName string) string
- func (a *App) ReplacesLegacyViews(packageName string) bool
- func (a *App) ResourceCheckpointHistory() bool
- func (a *App) ResourceKind() panel.Kind
- func (a *App) ResourceProject() *viewmodel.Project
- func (a *App) ResourceTarget() ResourceTarget
- func (a *App) RevealConversationPanel()
- func (a *App) RevealDetails()
- func (a *App) RevealResourceFile() func(string)
- func (a *App) SelectedConversation() *viewmodel.Conversation
- func (a *App) SetFeaturePreferences(order []string, pins map[string]bool)
- func (a *App) SetHostPorts(id string, ports []host.Port)
- func (a *App) SetHosts(hosts map[string]*host.Host)
- func (a *App) SetInstallations(queue *transfers.Queue)
- func (a *App) SetLocalHost(h *host.Host)
- func (a *App) SetPluginFeatures(features []Feature)
- func (a *App) SetPluginWorkspace(key string, minNavigation, minDetails, defaultDetails float32)
- func (a *App) SetPrefs(p Prefs)
- func (a *App) SetResourceTarget(target ResourceTarget)
- func (a *App) SetWelcome(seen bool)
- func (a *App) SetWorkspaceOverlay(show func(*ui.Context) bool, close func())
- func (a *App) ShowKnowledge(r *Reading)
- func (a *App) ShowSelection(text string)
- func (a *App) SyncNativePages()
- func (a *App) SystemShortcuts() map[string]string
- func (a *App) TakePanelTab(t panel.Tab)
- func (a *App) ToggleSettings()
- func (a *App) Usage() Usage
- func (a *App) View(c *ui.Context)
- func (a *App) WorkspaceMount(kind panel.Kind) panel.GitWorkspaceMount
- func (a *App) WorkspacePageEnabled(page Page) bool
- func (a *App) WorkspaceTerminalIDs() []string
- type AppAction
- type AppActionContext
- type AppActionID
- type AppActionScope
- type AppActionSource
- type Assembly
- func (a Assembly) HasPanelResource(kind panel.Kind) bool
- func (a Assembly) HasWorkspacePane(kind panes.Kind) bool
- func (a *Assembly) RegisterAppAction(action AppAction) error
- func (a *Assembly) RegisterLinkHandler(route LinkRoute, handler LinkHandler)
- func (a *Assembly) RegisterLinkHandlerWithPriority(route LinkRoute, priority int, handler LinkHandler)
- func (a *Assembly) RegisterPanelResource(resource panel.Resource, bind ...func(PanelResourceHost))
- func (a *Assembly) RegisterWorkspacePane(pane WorkspacePane)
- type BrowserNavigation
- type Choice
- type CloseDocument
- type CloseRequest
- type ComposerMetricScope
- type ConversationActions
- type ConversationPanel
- type ConversationWorktreeActions
- type Feature
- type Group
- type Hooks
- type LinkActions
- type LinkContribution
- type LinkContributionOptions
- type LinkFileDestination
- type LinkHandler
- type LinkKind
- type LinkRoute
- type LinkScope
- type LinkServices
- type LinkTarget
- type MetricBinding
- type MetricContribution
- type Module
- type NativePage
- type Page
- type PanelResourceHost
- type PermissionCommand
- type PermissionContribution
- type PermissionGrantState
- type PermissionReport
- type PluginControlReplacement
- type PluginWorkspacePrefs
- type Prefs
- type ProjectActions
- type ProjectLocationReader
- type ProjectRepository
- type ProjectTerminal
- type ProjectWorkflow
- type ProjectWorkflowHost
- type ProviderUI
- type Reading
- type ResourceTarget
- type SSHReferenceEndpoint
- type Shortcut
- type Source
- type Usage
- type WindowBinding
- type WindowContext
- type WorkflowConversation
- type WorkflowWorkspace
- type WorkspaceAction
- type WorkspacePane
- type WorkspaceSlots
- type WorkspaceTerminal
Constants ¶
const ( HeaderHeight = 48 RailWidth = 56 MainMin = 320 // the conversation's least width PanelWidth = 560 PanelMin = 360 )
Layout metrics.
const ( HeaderButton = 28 RailButton = 36 ButtonGap = 8 )
The header's and the rail's icon buttons are Kit's IconButton at one size each, 8 DIPs apart. Header contributions (Hooks.PluginHeader) use HeaderButton too.
const ( ViewZoomIn = "view.zoom_in" ViewZoomOut = "view.zoom_out" ViewZoomReset = "view.zoom_reset" )
The view zoom's commands, for the window's keys and the native menu (Do).
const PrefsFile = "ui-state.json"
PrefsFile is the preferences' file name in the app's user data folder, beside MyGo's window-state.json, which keeps the window's bounds.
const WindowMinimize = "window.minimize"
WindowMinimize is the Window menu's Minimize: its key enlarges the focused conversation pane in a split, and minimizes the window anywhere else.
Variables ¶
var CloseFocused = Shortcut{ID: "close", Label: "menu_close_tab", Mods: ui.Cmd, Key: ui.KeyW}
CloseFocused is ⌘W. The reference binds it on the panes that close, not on the window: the right panel and an independent page take it while the focus is inside them (App.pane), a split's pane leaves its split, a conversation standing alone and a Files or Git page close their shown tab first, and anywhere else it does nothing.
var Motion = ui.Animation{Duration: 180 * time.Millisecond, Ease: ui.CubicBezier(0.2, 0, 0, 1)}
Motion is the columns' open and close: Kit's duration_normal along easing_move. MyGo makes it instant with Reduce Motion.
var Shortcuts = append(window(settings.Registry), Shortcut{ID: "app.settings", Label: "settings", Mods: ui.Cmd, Key: ui.KeyComma}, Shortcut{ID: "conversation.find", Label: "chat_search", Mods: ui.Cmd, Key: ui.KeyF}, Shortcut{ID: "conversation.stop", Label: "chat_stop", Mods: ui.Cmd, Key: ui.KeyPeriod}, Shortcut{ID: "composer.focus", Label: "chat_message_placeholder", Mods: ui.Cmd, Key: ui.KeyL}, Shortcut{ID: "composer.models", Label: "composer_model_settings", Mods: ui.Cmd | ui.Shift, Key: ui.KeyM}, )
Shortcuts are the reference's window keys, ⌘ standing for Ctrl off macOS: the Shortcuts settings' registry, which the user may rebind (App.binding), then Settings, Find and the conversation's own keys, which are fixed: Stop, Focus the composer and the model controls act on the conversation page only, and the reference lists them in neither the Shortcuts settings nor the menu. The system's shortcuts are not the window's. The registered panel resource keys follow.
Functions ¶
func Accelerator ¶
Accelerator writes a shortcut as MyGo's menus take it: CmdOrCtrl+Alt+N for ⌥⌘N, ui.Cmd being Command on macOS and Ctrl elsewhere.
func ClampPanel ¶
ClampPanel keeps the panel's width in 360 and what leaves the conversation 320.
func HeaderInsets ¶
HeaderInsets is the room the header keeps clear at the window's right edge: 12, past the window buttons MyGo reports there (Windows and Linux; none on macOS, whose lights are on the left).
func NoticeAge ¶
NoticeAge is a notice's age as the activity centre writes it: an i18n key and its count.
func NoticeHeading ¶
NoticeHeading is the heading a package gave its notice, in a language, "" when it gave none: a reminder says Reminder above its own title. System notices keep the application's headings.
func PanelFits ¶
PanelFits reports whether the right panel shows beside the main column in a window w wide: the rail, the sidebar and 320 for the conversation leave it its width. A narrow window hides it without closing it.
Types ¶
type App ¶
type App struct {
Data *viewmodel.Data
Preview bool
Hooks Hooks
// Theme is the selected theme package's ID; empty is the built-in one.
Theme string
Mode theme.Mode
Effects bool // the theme's animated effects
// Surfaces are the window materials' opacities (Appearance).
Surfaces theme.Surfaces
Page Page
// NavOpen and NavWidth are the side column's saved choice, shared by the
// pages that have one (HasNavigation); a page without one hides the
// column and leaves the choice as it is.
// OverviewHidden is the header button's saved choice. A narrow pane
// uses a popover without changing the wide pane's choice.
OverviewHidden bool
// package page. The Shell owns its position, width and fold toggle.
PluginNavigation func(*ui.Context)
// PanelOpen is whether the user wants the right panel; a narrow window
// hides it without changing this.
PanelOpen bool
// PluginDetails draws the details a package page's Workspace supplies
// to the right column, nil while the page shown offers none. They show
// until the toggle folds them; the conversation's PanelOpen is its own.
PluginDetails func(*ui.Context)
// PluginDetailsHeader draws what those details give the column's
// header segment: their title, then their own actions.
PluginDetailsHeader func(*ui.Context)
PluginDetailsLabel string
PanelWidth float32
// DiffSplit is the window's diff layout, side by side when set: the
// button at the end of a diff's footer writes it (kit.DiffSplit), and
// it is saved with the window's other choices (prefs.go).
DiffSplit bool
// where a conversation panel is too narrow for both side by side
// (panel.BindListShare); 0 is the first share. The divider between them
// writes it, and it is saved as DiffSplit is.
ListShare float32
// OnMode, when set, gets the theme mode as it changes, so the window's
// native material follows the app's appearance.
OnMode func(theme.Mode)
OnFeatureMenuChanged func()
Sidebar *sidebar.State
Settings *settings.State
// ProviderUI is installed with the optional model channels page.
ProviderUI ProviderUI
Website string
Feedback string
Messages *conversation.State
Panel *panel.State
// Projects keeps each project's Files and Git state, shared by their
// pages and the panel's tabs.
Projects *panel.Projects
// Host is the device whose monitor HostPage shows;
// hosts are the host pages' data, made from the dataset as first
// shown, and their UI state. Metrics is whether the host page's right
// column shows the metrics summary (layout.panel_open of Page::Host):
// closed until the user opens it, as the reference's, since the page
// itself is the monitor.
Host string
Metrics bool
// Welcome is the welcome guide, opened at the first launch
// (SetPrefs) and from the Help menu in the preview.
Welcome onboarding.Guide
// contains filtered or unexported fields
}
App is the window's state.
func New ¶
func New(d *preview.Data, pages ...NativePage) *App
New makes a standalone sample window with the supplied workspace pages.
func NewLive ¶
func NewLive(d *viewmodel.Data, pages ...NativePage) *App
NewLive creates an unseeded live window with the supplied workspace pages.
func NewLiveWithAssembly ¶
NewLiveWithAssembly creates an unseeded live window with the supplied contributions.
func NewWithAssembly ¶
NewWithAssembly makes a preview window with the supplied page contributions.
func (*App) ActiveTerminal ¶
ActiveTerminal is the main terminal pane the conversation page shows active, "" while a conversation's is or another page shows. Its sidebar row is the selected one, and its right panel works in the terminal's worktree, not the selected conversation's.
func (*App) ActiveWorkspacePane ¶
ActiveWorkspacePane identifies the focused module surface on the conversation page. A conversation or another page returns a zero target.
func (*App) AllPanelTabs ¶
AllPanelTabs are the panel tabs of every pane, the shown one's first.
func (*App) ApplyData ¶
ApplyData replaces a Client projection on the UI thread, retaining local drafts.
func (*App) BindAppActions ¶
func (a *App) BindAppActions(scope AppActionScope, current func() bool) *AppActionSource
BindAppActions binds trusted UI to its captured source. current must check the source's lifetime and identity; for window-wide actions scope may be empty.
func (*App) BindAppNavigation ¶
func (a *App) BindAppNavigation(scope AppActionScope, current func() bool, allows func(protocol.PluginAction) bool) *AppActionSource
BindAppNavigation binds restricted UI to the same registry. The host validates the mounted source and its permissions; only public navigation is callable.
func (*App) BindPanelResources ¶
func (a *App) BindPanelResources(assembly Assembly, host PanelResourceHost)
func (*App) BindWindow ¶
BindWindow supplies the live context after the window's services are ready. Fixture windows never acquire live resources.
func (*App) CancelPanelClose ¶
CancelPanelClose clears a failed close so a later removal stays passive.
func (*App) CancelTerminalClose ¶ added in v0.2.3
CancelTerminalClose clears a failed close so a later shell exit stays passive.
func (*App) CloseKnowledge ¶
func (a *App) CloseKnowledge()
CloseKnowledge releases a restricted projection, including text held by a callback that still refers to the old page.
func (*App) ClosePage ¶
ClosePage closes the independent page shown, back to the conversation. It reports whether there was one to close.
func (*App) CloseWindowBindings ¶
func (a *App) CloseWindowBindings()
CloseWindowBindings releases the per-window callbacks registered by BindWindow.
func (*App) CloseWorkspacePane ¶
CloseWorkspacePane releases a module surface and its placement in this window.
func (*App) ConfirmClose ¶
func (a *App) ConfirmClose(r CloseRequest)
ConfirmClose opens the close prompt. A prompt already showing stays as it is, so repeated close requests ask once.
func (*App) ConversationActiveTab ¶
ConversationActiveTab is the tab a conversation's panel shows, on screen or not.
func (*App) ConversationTabs ¶
ConversationTabs are a conversation's panel tabs, shown or not.
func (*App) DemoConversation ¶
func (a *App) DemoConversation(id string) *viewmodel.Conversation
DemoConversation is the demo's conversation of that ID, nil without the demo. Unlike Demo it also answers while the window's own stage is back on the fields: the controller's frame hooks keep what it mounted over a demo conversation (Hooks.DemoConversation) for as long as the demo has it.
func (*App) DemoOn ¶
DemoOn reports whether the demo is on. Unlike Demo it also answers while the window's own stage is back on the fields, as in the controller's frame hooks: what the user does then is still done in the demo.
func (*App) DemoReveal ¶
DemoReveal scrolls the demo's transcript of that conversation to the turn at index; nothing without the demo. Like DemoConversation it also answers while the window's own stage is back on the fields, where a package mounted over a demo conversation asks for it.
func (*App) DemoUsage ¶
DemoUsage is the usage the demo counts, which the Usage page reads while the demo shows; nil without the demo. Unlike Demo it also answers while the window's own stage is back on the fields.
func (*App) DispatchLink ¶
func (a *App) DispatchLink(c *ui.Context, target LinkTarget, actions LinkActions) (bool, error)
func (*App) Do ¶
Do sends a command of the native menu, a Shortcut's ID or another of the menu's (menu.go), to run in the next frame. Call it on the main thread, where menu items' Click runs, then redraw the window.
func (*App) DraftComposer ¶
DraftComposer returns the retained composer state for id without creating one.
func (*App) DropComposer ¶
DropComposer forgets the input state of a draft that is gone and returns it, nil when there was none.
func (*App) DropPanel ¶
DropPanel forgets a conversation's panel, as when the conversation is deleted or archived. The owner of what its tabs show closes that first.
func (*App) DropPanelTab ¶
DropPanelTab removes a tab from the window, shown or not, then releases it. Acknowledging an explicit asynchronous close can also fold its panel.
func (*App) DropWorkspaceTerminal ¶
DropWorkspaceTerminal closes only a main terminal's surface and its pane's right panel. Its running process remains in the Node's inventory and can be opened from terminal activity.
func (*App) FeaturePreferences ¶
FeaturePreferences includes saved choices for destinations this window does not provide, so changing its rail cannot erase those preferences.
func (*App) FocusedConversation ¶
FocusedConversation is the conversation receiving main-workspace actions, empty while a module surface or another page is focused.
func (*App) ForgetSession ¶ added in v0.2.7
ForgetSession clears the tab, tab order entry and saved split position when the Node confirms deletion or the window discards a local draft.
func (*App) HasDraft ¶
HasDraft reports whether the window currently retains the given composer state.
func (*App) HasNavigation ¶
HasNavigation reports whether the page shown has a side column beside the rail, as the reference's feature_navigation: the sessions on the conversation and on the host and project pages opened from it, the sections on Settings. Activity, Files, Git, Market, the notification center have none. A package page can supply its own resource navigation.
func (*App) HasPanelTab ¶
HasPanelTab reports whether any conversation's panel has t.
func (*App) HasWorkspaceResource ¶
HasWorkspaceResource covers resources that share a project with the panel or with a central page.
func (*App) HasWorkspaceTerminal ¶
HasWorkspaceTerminal reports whether the main workspace owns id's surface.
func (*App) InheritPackagePreferences ¶
InheritPackagePreferences binds only a verified installation on the profile's own Node.
func (*App) KeepWorkspacePane ¶
KeepWorkspacePane retains the module surface's tab when another tab is selected.
func (*App) KeepWorkspaceTerminal ¶
KeepWorkspaceTerminal keeps an open main terminal's tab, as a double click on its passing tab does.
func (*App) Menu ¶
Menu is the native app menu in lang: App, File, Edit, View, Window and Help, with the reference's items on the keys they have now (syncMenuKeys follows a rebound one), then the rail's features in View. The app's items send their command's ID through send, which the application passes to Do: the menu takes their keys before the window does. The system's items are MyGo's roles under the reference's labels and keys: the menu binds Close Window, Hide, Hide Others, Minimize and Full Screen on cmd (ui.Super), the rest on secondary (ui.Cmd). Minimize is the app's item on cmd: in a focused conversation its key enlarges the pane, elsewhere it minimizes the window (WindowMinimize). Save follows the focused live editor. Logs stays disabled without a live log folder (Hooks.OpenLogs). Help also opens the welcome guide.
func (*App) MetricLead ¶
func (a *App) MetricLead(c *ui.Context, scope ComposerMetricScope) []conversation.Metric
MetricLead returns the context-bar lead metrics contributed by bound native modules for the active composer scope.
func (*App) MetricStatistics ¶
func (a *App) MetricStatistics(c *ui.Context, scope ComposerMetricScope) [][]conversation.Metric
MetricStatistics returns the context-bar statistics metric groups contributed by bound native modules for the active composer scope, one group per contributor.
func (*App) MountPanel ¶
func (a *App) MountPanel()
MountPanel gives the panel to the active pane: the tabs of the one left are kept for its return, and the active one's come back, or the closed panel of a pane that never opened it. The first pane takes what the window opened before it. A terminal has one tab in the window: the one in the shown panel.
func (*App) MovePanelTab ¶
MovePanelTab gives t to conversation id's panel, behind its shown tab: a tab opened for a conversation that is not on screen, as the page its agent opened.
func (*App) NativePageEnabled ¶
NativePageEnabled reports whether the assembly contributed this page.
func (*App) NativePageUsage ¶
func (a *App) NativePageUsage() protocol.FeatureUse
NativePageUsage returns the counter declared by the current native page.
func (*App) NavShown ¶
NavShown reports whether the side column shows: the page has one and the user keeps it open.
func (*App) OpenConversation ¶ added in v0.2.7
OpenConversation opens session id as the user asked for it, from a sidebar row, a link, search, a notification or another page: it shows on the conversation page, in its split group when it is in one, and otherwise has a tab until that is closed. A selection the window falls back to when data changes is no open and adds no tab, so closing the last tab stays closed.
func (*App) OpenKnowledge ¶
OpenKnowledge opens a knowledge link of a conversation on its Node.
func (*App) OpenProject ¶
func (a *App) OpenProject(project *viewmodel.Project, actions ProjectActions)
func (*App) OpenSessionIDs ¶
OpenSessionIDs reports the session IDs currently referenced in open panes or kept tabs on the live workspace without cloning all preferences.
func (*App) OpenWorkspacePane ¶
OpenWorkspacePane focuses an existing surface supplied by a module.
func (*App) OpenWorkspaceTerminal ¶
OpenWorkspaceTerminal opens or focuses an independent main terminal. It does not add a conversation's right-panel tab or start a terminal process.
func (*App) PanelConversations ¶
PanelConversations are the conversations that have a panel: the shown one first, then the others in order. A main terminal pane's panel is not a conversation's: it leaves with its pane (DropWorkspaceTerminal).
func (*App) PluginFeature ¶
func (*App) Prefs ¶
Prefs returns the app's preferences as they are now. They are the window's own: the demo's panels and panes are never saved.
func (*App) ProjectOwner ¶
func (*App) ProviderUsage ¶
ProviderUsage returns the first native channel usage summary contributed for the given Node and provider ID, or nil when none applies.
func (*App) PruneComposers ¶
PruneComposers releases idle composers not kept by keep, and strips stale controller callbacks from non-idle off-screen composers.
func (*App) RegisterAppAction ¶
RegisterAppAction binds a live service to this window. Release only removes this registration; a duplicate ID never replaces a handler.
func (*App) RegisterDefaultLinkHandler ¶
func (a *App) RegisterDefaultLinkHandler(route LinkRoute, handler LinkHandler) error
RegisterDefaultLinkHandler registers the host's behavior at priority -1.
func (*App) RegisterLinkContribution ¶
func (a *App) RegisterLinkContribution(route LinkRoute, scope LinkScope, handler func(LinkTarget) error, options ...LinkContributionOptions) (*LinkContribution, error)
RegisterLinkContribution uses the same route as RegisterLinkHandler, but only admits package schemes and requires an exact source scope at dispatch.
func (*App) RegisterLinkHandler ¶
func (a *App) RegisterLinkHandler(route LinkRoute, handler LinkHandler) (release func(), err error)
RegisterLinkHandler binds a native handler at priority zero to this window.
func (*App) RegisterLinkHandlerWithPriority ¶
func (a *App) RegisterLinkHandlerWithPriority(route LinkRoute, priority int, handler LinkHandler) (release func(), err error)
RegisterLinkHandlerWithPriority binds a candidate to this window. On error it leaves existing candidates unchanged and returns no release function.
func (*App) RegisterProjectResourceAction ¶
func (a *App) RegisterProjectResourceAction(action sidebar.ProjectResourceAction)
func (*App) RenderResource ¶
RenderResource supplies the shared workspace project or shows the resource's empty state when the active page has no reachable project.
func (*App) ReplaceConversationID ¶
ReplaceConversationID retains local input state when a draft is created on Node.
func (*App) ReplacementFeature ¶
func (*App) ReplacesLegacyViews ¶
func (*App) ResourceCheckpointHistory ¶
ResourceCheckpointHistory reports whether this view needs checkpoint history.
func (*App) ResourceKind ¶
ResourceKind identifies the workspace view used by the current page.
func (*App) ResourceProject ¶
ResourceProject is the project named in the Files or Git breadcrumb.
func (*App) ResourceTarget ¶
func (a *App) ResourceTarget() ResourceTarget
ResourceTarget returns the explicit selection when Files or Git is shown. The zero value follows the current conversation.
func (*App) RevealConversationPanel ¶ added in v0.2.3
func (a *App) RevealConversationPanel()
RevealConversationPanel shows the active pane's right panel. Explicit open actions call it before changing the mounted panel's tabs.
func (*App) RevealDetails ¶
func (a *App) RevealDetails()
RevealDetails shows the right column again after its toggle folded it.
func (*App) RevealResourceFile ¶
RevealResourceFile returns the navigation callback for a file already opened in the shared workspace. Without a Files resource, the action is unavailable.
func (*App) SelectedConversation ¶ added in v0.2.7
func (a *App) SelectedConversation() *viewmodel.Conversation
SelectedConversation is the sidebar's selection on the host it was chosen on, as a row or a row's drop chose it, or by its ID alone when none was named: two hosts may list a session of one ID.
func (*App) SetFeaturePreferences ¶
func (*App) SetInstallations ¶
func (*App) SetLocalHost ¶
SetLocalHost supplies current local overview data without preview metrics.
func (*App) SetPluginFeatures ¶
func (*App) SetPluginWorkspace ¶
SetPluginWorkspace projects the mounted Workspace's constraints. A default width initializes a Workspace once; subsequent projections preserve drags.
func (*App) SetResourceTarget ¶
func (a *App) SetResourceTarget(target ResourceTarget)
SetResourceTarget selects the workspace shared by Files and Git.
func (*App) SetWelcome ¶
SetWelcome uses the profile preference, independently of window UI state.
func (*App) SetWorkspaceOverlay ¶
func (*App) ShowKnowledge ¶
ShowKnowledge opens the viewer on a page read from a Node.
func (*App) ShowSelection ¶
ShowSelection presents text captured by the controller's native integration.
func (*App) SyncNativePages ¶
func (a *App) SyncNativePages()
SyncNativePages delivers shared live state to the installed page controllers and metric contributors.
func (*App) SystemShortcuts ¶
SystemShortcuts are the system-wide shortcuts on the keys they have now, by accelerator: their commands go to Do. cmd/sailry-desktop registers them with the system as the app starts.
func (*App) TakePanelTab ¶
TakePanelTab takes t out of the panel that has it, shown or not, to show it in the main workspace. A panel it was the only tab of closes, as on an explicit close, rather than staying open with nothing in it.
func (*App) ToggleSettings ¶
func (a *App) ToggleSettings()
ToggleSettings opens Settings, or from Settings goes back to the page it opened over: the rail's button opens and closes it (user decision 2026-11-12).
func (*App) WorkspaceMount ¶
func (a *App) WorkspaceMount(kind panel.Kind) panel.GitWorkspaceMount
func (*App) WorkspacePageEnabled ¶
func (*App) WorkspaceTerminalIDs ¶
WorkspaceTerminalIDs lists the open main terminal surfaces in opening order.
type AppAction ¶
type AppAction struct {
ID AppActionID
PluginPermission protocol.PluginAction
Run func(*ui.Context, *App, AppActionContext, json.RawMessage) error
}
AppAction handles one validated JSON object. Run must validate its own fields before acting. PublicNavigation is only for navigation without a data mutation.
type AppActionContext ¶
type AppActionContext struct {
AppActionScope
// contains filtered or unexported fields
}
func (AppActionContext) Current ¶
func (c AppActionContext) Current() bool
Current must be checked on the UI thread before applying a deferred result.
type AppActionID ¶
type AppActionID string
type AppActionScope ¶
type AppActionScope struct {
Node protocol.NodeID
Worktree protocol.WorktreeID
Session protocol.SessionID
}
AppActionScope is supplied by the host, never by action input.
type AppActionSource ¶
type AppActionSource struct {
// contains filtered or unexported fields
}
AppActionSource is a host-owned caller bound to one live window and source. Bind, invoke and release it on that window's UI thread.
func (*AppActionSource) Close ¶
func (s *AppActionSource) Close()
Close invalidates this source, without unregistering actions or other callers.
func (*AppActionSource) Invoke ¶
func (s *AppActionSource) Invoke(c *ui.Context, id AppActionID, input json.RawMessage) error
Invoke selects exactly one action. Absence, refusal and handler failure never retry or fall through to a link, shortcut or another action.
type Assembly ¶
type Assembly struct {
WorkspacePages []NativePage
SettingsPages []settings.NativePage
ExecutionSettings []settings.ExecutionSettingFactory
Permissions []PermissionContribution
ProjectWorkflows []ProjectWorkflow
PluginControlReplacements []PluginControlReplacement
MetricContributions []MetricContribution
ProviderUI func(*settings.State) ProviderUI
Locales []fs.FS
// contains filtered or unexported fields
}
Assembly selects the optional pages, services, and translations for each window.
func (*Assembly) RegisterAppAction ¶
RegisterAppAction declares one action for every live window in this assembly.
func (*Assembly) RegisterLinkHandler ¶
func (a *Assembly) RegisterLinkHandler(route LinkRoute, handler LinkHandler)
RegisterLinkHandler declares a native handler at priority zero.
func (*Assembly) RegisterLinkHandlerWithPriority ¶
func (a *Assembly) RegisterLinkHandlerWithPriority(route LinkRoute, priority int, handler LinkHandler)
RegisterLinkHandlerWithPriority declares a handler for every live window. An overlapping claim at the same priority is a configuration error.
func (*Assembly) RegisterPanelResource ¶
func (a *Assembly) RegisterPanelResource(resource panel.Resource, bind ...func(PanelResourceHost))
RegisterPanelResource contributes a conversation panel resource, including optional tab actions. The strip owns ordering, default tab chrome and close confirmation; the resource supplies its body, commands and release policy. Binding runs once in a live window after its controllers are available.
func (*Assembly) RegisterWorkspacePane ¶
func (a *Assembly) RegisterWorkspacePane(pane WorkspacePane)
type BrowserNavigation ¶
type BrowserNavigation struct {
}
type Choice ¶
type Choice struct {
ID string
Label string
Icon *ui.SVG
Keywords []string
Folder string // the folder it opens, "" for an action
Selected bool // what the window shows: a check
// contains filtered or unexported fields
}
Choice is a row of the search: a label with keywords that match too, a folder it opens, or an action.
type CloseDocument ¶ added in v0.2.3
CloseDocument identifies the draft that a discard confirmation would lose. Each window owns its project editors, even when they show the same file.
type CloseRequest ¶
type CloseRequest struct {
// Documents are read again before discarding drafts and after saving.
Documents func() []CloseDocument
StopsLocalWork bool
// Save starts saving every unsaved document; Saving reports whether a
// save is still under way. A failed save tells its own toast.
Save func()
Saving func() bool
Proceed func()
}
CloseRequest asks to close a window or quit the application. With unsaved documents the prompt offers Save all, Discard and Cancel. Otherwise it confirms the quit and warns about any local work that will stop.
type ComposerMetricScope ¶
type ComposerMetricScope struct {
Node string
Provider string
ProviderRev uint64
Model string
Auth protocol.Authentication
Credential *protocol.CredentialRef
CredRev uint64
Connected bool
Demo bool
HasMessages bool
Statistics *protocol.ConversationStatistics
}
ComposerMetricScope describes the active conversation and selected model channel when rendering composer context-bar metrics.
type ConversationActions ¶
type ConversationActions interface {
composer.Actions
conversation.Actions
}
type ConversationPanel ¶
type ConversationPanel struct {
Tabs []panel.Tab `json:"tabs,omitempty"`
Active panel.Tab `json:"active"`
Open bool `json:"open,omitempty"`
// Width is the column's width when the conversation was left, 0 for the
// window's.
Width float32 `json:"width,omitempty"`
// contains filtered or unexported fields
}
ConversationPanel is a pane's panel while another pane is shown, and in the saved window state.
type Feature ¶
type Feature struct {
ID string
Icon *ui.SVG
Label string // i18n key
Fixed bool // always on the rail, never moved (Conversation)
Last bool // always last (Market)
DefaultPinned bool
// LegacyPackage identifies the official package whose rail preferences this page inherits.
LegacyPackage string
}
Feature is a rail entry.
type Hooks ¶
type Hooks struct {
HostActions func(string) host.Actions
EditHost func(string)
WorkspaceProject func() *panel.Project
ResourceWorkspace func(ResourceTarget) *panel.Project
DownloadDialog func(*ui.Context)
PackageDialogs func(*ui.Context)
// FilePreview draws the preview dialog of a file outside a
// conversation.
FilePreview func(*ui.Context)
BeforeFrame func(*ui.Context)
AfterFrame func()
// DemoChanged runs when Demo mode went on, off or into another
// language, before the frame's other hooks.
DemoChanged func()
Refresh func()
ReadNotice func(string)
ReadNotices func([]string)
DismissRead func([]string)
DismissNotices func([]string)
OpenKnowledge func(c *ui.Context, node string, source Source)
CaptureSelection func()
OpenLogs func()
Conversation func(*ui.Context, *viewmodel.Conversation, *composer.State) (*composer.Context, ConversationActions)
// DemoConversation lets the controller show over a demo conversation
// what reads nothing but the conversation itself: the statistics
// package's figures in the composer's context bar. It runs after the
// demo's composer is prepared and sends the Node nothing of the demo.
DemoConversation func(*ui.Context, *viewmodel.Conversation, *composer.State)
RenderChild func(*ui.Context, string)
ReadSelection func(string, string)
ReaderActive func(string) bool
SelectPlugin func(string) bool
PluginPage func(*ui.Context, string)
PluginHeader func(*ui.Context)
PluginTitle func(*ui.Context) bool
PluginOverlays func(*ui.Context)
// Overview is a conversation's session overview for the header's button.
Overview func(*ui.Context, *viewmodel.Conversation) *composer.Overview
// NewConversationDraft opens a fresh unsent conversation in project (nil:
// without one) for the pane keys' new tab or split, with that location's
// composer defaults, and selects it as New session does. Unlike New
// session it never reuses the location's unsent draft. A selection left
// as it was means none was created.
NewConversationDraft func(project *viewmodel.Project)
}
Hooks keeps I/O and thread scheduling in the live controller.
type LinkActions ¶
type LinkActions struct {
LinkServices
OpenWorkspaceFile func(LinkFileDestination) error
ShowWorkspaceDirectory func(Page, func(*panel.Project, string)) error
OpenSession func() error
}
LinkActions act only on the captured target, during the handler call.
type LinkContribution ¶
type LinkContribution struct {
// contains filtered or unexported fields
}
LinkContribution is a window-local claim, including while another wins.
func (*LinkContribution) Active ¶
func (claim *LinkContribution) Active() bool
func (*LinkContribution) Close ¶
func (claim *LinkContribution) Close()
type LinkContributionOptions ¶
type LinkContributionOptions struct {
Priority int
Current func(LinkTarget) bool
}
LinkContributionOptions ranks a scoped candidate. Current is the host's side-effect-free authorization check, evaluated before ranking.
type LinkFileDestination ¶
LinkFileDestination names exactly one registered workspace page or panel.
type LinkHandler ¶
type LinkHandler func(*ui.Context, LinkTarget, LinkActions) error
LinkHandler owns the attempted open. An error never selects another handler.
type LinkRoute ¶
LinkRoute claims a URL scheme, a reference kind, or a validated workspace file or directory. Name is empty for workspace paths.
type LinkScope ¶
type LinkScope struct {
Node protocol.NodeID
Worktree protocol.WorktreeID
Session string
}
type LinkServices ¶
type LinkServices struct {
OpenKnowledge func(*ui.Context, Source)
OpenPackageDetails func(*ui.Context, string)
ShowReference func(label, subtitle, text string)
SSHReference func(protocol.SshID) (SSHReferenceEndpoint, bool)
DatabaseReference func(protocol.DatabaseID) (string, bool)
}
LinkServices are the read and presentation capabilities of the source conversation. Connection lookups expose only referable display data.
type LinkTarget ¶
type LinkTarget struct {
Route LinkRoute
Node protocol.NodeID
Session string
Worktree protocol.WorktreeID
Turn protocol.TurnID
URL string
Reference protocol.ConversationReference
Path string
Line int
External bool
// ConversationWorkspace reports whether this worktree can be shown in the
// source conversation's panel. It does not select a destination.
ConversationWorkspace bool
}
LinkTarget carries the source location. Path is relative to Worktree ("." for its root); Line is one-based or zero if unspecified.
type MetricBinding ¶
type MetricBinding struct {
Lead func(*ui.Context, ComposerMetricScope) []conversation.Metric
Statistics func(*ui.Context, ComposerMetricScope) []conversation.Metric
Provider func(*ui.Context, string, string) *settings.ChannelUsage
Sync func()
Close func()
}
MetricBinding belongs to one metric contributor in one window. Lead and Statistics produce composer context-bar metrics; Provider supplies Settings channel usage. Sync runs before layout; Close releases owned resources when the window closes.
type MetricContribution ¶
type MetricContribution struct {
Bind func(WindowContext) MetricBinding
}
MetricContribution registers a window-scoped metric contributor in Assembly.
type Module ¶
type Module func(*Assembly)
Module registers the contributions it supplies to a desktop assembly.
type NativePage ¶
type NativePage struct {
Page Page
Feature Feature
Render func(*ui.Context, *App)
Usage protocol.FeatureUse
// ReplacesLegacyViews also replaces the official LegacyPackage's non-navigation
// workspace views and contributions. Package settings and history remain available.
ReplacesLegacyViews bool
// LegacyWorkspace is the replaced package's layout ID for a project resource page.
LegacyWorkspace string
// Bind returns a window-local frame callback. visible reports whether this
// route is active in the live window, including between frames.
Bind func(app *App, visible func() bool) func()
// BindWindow supplies the live window's instance of this page. Render and
// Workspace are the fallbacks when there is no live binding.
BindWindow func(WindowContext) WindowBinding
// SupportsDemo reports whether this page's WindowBinding handles Demo mode
// using sample data without contacting a Node.
SupportsDemo bool
// Workspace supplies the slots around Render before layout, for pages
// without a project Resource.
Workspace func(*App) WorkspaceSlots
// Resource shares a workspace panel tab's project and the shell's layout.
Resource panel.Kind
// CheckpointHistory requests older checkpoints for the shown workspace.
CheckpointHistory bool
BindWorkspace panel.GitWorkspaceMount
// RenderDetails and BindKeys are optional resource callbacks. The shell
// calls them with the current workspace project when it is available.
RenderDetails func(*ui.Context, *App, *panel.Project)
BindKeys func(*ui.Context, *panel.Project, ui.Element)
// ExtensionDetails shares Settings' extension details in the right column.
ExtensionDetails bool
}
NativePage contributes a window-local rail destination and its content.
type Page ¶
type Page string
Page is the stable ID of a destination in the main column. Native pages can use their own namespaced IDs.
const ( ConversationPage Page = "page:conversation" SettingsPage Page = "page:settings" FilesPage Page = "page:files" GitPage Page = "page:git" ActivityPage Page = "page:activity" MarketPage Page = "page:settings_plugins" HostPage Page = "page:host" NotificationsPage Page = "page:notifications" ProjectPage Page = "page:project" PluginPage Page = "page:plugin" )
type PanelResourceHost ¶
type PanelResourceHost struct {
App *App
Report func(error)
BindBrowser func()
// BindTerminal connects the shared live terminal service to this window.
BindTerminal func() sidebar.ProjectOpen
}
type PermissionCommand ¶
PermissionCommand executes an ordinary controller command on the selected Host.
type PermissionContribution ¶
type PermissionContribution struct {
Subject string
Kinds []protocol.PermissionsKind
// Revision derives the availability revision from a read-only Host snapshot.
// It is needed only when Available should follow changes while the page is open.
Revision func(*protocol.Snapshot) uint64
Available func(context.Context, PermissionCommand) (bool, error)
// Check returns all of the subject's grants in one read.
Check func(context.Context, PermissionCommand) (PermissionReport, error)
// Request is optional. The window calls it only on the local Host, after
// Check reports that the selected grant can still be requested.
Request func(context.Context, PermissionCommand, protocol.PermissionsKind) (PermissionReport, error)
}
PermissionContribution declares the grants of one native subject on the managed Host. An enabled package declaring that subject takes precedence.
type PermissionGrantState ¶
type PermissionGrantState string
const ( PermissionUnknown PermissionGrantState = "permission_unknown" PermissionGranted PermissionGrantState = "permission_granted" PermissionRequired PermissionGrantState = "permission_required" PermissionNotNeeded PermissionGrantState = "permission_not_needed" )
type PermissionReport ¶
type PermissionReport struct {
Grants map[protocol.PermissionsKind]PermissionGrantState
CanRequest bool
}
type PluginControlReplacement ¶
type PluginControlReplacement struct {
Package string
Slot protocol.PluginUiSlot
ID string
}
PluginControlReplacement identifies an old official control provided by a native module in this assembly. It never reserves an ID in another package.
type PluginWorkspacePrefs ¶
type PluginWorkspacePrefs struct {
Width float32 `json:"width"`
Folded bool `json:"folded,omitempty"`
}
PluginWorkspacePrefs belong to one workspace, including the core Files and Git pages. Conversation panels and other workspaces keep their own widths and fold choices.
type Prefs ¶
type Prefs struct {
// OverviewHidden hides the activity card in a wide conversation pane.
OverviewHidden bool `json:"overviewHidden,omitempty"`
PanelWidth float32 `json:"panelWidth"`
PanelOpen bool `json:"panelOpen"`
PanelTabs []panel.Tab `json:"panelTabs,omitempty"`
PanelTab panel.Tab `json:"panelTab"`
// PanelOf is the conversation PanelTabs, PanelTab and PanelOpen belong
// to, the one shown last; empty in a file from before the panel belonged
// to conversations, whose tabs the first conversation shown takes.
PanelOf string `json:"panelOf,omitempty"`
// Panels are the other conversations' panels (panels.go).
Panels map[string]ConversationPanel `json:"panels,omitempty"`
PluginWorkspaces map[string]PluginWorkspacePrefs `json:"pluginWorkspaces,omitempty"`
Collapsed []string `json:"collapsed,omitempty"`
// SessionOrder is the preview's sidebar order, a session_order value; a
// profile keeps its own in its preferences.
SessionOrder string `json:"sessionOrder,omitempty"`
Features []string `json:"features,omitempty"` // the rail's order
Unpinned []string `json:"unpinned,omitempty"` // features off the rail
// WelcomeSeen is whether the welcome guide was dismissed; nil in a file from
// before it counts as seen, and no file at all as a first launch.
WelcomeSeen *bool `json:"welcomeSeen,omitempty"`
// Panes are the split workspace's groups, each a layout tree.
Panes []*panes.Node `json:"panes,omitempty"`
// Tabs are the sessions and terminals kept as tabs beside the groups.
Tabs []panes.Target `json:"tabs,omitempty"`
// TabOrder is the header tabs' opening order, each by its first target.
TabOrder []panes.Target `json:"tabOrder,omitempty"`
// WorkspaceTerminals are independent main terminal surfaces. They hold no
// process state or conversation ownership.
WorkspaceTerminals []WorkspaceTerminal `json:"workspaceTerminals,omitempty"`
// DiffSplit is the window's diff layout: side by side when set, else
// unified, as before the choice.
DiffSplit bool `json:"diffSplit,omitempty"`
// absent, as in a file from before, is the first share.
ListShare float32 `json:"listShare,omitempty"`
}
Prefs are the window's UI preferences that come back after a relaunch: the columns' widths and openness, the panel's tabs, the projects closed in the sidebar, and the preview's rail. They are UI state, not user data; the preview's conversations are never written.
The file is one for the preview and every profile. A profile keeps its rail's order and pins in its own preferences (FeaturePreferences), so a live window neither reads Features and Unpinned nor changes them: it writes back the ones it loaded.
type ProjectActions ¶
type ProjectActions struct {
NewSession func(*viewmodel.Project)
VisibleSession func(*viewmodel.Conversation) bool
OpenSession func(*viewmodel.Conversation, func(bool))
Repository func() ProjectRepository
Initialize func(func(bool))
// NewTerminal opens an independent terminal in the project's worktree.
NewTerminal func(*viewmodel.Project)
// Terminals lists the project's running Node terminals, whichever
// controller started them; OpenTerminal shows one as a main surface.
Terminals func() []ProjectTerminal
OpenTerminal func(id string)
ResourceActions []sidebar.ProjectResourceAction
WorktreePath string
// Controls draws the controls packages add to the page, after its own.
Controls func(*ui.Context)
}
type ProjectLocationReader ¶
type ProjectLocationReader struct {
Main protocol.WorktreeID
Read func(string, protocol.Command, func(protocol.Output))
Publish func(protocol.GitWorktrees)
}
ProjectLocationReader reads and publishes the visible checkouts of one project. The host owns the cache and invalidates it when that workspace changes.
type ProjectRepository ¶
type ProjectTerminal ¶ added in v0.2.5
ProjectTerminal is a running terminal in one of a project's worktrees, the sidebar's row of it.
type ProjectWorkflow ¶
type ProjectWorkflow func(ProjectWorkflowHost)
ProjectWorkflow binds an optional workflow to one live window.
type ProjectWorkflowHost ¶
type ProjectWorkflowHost struct {
RegisterMenu func(sidebar.ProjectMenuAction)
RegisterLocations func(func(ProjectLocationReader))
RegisterWorktreeActions func(ConversationWorktreeActions)
RegisterWorkspaceAction func(string, WorkspaceAction)
NewDraft func(*viewmodel.Project) (WorkflowConversation, bool)
ProjectWorkspace func(*viewmodel.Project) (WorkflowWorkspace, bool)
}
type ProviderUI ¶
type ProviderUI interface {
Picker(c *ui.Context, chosen, back func())
CloseProviderEditor(nextNode string)
LoginDialog(*ui.Context)
ShowProviderAuthorization(node, id string, view *settings.Authorization)
ProviderAuthorization() *settings.Authorization
WarnProviderAuthorization(title, text string, proceed, cancel func())
}
ProviderUI is the model channels page's presentation for this window.
type Reading ¶
type Reading struct {
Node, Collection string
Title, Host, Path, Position, Text string
First, Last, Pending bool
Turn func(forward bool)
}
Reading is one page of a citation read from its Node. The controller owns it: it replaces the page and the ends as Previous and Next load.
type ResourceTarget ¶
type ResourceTarget struct {
Node, Project, Worktree string
}
ResourceTarget identifies the independent Files and Git workspace. An empty Worktree selects the project's main worktree.
type SSHReferenceEndpoint ¶
type Shortcut ¶
Shortcut is a key of the window: its id, label and default key, as the Shortcuts settings list them.
type Source ¶
type Source struct {
Collection, Chunk, Revision, Node string
}
Source is a knowledge citation's identity (sailry-knowledge://<collection>/<chunk>?revision=<rev>).
func ParseSource ¶
ParseSource reads a knowledge link, rejecting what the reference rejects: another scheme, a user, password or port, a fragment, more path segments, and query fields other than revision and an optional storage Node.
type Usage ¶
type Usage struct {
Page Page
// PluginPage is the rail feature of the package page shown, "" on any
// other page.
PluginPage string
// Search is whether the search palette is open.
Search bool
// ModelPicker is whether a composer's model controls are open.
ModelPicker bool
// Splits is how many panes were split off since the window opened.
Splits int
}
Usage is the part of the window's state the anonymous feature counters compare from one frame to the next. It names no session, project or host.
type WindowBinding ¶
type WindowBinding struct {
Render func(*ui.Context)
Slots func() WorkspaceSlots
Sync func()
Close func()
}
WindowBinding belongs to one registered page in one window. Sync runs before layout; Close releases whatever the page still owns at window close.
type WindowContext ¶
WindowContext is passed only to pages registered in this live window.
type WorkflowConversation ¶
type WorkflowConversation struct {
Session *protocol.Session
Execute func(string, protocol.Command, func(*ui.Context, protocol.Output, error))
Report func(*ui.Context, error, string, string, string)
OpenWorkspace func() (WorkflowWorkspace, bool)
}
WorkflowConversation captures the Node and source of an explicitly invoked action.
type WorkflowWorkspace ¶
type WorkflowWorkspace struct {
Worktree protocol.Worktree
Session *protocol.Session
Presentation *panel.Project
Current func() bool
Read func(string, protocol.Command, func(*ui.Context, protocol.Output))
Execute func(string, protocol.Command, func(*ui.Context, protocol.Output, error))
Report func(*ui.Context, error, string, string, string)
Pick func(string, []panel.PickerRow)
Prompt func(string, []string, []string, func([]string, func(bool)), ...panel.PromptToggle)
Confirm func(string, string, func(func(bool)), ...string)
LockPrompt func(bool)
SetPromptAction func(string)
SetPromptDetail func(string, string)
SetPromptUncertain func(bool)
Locations func() ([]protocol.Worktree, []protocol.Session)
HasDrafts func(protocol.WorktreeID) bool
Admit func(protocol.Worktree)
Release func(protocol.WorktreeID)
UseLocation func(protocol.Worktree)
CanSelectLocation func() bool
SelectLocation func(*ui.Context, protocol.Worktree)
OpenSession func(protocol.SessionID)
Refresh func()
RefreshLocations func()
}
WorkflowWorkspace captures a workspace and the window surface that opened it. Current reports whether its controls and location selection are still active.
type WorkspaceAction ¶
type WorkspaceAction func(*ui.Context, WorkflowWorkspace, string, string)
type WorkspacePane ¶
type WorkspacePane struct {
Kind panes.Kind
Icon *ui.SVG
Exists func(*App, string) bool
Title func(*App, *ui.Context, string) string
Render func(*App, *ui.Context, string)
Close func(*App, string)
Split func(*App, string) (string, bool)
}
WorkspacePane contributes one kind of main-workspace surface. Callbacks operate on the supplied window. Close releases the module's surface; the shell removes its tab, split placement and panel. The module's window binding releases window-scoped resources on shutdown. Split optionally opens a sibling surface and returns its ID.
func TerminalWorkspacePane ¶
func TerminalWorkspacePane() WorkspacePane
TerminalWorkspacePane contributes the independent terminal surface to a product that provides a terminal service.
type WorkspaceSlots ¶
type WorkspaceSlots struct {
PreferenceKey string
MinDetailsWidth float32
DefaultDetailsWidth float32
DetailsLabel string // i18n key or a localized label
Details func(*ui.Context)
DetailsHeader func(*ui.Context)
Title func(*ui.Context)
Header func(*ui.Context)
// Close handles the scoped Close Tab action, including when it is a no-op.
Close func(*ui.Context)
}
WorkspaceSlots are a native page's current frame: the Shell places the navigation, details and header slots and owns their sizing and folding.
type WorkspaceTerminal ¶
type WorkspaceTerminal struct {
ID string `json:"id"`
Title string `json:"title,omitempty"`
// contains filtered or unexported fields
}
WorkspaceTerminal is an independent terminal surface in the main workspace. The Node owns its process; this record only keeps its presentation open.
Source Files
¶
- activity.go
- app_actions.go
- closing.go
- demo.go
- file_save.go
- git_workspace.go
- header.go
- hosts.go
- installations.go
- knowledge.go
- link_contributions.go
- link_services.go
- links.go
- live.go
- menu.go
- native_pages.go
- native_panes.go
- native_resources.go
- notifications.go
- overview.go
- pages.go
- pane_keys.go
- panels.go
- panes.go
- permissions.go
- plugin_workspace.go
- prefs.go
- project.go
- project_workflows.go
- rail.go
- search.go
- selection.go
- shell.go
- shortcuts.go
- transfers.go
- usage.go
- view_zoom.go
- welcome.go
- workspace_groups.go
- workspace_terminals.go