panebadge

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 3 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 panebadge derives a workspace row's compact layout badge from the pane tree that workspace has persisted.

It exists as one helper rather than two because the project workspace sidebar and the global Workspaces browser ("Sessions") are two projections of one model: a workspace showing two panes on one surface is showing two panes on the other, and a badge that disagreed between the lists would be saying the workspace itself was two different things. The rows keep their own two-line design — this only supplies the glyph they put in the metadata they already render.

Index

Constants

View Source
const (
	// SplitGlyph is a two-pane layout: one workspace, split once.
	SplitGlyph = "◧◨"
	// GridPrefix heads a layout with more panes than a single split, followed
	// by the count, because past two the arrangement stops being something a
	// glyph can draw at this size and the number is the useful part.
	GridPrefix = "⊞"
)

Variables

This section is empty.

Functions

func ContentLeaves

func ContentLeaves(layout *state.PaneLayoutJSON) int

ContentLeaves counts the content panes a persisted tree restores to. A layout that is stored but hidden restores no panes, so it counts as none: the badge says what is on screen, not what is remembered.

func For

func For(wtState state.WorkspaceState, surface string) string

For is the badge for one surface of one project's saved workspace state. It is the call both sidebars make, so neither can reach a different layout for the same row.

func Glyph

func Glyph(panes int) string

Glyph is GlyphFor's rule stated over a bare pane count, so a caller holding a live tree rather than a persisted one badges it the same way.

func GlyphFor

func GlyphFor(layout *state.PaneLayoutJSON) string

GlyphFor is the badge one persisted tree earns: nothing for the single pane every workspace has, the split pair for two, the grid mark and a count beyond.

func ShellSurface

func ShellSurface(tmuxName string) string

ShellSurface is the persisted surface identity of one shell's pane tree.

func WorktreeSurface

func WorktreeSurface(key string) string

WorktreeSurface is the persisted surface identity of one worktree's pane tree, given the key the caller already resolved for it.

func WorktreeSurfaceFor

func WorktreeSurfaceFor(path string) string

WorktreeSurfaceFor is WorktreeSurface for a worktree named only by its path, which is how the global list holds one. It resolves the same key the project surface persists under, so the two lists reach one saved layout rather than two near-misses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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