assembly

package
v1.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package assembly owns the ordered catalog of plugins sidecar can host, and therefore the tab order.

It exists so tab order is data rather than the sequence of `if enabled { register(...) }` statements it used to be in cmd/sidecar/main.go. Descriptors is that data; Plan is a pure function of it plus config and feature flags, so every enabled/disabled combination is unit-testable without booting the application.

It lives under internal/plugins rather than internal/app because the plugin packages themselves import internal/app; an assembly there would be an import cycle. That is also why internal/app keeps its own list of the global-scope descriptors: it cannot import this package, and an assembly test pins the two lists together.

Index

Constants

View Source
const (
	IDTDMonitor     = "td-monitor"
	IDGitStatus     = "git-status"
	IDFileBrowser   = "file-browser"
	IDConversations = "conversations"
	IDWorkspace     = "workspace-manager"
	IDNotes         = "notes"
	IDTasks         = "tasks"
)

Plugin IDs used as ordering anchors. They mirror each plugin's own ID().

Variables

View Source
var WheelBoundaryRegistry = []WheelBoundarySurface{
	{
		ID:          IDWorkspace,
		Surface:     "Workspaces sidebar, docs/issues, diffs, commit files, terminal scrollback, plugin modals",
		Policy:      WheelCovered,
		Probe:       (*workspace.Plugin)(nil),
		HostsModals: true,
		Note:        "Panes answer exactly; tmux panes with mouse reporting and unexhausted scrollback stay unknown by design.",
	},
	{
		ID:          IDGitStatus,
		Surface:     "Git status tree, diff pane, commit preview, full diff, plugin modals",
		Policy:      WheelCovered,
		Probe:       (*gitstatus.Plugin)(nil),
		HostsModals: true,
	},
	{
		ID:          IDFileBrowser,
		Surface:     "File tree, file preview, plugin modals",
		Policy:      WheelCovered,
		Probe:       (*filebrowser.Plugin)(nil),
		HostsModals: true,
		Note:        "Inline editor overlays forward: the embedded tmux editor owns that wheel stream.",
	},
	{
		ID:          IDNotes,
		Surface:     "Notes list, markdown preview, plugin modals",
		Policy:      WheelCovered,
		Probe:       (*notes.Plugin)(nil),
		HostsModals: true,
		Note:        "Textarea edit mode and the inline tmux editor stay unknown until their owners expose exact bounds.",
	},
	{
		ID:          "global-workspaces",
		Surface:     "Global Workspaces overview: sidebar, doc/issue tabs, diff/task tabs, terminal preview, activity board",
		Policy:      WheelCovered,
		Probe:       nil,
		HostsModals: false,
		Note:        "Answered by overview.WorkspacesWheelAtBoundary and BoardWheelAtBoundary; rename/view flyouts forward.",
	},
	{
		ID:          "notification-centre",
		Surface:     "App-shell notification centre panel",
		Policy:      WheelCovered,
		Probe:       nil,
		HostsModals: false,
		Note:        "Answered by app.notificationCentreWheelAtBoundary from FilterInput before the plugin underneath.",
	},
	{
		ID:          IDTDMonitor,
		Surface:     "Embedded td monitor panels, detail scroll, and td-owned modals",
		Policy:      WheelExternallyOwned,
		Probe:       (*tdmonitor.Plugin)(nil),
		HostsModals: true,
		Note:        "Awaiting the upstream td read-only boundary contract (plan Phase 4). Sidecar must not inspect td's private state; the Sidecar setup modal is on Sidecar's modal contract.",
	},
	{
		ID:          "tasks-project",
		Surface:     "Project Tasks plugin, embedded Tasks model",
		Policy:      WheelExternallyOwned,
		Probe:       (*tasks.Plugin)(nil),
		HostsModals: true,
		Note:        "Awaiting the upstream Tasks embedding boundary contract (plan Phase 4).",
	},
	{
		ID:          "tasks-global",
		Surface:     "Global Tasks tab, same Tasks plugin instance selected through globalTasksPlugin()",
		Policy:      WheelExternallyOwned,
		Probe:       (*tasks.Plugin)(nil),
		HostsModals: true,
		Note:        "app.FilterInput takes a distinct global branch; it already delegates whenever the Tasks plugin implements the contract.",
	},
	{
		ID:          IDConversations,
		Surface:     "Conversations sidebar, turn/message panes, detail view, resume-session modal",
		Policy:      WheelDeprecatedExclusion,
		Probe:       (*conversations.Plugin)(nil),
		HostsModals: true,
		Note:        "Deprecated, default-off, expected to be removed. Named exclusion, not an oversight: if it is undeprecated, update the plan inventory first, then cover its cursor sidebar, detailScroll bounds, hasMoreSessions lazy exception, and resume modal.",
	},
}

