Skip to content

Context stackPro

An Oxyn original: the window as a pile of slabs under the line where it compacts by itself; each turn thickens the chat until it is pressed into a summary.

oxyn add context-stack
Context stack166.4K / 200K · 83%
  • Chat96.4K
  • Files38.2K
  • Memory5.3K
  • Tools18.9K
  • System7.6K

The code is part of Oxyn Pro

The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.

Get Pro

Rendered from Rust at build time · goes live when visible

When to use

  • Make compaction physical: the window is a pile, the chat is the top slab, and there is a line it may not cross.

When not to use

  • The context window as one stacked bar or a field of dots, with a legend that lights each kind and a Compact / Undo button: use Context bar instead.
  • What fills the window as a list of kinds with their share: use Context breakdown instead.
  • An Oxyn original: use Context tide instead.

Installation

Context stack is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.

Terminal
oxyn add context-stack

Usage

Dioxus · rust
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Examples

Default

Slabs from system (bottom) to chat (top); add turns until the chat crosses the dashed line and is pressed into a summary.

Context stack166.4K / 200K · 83%
  • Chat96.4K
  • Files38.2K
  • Memory5.3K
  • Tools18.9K
  • System7.6K

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Early line

The line at 85 %: one more turn compacts it.

Context stack166.4K / 200K · 83%
  • Chat96.4K
  • Files38.2K
  • Memory5.3K
  • Tools18.9K
  • System7.6K

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

Mono

Monochrome slabs with big turns.

Context stack166.4K / 200K · 83%
  • Chat96.4K
  • Files38.2K
  • Memory5.3K
  • Tools18.9K
  • System7.6K

Code Pro
The code is part of Oxyn Pro

The preview is free. Pro opens the code of every Pro component, screen and template.

Get Pro

API reference

ContextStack

PropTypeDefaultDescription
partsOption<Vec<CtxPart>>Default::default()The parts (the demo window when `None`).
limitu32200_000Window size in tokens.
autou3292Auto-compact threshold in percent.
per_turnu326_000Tokens one turn adds.
heightf32232.0Column height in px.
monoboolDefault::default()Greys instead of kind colours.
on_compactEventHandler<bool>—Compacted (automatically when `true`).

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
TabAdd a turn, Compact, Reset

Accessibility

  • The column is an image labelled with the used tokens and percent; the legend repeats every kind as text.
  • Each action says the new state in a status line, including an automatic compaction.

Responsive behaviour

  • 340 px card; the legend takes the width the column leaves.
Edge cases (spec)

340 px card; the legend takes what the column leaves.

Notes for AI

  • Import ContextStack from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: ContextStackEl in oxyn_gpui.
  • Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI