Repository navigation
Releases
Releases · cortexkit/opencode-sidebar
v0.3.0
What's new
header.afterBadgeonSidebarFrame. An optional callback whose output sits right after the header badge, before the version, on the same row. Use it for a status marker such as a warning or a second badge.- The frame only places it in the header row, centred beside the badge. It adds no styling, spacing, text fitting or shrink rule. The panel brings its own colours, margin and padding.
- It shows when the panel is collapsed, when it's expanded, and with
collapsible={false}. Clicking it does what clicking the rest of the header does: it toggles a panel that can collapse, and nothing otherwise. - It runs inside the frame, so signals and theme changes update it.
Compatibility
- No breaking changes: every 0.2.0 export and prop keeps its behaviour, and a panel without
afterBadgerenders byte for byte as in 0.2.0. - The peers are unchanged: OpenTUI 0.4.5 or later, and Solid. The package is still checked on OpenTUI 0.4.5 and 0.5.11.
- When the header is too narrow for the badge, marker and version, OpenTUI's own layout decides how the row shrinks or wraps. The frame doesn't cut or fit the marker.
v0.2.0
What's new
Two additions for panels that don't show accounts, such as Magic Context and AFT. Both are optional. A panel that uses neither looks and behaves exactly as in 0.1.0.
collapsibleonSidebarFrame. Without it, the header toggles only when the panel has accounts, as before.collapsible={true}lets a panel without accounts collapse to its header and itscollapsedSections.collapsible={false}keeps any panel expanded.SidebarGaugeRow, a used/left gauge for a value that has no quota windows, such as a context window. It takeslabel, and optionalused(a percentage),value,warnAtanderrorAt.- It draws with the same bar characters, width and colours as a quota row.
warnAtanderrorAtdefault to the frame's thresholds. usedis clamped to 0–100. A missing or non-finite value showsno readingwith no bar.- The optional right-hand value is bold, in normal text.
- When the row is narrow, the right-hand value is cut first, then the bar shrinks or goes, then the label is cut, so the percentage stays visible.
- It draws with the same bar characters, width and colours as a quota row.
Thanks to @iceteaSA for both additions (#1).
Compatibility
- No breaking changes: every 0.1.0 export and prop keeps its behaviour.
- Peers are unchanged: OpenTUI 0.4.5 or later and Solid. The package is still checked on OpenTUI 0.4.5 and 0.5.11.
- Gauge rows on OpenTUI 0.4.5 and 0.5.11: a bar segment that starts empty and fills later now keeps its width. The quota row renderer is unchanged.
v0.1.0
First release
The shared OpenCode sidebar frame that CortexKit plugins draw their panels with, moved out of @cortexkit/common-auth/quota-sidebar. A plugin without quota accounts can now use it without depending on the auth library.
- Components:
SidebarFrame,SidebarSection,SidebarStatRowandSidebarTextRow, with the same look and behaviour as the frame in common-auth 0.33 through 0.42. - One API difference from common-auth's frame: an
AccountViewtakes three values the plugin computes (hasQuota,collapsedQuotaTextandquotaAge) instead of a projected quota. The package formats no quota itself. - Auth plugins are unchanged: they keep using
@cortexkit/common-auth/quota-sidebar. A later common-auth release turns that subpath into a thin layer over this package, with the same exports and props. - Compile it yourself: the package ships TSX source and declarations. Compile it into your plugin's TUI output with the OpenTUI Solid transform, and bind
@opentui/core,@opentui/solidandsolid-jsto the host's runtime. A second Solid copy, or the source loaded uncompiled fromnode_modules, renders once and then stops updating. - Peers:
@opentui/coreand@opentui/solid>=0.4.5,solid-js>=1.9.12 <2. The tests also run against OpenTUI 0.4.5 and 0.5.11.