WheelBoundaryRegistry is the explicit, auditable list of every Sidecar surface that receives wheel input, with its declared boundary policy.

A new wheel-handling plugin or modal host must be added here; the tests in wheel_boundary_registry_test.go fail when a registered plugin has no row, when a "covered" row does not implement plugin.WheelBoundaryConsumer, or when an excluded row silently starts implementing it without being reclassified.

App-level overlays are not listed here: each tea ModalKind has its own row in internal/app/modal_wheel_boundary_test.go, enforced by TestEveryModalKindHasALedgerRow.

Functions

func ConversationsWanted added in v0.97.0

func ConversationsWanted(cfg *config.Config) bool

ConversationsWanted reports whether the Conversations plugin should be registered and whether history adapters should be constructed.

Both the conversations_plugin feature flag and plugins.conversations.enabled must be true. When false, Sidecar must not construct adapters, run Detect, open session-store watchers, or show the Conversations tab.

func Descriptors added in v1.14.0

func Descriptors() []plugin.Descriptor

Descriptors is every plugin Sidecar can host, in the order the header paints them: the project tabs first, in tab order, then the global-space tabs.

It is the one list the tab assembly, the settings page, and `sidecar plugin list` read. A plugin that is not here does not exist as far as Sidecar is concerned, whether or not its package compiles.

func GlobalDescriptors added in v1.14.0

func GlobalDescriptors(cfg *config.Config) []plugin.Descriptor

GlobalDescriptors returns the enabled global-scope tab descriptors, in header order. internal/app builds one host per entry.

func NotesWanted added in v1.2.0

func NotesWanted(cfg *config.Config) bool

NotesWanted reports whether the Notes surface belongs in the project tab ring. td owns Notes persistence, so disabling the existing td panel also hides Notes without rewriting the user's independent Notes preference.

func Register

func Register(reg *plugin.Registry, cfg *config.Config, logger *slog.Logger)

Register registers the planned plugins with the registry, in order. Registration failures degrade silently (the registry records them as unavailable); anything unexpected is logged.

Types

type Entry

type Entry struct {
	ID  string
	New func() plugin.Plugin
}

Entry is one plugin slot in tab order. New is deferred so Plan stays free of plugin construction and callers that only care about order (tests, tooling) never build a plugin.

func Plan

func Plan(cfg *config.Config) []Entry

Plan returns the project plugins to register, in tab order.

Tab shortcut numbers are derived from this list. Nothing may assume a plugin occupies a fixed position: any of the preceding plugins can be disabled.

Global-scope descriptors are deliberately absent. Tasks is the standing example: registering it here would put its store, session, and agent queue back under registry.Reinit, which rebuilt the whole Tasks model on every project switch.

type WheelBoundaryPolicy added in v1.0.0

type WheelBoundaryPolicy string

WheelBoundaryPolicy classifies how a wheel-handling surface answers the pre-update boundary question asked by app.FilterInput:

"Would this exact wheel event change the surface under the pointer?"

See docs/plans/active/scroll-inertia-complete-coverage.md.

const (
	// WheelCovered means the surface implements plugin.WheelBoundaryConsumer
	// and answers exactly for every region it owns, including its modals.
	WheelCovered WheelBoundaryPolicy = "covered"

	// WheelExternallyOwned means the scroll state belongs to an embedded model
	// from another repository. Sidecar must not approximate its bounds, so the
	// surface stays unfiltered until that upstream exposes a read-only boundary
	// contract (plan Phase 4).
	WheelExternallyOwned WheelBoundaryPolicy = "externally-owned"

	// WheelDeprecatedExclusion means the surface is deliberately out of scope: a
	// deprecated, default-off plugin that is expected to be removed rather than
	// covered. Recorded by name so it is an audited decision, not an oversight.
	WheelDeprecatedExclusion WheelBoundaryPolicy = "deprecated-exclusion"
)

type WheelBoundarySurface added in v1.0.0

type WheelBoundarySurface struct {
	// ID is the plugin ID for project plugins, or a descriptive identifier for
	// a host-owned global surface.
	ID string

	// Surface names the wheel-handling surface in human terms.
	Surface string

	// Policy is the declared boundary policy.
	Policy WheelBoundaryPolicy

	// Probe is a typed nil plugin pointer used for the compile/runtime check
	// that the declared policy matches reality. Nil for surfaces that are not
	// plugins (globals owned by the app shell).
	Probe plugin.Plugin

	// HostsModals records whether the surface owns declarative modals whose
	// wheel input it must answer for as well as its panes.
	HostsModals bool

	// Note explains the policy, especially what evidence would change it.
	Note string
}

WheelBoundarySurface is one declared row of the coverage ledger.

func WheelBoundaryPolicyFor added in v1.0.0

func WheelBoundaryPolicyFor(id string) (WheelBoundarySurface, bool)

WheelBoundaryPolicyFor returns the declared policy for an ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL