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) AllPanelTabs() []panel.Tab
- func (a *App) ApplyData(d *viewmodel.Data)
- func (a *App) CancelTerminalClose(id string)
- func (a *App) CloseKnowledge()
- func (a *App) ClosePage() bool
- 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) Do(id string)
- 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) HasWorkspaceTerminal(id string) bool
- func (a *App) KeepWorkspaceTerminal(id string)
- func (a *App) Menu(lang string, send func(id string)) []*mygo.MenuItem
- 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) 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) Reading() *Reading
- func (a *App) RenderResource(c *ui.Context, render func(*panel.Project))
- func (a *App) ReplaceConversationID(before, after string)
- 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) 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) WorkspaceTerminalIDs() []string
- type Assembly
- type Choice
- type CloseDocument
- type CloseRequest
- type ConversationActions
- type ConversationPanel
- type Feature
- type Group
- type Hooks
- type Module
- type NativePage
- type Page
- type PluginWorkspacePrefs
- type Prefs
- type ProjectActions
- type ProjectRepository
- type ProjectTerminal
- type ProviderUI
- type Reading
- type ResourceTarget
- type Shortcut
- type Source
- type Usage
- 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 panel's resource keys follow (panel.Resources).
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)
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 preview 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 page 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) 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) 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) 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) 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) 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 takes t out of the panel that has it, shown or not. A Node acknowledgment of an explicit terminal 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 terminal 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) HasWorkspaceTerminal ¶
HasWorkspaceTerminal reports whether the main workspace owns id's surface.
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) 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) 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) 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) 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) 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.
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) WorkspaceTerminalIDs ¶
WorkspaceTerminalIDs lists the open main terminal surfaces in opening order.
type Assembly ¶
type Assembly struct {
WorkspacePages []NativePage
SettingsPages []settings.NativePage
ProviderUI func(*settings.State) ProviderUI
Locales []fs.FS
}
Assembly selects the optional pages, services, and translations for each window.
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 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
}
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 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
// 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()
// 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
// 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 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)
// Controls draws the controls packages add to the page, after its own.
Controls func(*ui.Context)
}
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 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 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 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
- closing.go
- demo.go
- file_save.go
- header.go
- hosts.go
- installations.go
- knowledge.go
- live.go
- menu.go
- native_pages.go
- notifications.go
- overview.go
- pages.go
- pane_keys.go
- panels.go
- panes.go
- plugin_workspace.go
- prefs.go
- project.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