Documentation
¶
Overview ¶
Package resourceview renders one external resource document in one content box, and a tabbed set of them in one pane leaf.
It is deliberately host-independent. It knows about resource.Document, resource.Reference and resource.Error and nothing about panes, tmux, workspaces, projects, or which of the two terminal surfaces is showing it. The project Workspace and the global Workspaces browser both bind it, and anything that behaves differently between them is a bug rather than a preference.
It is also passive. A provider supplies data, never presentation: no ANSI, no keybindings, no actions, no colors. The one thing a document can do is name a validated http(s) source URL, and even that is opened by the host through its own confirmed path.
Resolution happens elsewhere. The view asks for a reference to be resolved by returning a command the host supplies; it never starts a process itself, which is what keeps process work out of View and Update.
Index ¶
- Constants
- func LayoutTabStrip(t *Tabs, width int, focused bool) tabs.Strip
- func TabKey(ref resource.Reference) string
- type CallsFor
- type Command
- type Host
- type Model
- func (m *Model) AbandonSelection() textselect.Result
- func (m *Model) Accepts(msg ResolvedMsg) bool
- func (m *Model) Apply(msg ResolvedMsg) bool
- func (m *Model) ApplyPluginMsg(msg tea.Msg) (tea.Cmd, bool)
- func (m *Model) Arm(modelID int, ref resource.Reference, epoch uint64)
- func (m *Model) BlocksGlobalKeys() bool
- func (m *Model) Browser() *pluginbrowser.Model
- func (m *Model) ClaimsKey(key string) bool
- func (m *Model) ClearSelection()
- func (m *Model) ConsumesTextInput() bool
- func (m *Model) Document() (resource.Document, bool)
- func (m *Model) Err() *resource.Error
- func (m *Model) FocusRef(ref resource.Reference) tea.Cmd
- func (m *Model) HandlePluginKey(msg tea.KeyPressMsg) (tea.Cmd, bool)
- func (m *Model) HandleSelectionKey(msg tea.KeyMsg) textselect.Result
- func (m *Model) HandleSelectionMouse(action mouse.MouseAction) textselect.Result
- func (m *Model) HasSelection() bool
- func (m *Model) Height() int
- func (m *Model) IsPlugin() bool
- func (m *Model) Load(modelID int, ref resource.Reference, epoch uint64) tea.Cmd
- func (m *Model) ReArm() bool
- func (m *Model) Reference() resource.Reference
- func (m *Model) Refresh() tea.Cmd
- func (m *Model) Refreshing() bool
- func (m *Model) Rekey(identity string)
- func (m *Model) Resolve() tea.Cmd
- func (m *Model) Scroll() int
- func (m *Model) ScrollAtBoundary(delta int) bool
- func (m *Model) ScrollBy(delta int) bool
- func (m *Model) ScrollTo(offset int) bool
- func (m *Model) SelectionCopyCmd(result textselect.Result, wrap func(textselect.CopyNotice) tea.Msg) tea.Cmd
- func (m *Model) SelectionText() []string
- func (m *Model) SetCallsFor(calls CallsFor)
- func (m *Model) SetOpenRow(open OpenRow)
- func (m *Model) SetOrigin(x, y int)
- func (m *Model) SetPendingScroll(scroll int)
- func (m *Model) SetResolver(resolve Resolver)
- func (m *Model) SetSelection(keys textselect.Keys, copyOnSelect bool)
- func (m *Model) SetSize(width, height int)
- func (m *Model) SourceURL() string
- func (m *Model) State() State
- func (m *Model) TabLabel() string
- func (m *Model) Title() string
- func (m *Model) View() string
- func (m *Model) Width() int
- type OpenRow
- type OpenRowMsg
- type Pane
- func (p *Pane) Activate(ref Ref) tea.Cmd
- func (p *Pane) ActivateFromTerminal(ref Ref) tea.Cmd
- func (p *Pane) Apply(msg ResolvedMsg) bool
- func (p *Pane) CloseActiveTab() (empty bool, cmd tea.Cmd)
- func (p *Pane) CloseTab(i int) (empty bool, cmd tea.Cmd)
- func (p *Pane) CycleTab(delta int) tea.Cmd
- func (p *Pane) HandleKey(key string) (handled bool, cmd tea.Cmd)
- func (p *Pane) OpenSource() tea.Cmd
- func (p *Pane) ReArmPending() int
- func (p *Pane) Refresh() tea.Cmd
- func (p *Pane) Scroll(delta int) bool
- func (p *Pane) ScrollAtBoundary(delta int) bool
- func (p *Pane) SelectTab(i int) tea.Cmd
- type PersistedTab
- type PluginSurface
- type Ref
- type ResolvedMsg
- type Resolver
- type State
- type Surface
- type TabHit
- type TabStrip
- type Tabs
- func (t *Tabs) Active() *Model
- func (t *Tabs) ActiveIndex() int
- func (t *Tabs) All() []*Model
- func (t *Tabs) Apply(msg ResolvedMsg) bool
- func (t *Tabs) Arm(ref resource.Reference, scroll int) *Model
- func (t *Tabs) At(i int) *Model
- func (t *Tabs) BlocksGlobalKeys() bool
- func (t *Tabs) ClaimsKey(key string) bool
- func (t *Tabs) Close(i int) (empty bool)
- func (t *Tabs) CloseActive() (empty bool)
- func (t *Tabs) ConsumesTextInput() bool
- func (t *Tabs) Cycle(delta int) tea.Cmd
- func (t *Tabs) Empty() bool
- func (t *Tabs) HandlePluginKey(key string) (tea.Cmd, bool)
- func (t *Tabs) Labels() []string
- func (t *Tabs) Len() int
- func (t *Tabs) Next() tea.Cmd
- func (t *Tabs) Open(ref resource.Reference) tea.Cmd
- func (t *Tabs) Prev() tea.Cmd
- func (t *Tabs) ReArmPending() int
- func (t *Tabs) References() []PersistedTab
- func (t *Tabs) RefreshActive() tea.Cmd
- func (t *Tabs) ResolveActive() tea.Cmd
- func (t *Tabs) SetActive(i int) tea.Cmd
- func (t *Tabs) SetCallsFor(calls CallsFor)
- func (t *Tabs) SetEpoch(epoch uint64)
- func (t *Tabs) SetOpenRow(open OpenRow)
- func (t *Tabs) SetResolver(resolve Resolver)
- func (t *Tabs) SetSize(width, height int)
- func (t *Tabs) UpdatePlugins(msg tea.Msg) (tea.Cmd, bool)
- func (t *Tabs) View() string
Constants ¶
const ( CommandRefresh = "refresh" CommandOpenSource = "open-source" CommandPrevTab = "prev-tab" CommandNextTab = "next-tab" CommandCloseTab = "close-tab" )
Stable command IDs for a Resource leaf. They are declared here, not derived per host, because the footer resolves a hint's key through the keymap by ID: two hosts inventing their own IDs is two surfaces advertising different keys for one pane. They follow the vocabulary the other panes already use — prev-tab/next-tab rather than one combined "{/}" command, which is a rule TestBracesAlwaysMeanTabCycling enforces repo-wide.
const MaxTabs = 16
MaxTabs bounds one Resource leaf. Clicking keys forever must cost bounded memory and a bounded tab strip; past the bound the oldest unfocused tab is dropped rather than refusing the user's click.
Variables ¶
This section is empty.
Functions ¶
func LayoutTabStrip ¶
LayoutTabStrip is the Resource leaf's header row. Both hosts draw this and register their hit regions from the same result, so a click cannot land on a tab that was never rendered.
func TabKey ¶
TabKey is the stable identity of one tab before anything is fetched. The same locator from two plugins is two resources, so the instance is always part of the key, and the shape is part of it too so a collection and a row of that collection can never collide.
A collection tab's identity is deliberately {instance, collection} and nothing more: the query, view, sort and cursor are view position, so retyping a query re-lists the tab that is already open rather than forking a second.
Types ¶
type CallsFor ¶ added in v1.14.0
type CallsFor func(instance string) pluginbrowser.Calls
CallsFor is how a surface hands a Model the seam its plugin is reached through. It is a function of the instance because one leaf's tabs may belong to different plugins, and a Model must not have to know which.
type Command ¶
Command is one footer hint. ID is the keymap command the host registers under; Key is the default binding it documents.
type Host ¶
type Host interface {
// FocusLeaf moves focus to the leaf holding this pane. It is called on
// every activation, including one that only focuses an existing tab.
FocusLeaf()
// EnterFromTerminal is the ritual a click in terminal output owes before
// a new leaf appears: clear the selection, leave interactive input, and
// freeze the terminal viewport so the pre-click context survives the
// tmux resize. A surface with no live terminal implements it as a no-op.
EnterFromTerminal()
// Persist records reference-only tab state. The global surface implements
// it as a no-op; that difference is the intended one.
Persist()
// OpenURL puts a validated http(s) URL in front of the user through the
// host's own confirmed path.
OpenURL(url string) tea.Cmd
}
Host is everything a Resource leaf needs from the surface showing it, and deliberately nothing more. Each method is a place the project Workspace and the global Workspaces browser genuinely differ:
- the project has a pane tree with leaf IDs; the global has one preview slot;
- the project persists references to disk; the global is memory-only by design, matching its document/issue/diff lifetime;
- only the project has a live tmux pane to abandon and an interactive input mode to leave.
Everything that does NOT differ lives on Pane below, so neither surface can answer a resource key differently from the other by accident.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is one resource reference in one content box.
func (*Model) AbandonSelection ¶ added in v1.14.0
func (m *Model) AbandonSelection() textselect.Result
AbandonSelection ends a gesture whose release never arrived.
func (*Model) Accepts ¶
func (m *Model) Accepts(msg ResolvedMsg) bool
Accepts reports whether a result belongs to this model's current request. A host still applies its own surface and epoch checks; this is the part every host would otherwise have written for itself.
func (*Model) Apply ¶
func (m *Model) Apply(msg ResolvedMsg) bool
Apply lands a resolve result. It returns false when the message does not belong to this model's current request, which is the normal outcome for a superseded refresh or a closed-and-reopened tab.
func (*Model) ApplyPluginMsg ¶ added in v1.14.0
ApplyPluginMsg routes one of the browser's own messages to a plugin-shaped tab, reporting whether it belonged here. The browser discards a message for another instance or a superseded generation itself, which is what makes broadcasting them safe.
func (*Model) Arm ¶
Arm points the model at a reference without resolving it. A restored tab starts here so that opening Sidecar does not fan out one process per tab.
func (*Model) BlocksGlobalKeys ¶ added in v1.14.0
BlocksGlobalKeys reports that a plugin tab has an overlay open.
func (*Model) Browser ¶ added in v1.14.0
func (m *Model) Browser() *pluginbrowser.Model
Browser is the pane-mode browser behind a plugin-shaped tab, or nil. Hosts use it for the few things only the browser can answer — whether it has the keyboard, whether an overlay is open — and never to re-render it.
func (*Model) ClaimsKey ¶ added in v1.14.0
ClaimsKey reports whether a plugin-shaped tab would act on a key. A matched document claims nothing here: its keys are the Pane's.
func (*Model) ClearSelection ¶ added in v1.14.0
func (m *Model) ClearSelection()
ClearSelection drops the selection and any gesture editing it.
func (*Model) ConsumesTextInput ¶ added in v1.14.0
ConsumesTextInput reports that a plugin tab's query line has the keyboard.
func (*Model) FocusRef ¶ added in v1.14.0
FocusRef points an already-open tab at a reference that names the SAME tab with a different view position, and starts whatever that needs.
It is what makes `sidecar open --plugin recall --collection results --query dex` mean the same thing whether or not that collection is already open: the tab's identity is deliberately just {instance, collection}, so a second open focuses it, and without this the query the user asked for would be dropped on the floor by the focus.
func (*Model) HandlePluginKey ¶ added in v1.14.0
HandlePluginKey offers a key to a plugin-shaped tab, reporting whether the browser consumed it.
func (*Model) HandleSelectionKey ¶ added in v1.14.0
func (m *Model) HandleSelectionKey(msg tea.KeyMsg) textselect.Result
HandleSelectionKey answers the chords that act on the selection: copy, select-all, and escape.
func (*Model) HandleSelectionMouse ¶ added in v1.14.0
func (m *Model) HandleSelectionMouse(action mouse.MouseAction) textselect.Result
HandleSelectionMouse advances the gesture over the card and reports what the host owes for it. A drag that has run past an edge scrolls the card here rather than in the host: the window it is asking for is this model's own.
func (*Model) HasSelection ¶ added in v1.14.0
HasSelection reports whether anything in this card is selected.
func (*Model) IsPlugin ¶ added in v1.14.0
IsPlugin reports that this tab is one of the plugin shapes, so the host is looking at the shared browser rather than the resource card.
func (*Model) Load ¶
Load resolves the reference, replacing whatever the model was showing. It bumps the generation, so any answer already in flight is stale on arrival.
func (*Model) ReArm ¶
ReArm returns a tab that is waiting on an answer nobody will deliver to the armed state, and reports whether it changed anything.
A host discards a result whose surface, workspace row, or project epoch no longer matches. That is correct — but without this the tab it belonged to sits on a loading card forever, because the answer that would have cleared it was thrown away. Re-arming bumps the generation, so the discarded answer can never land afterwards either, and the card goes back to saying the tab is remembered and can be resolved with r.
func (*Model) Reference ¶
Reference is what this tab points at. For a collection tab it carries the live view position, so what a host persists is what the user can see.
func (*Model) Refresh ¶
Refresh re-resolves, bypassing freshness. Scroll and the last good document are preserved: a transient failure must not blank a card the user is reading.
func (*Model) Refreshing ¶
Refreshing reports an in-flight resolve over an existing document.
func (*Model) Rekey ¶
Rekey adopts the provider-stable identity a response supplied. The provider instance is never allowed to change: a response may say what a resource is called, not who owns it.
func (*Model) Resolve ¶
Resolve starts a resolve for an armed tab, and is a no-op for one that is already loading or resolved. Selecting a restored tab calls this.
func (*Model) ScrollAtBoundary ¶
ScrollAtBoundary reports whether a scroll of delta would move nothing, which is how a host decides to hand a wheel event to whatever is underneath instead of swallowing it. The doc, issue and diff viewers all answer this; without it a host has to probe by scrolling and undoing.
func (*Model) ScrollBy ¶
ScrollBy moves the viewport and reports whether anything moved, so a host can decide whether the wheel event was consumed.
func (*Model) SelectionCopyCmd ¶ added in v1.14.0
func (m *Model) SelectionCopyCmd(result textselect.Result, wrap func(textselect.CopyNotice) tea.Msg) tea.Cmd
SelectionCopyCmd delivers the copy an engine result asked for, phrased by the shared pipeline and wrapped in whatever notification type the host uses.
func (*Model) SelectionText ¶ added in v1.14.0
SelectionText is the selection as the user sees it: the rows it covers, without the styling they were drawn with.
func (*Model) SetCallsFor ¶ added in v1.14.0
SetCallsFor injects the plugin seam. Like SetResolver it may arrive after the tab was armed, because the host's describe pass finishes well after restore.
func (*Model) SetOpenRow ¶ added in v1.14.0
SetOpenRow injects what Enter on a row does.
func (*Model) SetOrigin ¶ added in v1.14.0
SetOrigin records where the host last drew this card, in the coordinate space its mouse events arrive in. A card that has not been drawn has no origin, so it hit-tests as empty rather than as the top-left corner of the screen.
func (*Model) SetPendingScroll ¶
SetPendingScroll records a restored scroll offset to apply once there is something to scroll.
func (*Model) SetResolver ¶
SetResolver replaces the host resolver used by subsequent loads. Existing armed tabs must observe provider setup that finishes after pane construction.
func (*Model) SetSelection ¶ added in v1.14.0
func (m *Model) SetSelection(keys textselect.Keys, copyOnSelect bool)
SetSelection binds the host's shared selection settings: the chords the card answers, and whether finishing a drag copies without being asked.
func (*Model) SetSize ¶
SetSize records the content box. The body is re-rendered lazily on the next View, because a resize during a drag would otherwise re-run the markdown renderer on every frame of the drag.
func (*Model) SourceURL ¶
SourceURL is the one action a document can offer, already validated as http(s) by the document sanitizer.
func (*Model) TabLabel ¶
TabLabel is what the tab strip shows: the locator, which is stable from the moment of the click, rather than a title that appears a moment later and makes the strip jump.
type OpenRow ¶ added in v1.14.0
OpenRow is what Enter on a collection row does: the host opens the row as a second tab in the same leaf. A Model does not own the strip, so it asks.
type OpenRowMsg ¶ added in v1.14.0
OpenRowMsg is the default ask, and the reason both surfaces behave the same: a Model has no leaf, no placement and no deck, so Enter on a row emits this and whichever surface is showing the pane runs its OWN open journey with it. That journey already focuses an open tab rather than fetching it twice, which is what makes the second Enter free.
type Pane ¶
type Pane struct {
Tabs *Tabs
// contains filtered or unexported fields
}
Pane is the host-independent behavior of one Resource leaf: what a click does, what the documented keys do, and when state is persisted.
Both surfaces own a Pane and implement Host. A binding that reimplements one of these methods instead of calling it is the drift this type exists to prevent.
func (*Pane) Activate ¶
Activate opens or focuses a tab without the terminal ritual. This is the `sidecar open --provider` path: there was no click in terminal output, so there is no selection to clear and no viewport to freeze.
func (*Pane) ActivateFromTerminal ¶
ActivateFromTerminal is the click journey: the terminal ritual first, then focus, then open-or-focus the tab, then persist. The order matters — the viewport must be frozen before the new leaf resizes tmux — and getting it right once here is the point.
func (*Pane) Apply ¶
func (p *Pane) Apply(msg ResolvedMsg) bool
Apply routes a resolve result and persists the outcome, since a canonical re-key changes what should be on disk.
func (*Pane) CloseActiveTab ¶
CloseActiveTab closes the focused tab and reports whether the leaf is now empty, which is the host's cue to collapse the split.
func (*Pane) CloseTab ¶ added in v1.3.0
CloseTab closes the tab at index through the same last-tab empty report.
func (*Pane) HandleKey ¶
HandleKey answers the documented Resource-pane keys. It deliberately does NOT claim q or esc: those follow each surface's existing content-pane close/hide rule, which is the one key behavior that legitimately differs.
handled=false means the host should keep looking.
func (*Pane) OpenSource ¶
OpenSource opens the active document's validated source URL. A document without one, or a tab that has not resolved, does nothing.
func (*Pane) ReArmPending ¶
ReArmPending is the counterpart to a host discarding results in bulk. Call it wherever results stop being routed — a workspace row switch, a project change — so a tab is never stranded on a loading card.
func (*Pane) ScrollAtBoundary ¶
ScrollAtBoundary reports whether a scroll of delta would move the active tab.
type PersistedTab ¶
type PersistedTab struct {
Provider string
Matcher string
Locator string
Collection string
Query string
View string
Sort string
CursorID string
Filters map[string]string
Scroll int
}
PersistedTab is one reference plus its scroll. It mirrors the state package's JSON shape without this package depending on state, so the view layer stays free of persistence concerns. Collection and the view position beside it are set only on a plugin-shaped tab.
func (PersistedTab) Equal ¶ added in v1.14.0
func (t PersistedTab) Equal(other PersistedTab) bool
equal compares two persisted tabs. It is spelled out because a tab carries an applied filter map, which makes the struct uncomparable with ==; every field still takes part, so a save that changed only a filter is still a save.
type PluginSurface ¶ added in v1.14.0
type PluginSurface interface {
// SetPluginCalls injects how a collection or row tab reaches its plugin,
// and returns the work that injection starts. A tab restored before any
// describe pass had run is armed and waiting for exactly this.
SetPluginCalls(CallsFor) tea.Cmd
}
PluginSurface is what the app injects the protocol-plugin seam into. It is declared here rather than in the app, and asserted by each surface, for the reason Surface gives: an assertion that quietly fails is a collection pane that never lists anything, with nothing to debug.
type Ref ¶
Ref is the resource reference a tab points at. It is aliased rather than redeclared so a reference built by the scanner, restored from disk, or parsed from a CLI request is the same type everywhere.
func ReferenceForLocator ¶
func ReferenceForLocator(matchers []terminallink.ResourceMatcher, provider, locator string) (Ref, string)
ReferenceForLocator chooses the first live matcher from provider whose whole match is locator. UI requests intentionally carry no matcher ID: the running app is the authority for the provider snapshot and its declared precedence.
func ReferenceForRequest ¶ added in v1.14.0
func ReferenceForRequest(matchers []terminallink.ResourceMatcher, provider, matcher, collection, query, value string, filters map[string]string) (Ref, string)
ReferenceForRequest builds the reference a request names, choosing the shape from the fields it carries rather than from which surface is asking.
It exists so both workspace projections resolve `sidecar open` and a layout spec identically. A collection is a plugin tab and consults no matcher: there is no span a matcher could have claimed, and a row is addressed by its collection and ID. Everything else is today's matched locator, and a locator no live matcher recognizes is refused out loud rather than opened blind.
type ResolvedMsg ¶
type ResolvedMsg struct {
ModelID int
Generation uint64
// Epoch is the host's own scoping value, carried through untouched.
Epoch uint64
// Ref is the reference that was requested, before any canonical re-key.
Ref resource.Reference
Document resource.Document
Err error
// Refresh marks a result produced by Refresh rather than the first load,
// so a failure can leave the last good document on screen.
Refresh bool
}
ResolvedMsg is the result of one resolve. Its identity fields are what stop a late answer from landing in a closed, retargeted, or foreign tab: the host adds its own surface and epoch scoping on top.
func (ResolvedMsg) GetEpoch ¶
func (m ResolvedMsg) GetEpoch() uint64
GetEpoch lets hosts run their normal epoch check without unwrapping.
type Resolver ¶
type Resolver func(modelID int, generation, epoch uint64, ref resource.Reference, refresh bool) tea.Cmd
Resolver is how the view asks the host to resolve a reference. The host owns the manager, the process, the timeout and the cancellation; the view owns only when to ask and what to do with the answer.
refresh bypasses cache freshness. The returned command must eventually produce a ResolvedMsg carrying the same identity fields it was given.
epoch is the host's own scoping value, passed through so the model stamps it rather than every host wrapping the resolver to do the same thing.
type State ¶
type State int
State is what the view is showing right now.
const ( // StateArmed is a reference that has never been resolved: a restored tab // that has not been selected, or one whose provider is not ready yet. It // is not an error and must never be pruned as though it were. StateArmed State = iota // StateLoading is a resolve in flight with nothing to show behind it. StateLoading // StateReady is a resolved document. StateReady // StateError is a typed failure with no document behind it. StateError )
type Surface ¶
type Surface interface {
// SetResourceMatchers publishes the live matcher snapshot. An empty slice
// is meaningful: it is how output goes back to being ordinary text.
SetResourceMatchers([]terminallink.ResourceMatcher)
// SetResourceResolver injects how a reference becomes a document, and
// returns the work that injection starts.
//
// Returning a command is the point, not a convenience. A tab restored
// before any provider was ready is armed, and its card promises it resolves
// when the provider reports ready. Readiness arrives here and nowhere else,
// so a surface that only rebound its tabs would leave that promise unkept
// and the user re-resolving every tab by hand after each relaunch. A
// surface with nothing on screen waiting returns nil.
SetResourceResolver(Resolver) tea.Cmd
}
Surface is what the app injects provider state into. It is declared here rather than in the app so each surface can assert it at compile time:
var _ resourceview.Surface = (*Plugin)(nil)
The app reaches surfaces through a type assertion, and an assertion that quietly fails is a surface that never receives a matcher — the pane would simply never appear, with nothing to debug. The assertion in each package is what turns that into a build error.
type Tabs ¶
Tabs is the tabbed set of resource references in one Resource leaf.
Ordering, cycling, close semantics and the overflow window come from tabs.Group, the same generic the file and issue strips use. What this type adds is only what is specific to resources: keys built from references, arming without resolving, routing an answer to the tab that asked, and the canonical re-key that merges two tabs naming one resource.
func (*Tabs) ActiveIndex ¶
ActiveIndex is the focused tab's position, which the host persists.
func (*Tabs) Apply ¶
func (t *Tabs) Apply(msg ResolvedMsg) bool
Apply routes a resolve result to the tab that asked for it, applies any canonical re-key, and merges a tab that has just become a duplicate.
It returns false when no open tab owns the message, which is the correct outcome for a result arriving after its tab was closed.
func (*Tabs) Arm ¶
Arm appends a tab without resolving it. Restore uses this so relaunch does not fan out one process per remembered tab.
func (*Tabs) BlocksGlobalKeys ¶ added in v1.14.0
BlocksGlobalKeys reports that the active tab has an overlay owning the keyboard — the View control or an action form. A host asks it at precedence level 2, beside its own modal question, so those keys reach the overlay rather than the host's global switch.
func (*Tabs) ClaimsKey ¶ added in v1.14.0
ClaimsKey reports whether the active tab would act on a key. It is what a host's key ladder asks before running its own shortcut.
func (*Tabs) Close ¶
Close removes the tab at index and reports whether the leaf is now empty. Closing is the user's explicit act, and with a confirmed cleanup it is the only thing that may drop a reference.
func (*Tabs) CloseActive ¶
CloseActive removes the focused tab.
func (*Tabs) ConsumesTextInput ¶ added in v1.14.0
ConsumesTextInput reports that the active tab's query line has the keyboard.
func (*Tabs) HandlePluginKey ¶ added in v1.14.0
HandlePluginKey offers a key to the active tab when it is plugin-shaped. It takes the key as a string because that is the vocabulary Pane.HandleKey is written in and the surfaces call it with.
func (*Tabs) Open ¶
Open focuses an existing tab for ref, or appends a new one and resolves it. It is the single entry point for a terminal click, a restored tab being selected, and `sidecar open --provider`, so all three behave identically.
func (*Tabs) ReArmPending ¶
ReArmPending returns every tab waiting on an answer the host has decided to discard back to a resolvable state, and reports how many changed. A host calls this when it drops results wholesale — a workspace row switch, a project change — so no tab is left on a loading card forever.
func (*Tabs) References ¶
func (t *Tabs) References() []PersistedTab
References is the reference-only projection the project surface persists: no title, field, body, error, URL, or auth state, by construction rather than by remembering to strip them.
func (*Tabs) RefreshActive ¶
RefreshActive re-resolves the active tab, bypassing freshness.
func (*Tabs) ResolveActive ¶
ResolveActive starts the active tab's resolve if it is still armed.
func (*Tabs) SetActive ¶
SetActive focuses a tab by index and resolves it if it is still armed. Selecting is what turns a restored reference into a request, which is the behavior both hosts need and neither should re-derive.
func (*Tabs) SetCallsFor ¶ added in v1.14.0
SetCallsFor injects how a plugin-shaped tab reaches its plugin, for this set and every tab already in it.
func (*Tabs) SetOpenRow ¶ added in v1.14.0
SetOpenRow injects what Enter on a collection row does. The default is this set's own: open the row as a second tab in the same leaf, which is the behaviour both surfaces owe and neither should re-derive.
func (*Tabs) SetResolver ¶
SetResolver replaces the resolver for this set and every existing tab. Provider setup is asynchronous, so resolver injection must not depend on whether a restored or clicked tab happened to be constructed first.
func (*Tabs) SetSize ¶
SetSize sizes every tab, because a tab selected later must already know the box it will be drawn into.
func (*Tabs) UpdatePlugins ¶ added in v1.14.0
UpdatePlugins routes one of the shared browser's messages to every plugin-shaped tab, reporting whether any of them owned it. Each browser discards a message for another instance or a superseded generation itself.