Skip to content

Add terminal capability/palette and live viz primitives; integrate into format and tests#1807

Merged
nmaguiar merged 7 commits intot8from
codex/plan-new-terminal-256-color-visualization-functions
Apr 23, 2026
Merged

Add terminal capability/palette and live viz primitives; integrate into format and tests#1807
nmaguiar merged 7 commits intot8from
codex/plan-new-terminal-256-color-visualization-functions

Conversation

@nmaguiar
Copy link
Copy Markdown
Collaborator

@nmaguiar nmaguiar commented Apr 22, 2026

Motivation

  • Provide a single source for terminal capability detection and palette resolution to enable robust, terminal-first visualizations and reuse across formatters.
  • Add foundational live rendering and diffing primitives to support smooth, low-flicker terminal dashboards and real-time widgets.
  • Adapt existing format helpers to respect resolved terminal dimensions and capabilities for better fallback behavior.

Description

  • Added a new design doc docs/terminal-256-viz-plan.md outlining goals, APIs and phased implementation for terminal 256-color visualizations.
  • Introduced ow.format.term.getCapabilities() and ow.format.term.getPalette() to detect/cached terminal properties and return semantic palettes with overrides and presets.
  • Added visualization utilities under ow.format.viz: diffFrames(), watchResize(), live(), and benchmarkRender() to support frame diffing, resize watching, live rendering loops, and benchmarking.
  • Integrated capability usage into existing helpers by: reading capabilities in ow.format.string.progress() and ow.format.string.grid() to default to terminal dimensions, and added an in-memory live session cache variable.
  • Added unit tests and CI job entries for the new APIs: testTermCapabilities, testVizDiffFrames, and testVizBenchmarkRender, and updated the test workflow YAML to include them.

Testing

  • Executed the format unit tests including the new testTermCapabilities, testVizDiffFrames, and testVizBenchmarkRender cases; all assertions passed.
  • Verified that existing format tests (e.g., padding and date-diff tests) continue to pass after the changes.
  • No failing automated tests were observed for the modified suite.

…ering types

- Update __ansiColorPrep in js/openaf.js to support BG_RGB, FG_RGB, and RGB patterns, handling commas correctly.
- Expand ow.format.string.grid to support new types: sparkline, histogram, progress, md, and text.
- Add comprehensive new tests for sparklines, histograms, dashboards, and grid rendering in tests/autoTestAll.Format.js and .yaml.
Update the <odoc> for ow.format.string.grid to provide a clearer, more structured description of the aMatrix cell map fields and the supported rendering types.
Add printHeatmap, printBullet, printScatter, printBoxplot, printTimeline and printStatusMatrix to ow.format for terminal-based data visualization. Update dashboard cell type documentation and pass through additional cell options (target, ranges, labels, etc.) to support the new renderers.
Adds a `valueFormat` option to `ow.format.printBullet` to format displayed values as raw numbers, SI abbreviations, or byte abbreviations. Includes new unit tests and oJob test registration. Removes accidentally committed vim swap file.
Add `chq` JMESPath custom function to support channel-based queue

operations within `$path`. It allows pushing values with an optional max

size limit, and popping, shifting, sizing, or retrieving all entries

from a named channel. Includes corresponding unit tests.
Update documentation across 5 files to cover the new terminal
visualization layer and channel queue helper:

- docs/index.md — add terminal-256-viz-plan.md reference, update
  section numbers, list new viz and chq features
- docs/llm-guide.md — add chq() usage example and terminal viz
  section with compact renderers and dashboard composition
- docs/openaf-advanced.md — add terminal capability helpers,
  live updates, and viz API overview
- docs/openaf.md — document $path chq() function for channel
  queue push/pop/shift/size/get operations
- docs/terminal-256-viz-plan.md — mark shipped widgets and
  remaining gaps
@nmaguiar nmaguiar marked this pull request as ready for review April 23, 2026 03:30
@nmaguiar nmaguiar merged commit c4f3bb4 into t8 Apr 23, 2026
1 check passed
@nmaguiar nmaguiar deleted the codex/plan-new-terminal-256-color-visualization-functions branch April 23, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant