Files
oh-my-pi/packages/tui/CHANGELOG.md
T
can1357 cc90ed37f8 refactor: extracted padding logic into reusable utility function with optimized buffer allocation
- Extracted manual space padding logic into a reusable `padding()` utility function across all UI components and utilities.
- Optimized padding operations by introducing a pre-allocated 512-space buffer in the `padding()` function to reduce repeated string allocations.
- Updated all imports across 30 files to use the new `padding()` function from pi-tui instead of inline `' '.repeat()` calls.
- Renamed local variables from `padding` to `pad`, `padSize`, `indent`, or `linePad` to avoid naming conflicts with the imported `padding()` function.
- Exported the `padding()` utility function from the tui package index for public use.
2026-01-31 13:36:54 +01:00

13 KiB

Changelog

[Unreleased]

Added

  • Exported padding utility function for creating space-padded strings efficiently

Changed

  • Optimized padding operations across all components to use pre-allocated space buffer for better performance

[9.2.2] - 2026-01-31

Added

  • Added setAutocompleteMaxVisible() configuration (3-20 items)
  • Added image detection to terminal capabilities (containsImage method)
  • Added stdin monitoring to detect stalled input events and log warnings

Changed

  • Improved blockquote rendering with text wrapping in Markdown component
  • Restructured terminal capabilities from interface-based to class-based model
  • Improved table column width calculation with word-aware wrapping
  • Refactored text utilities to use native WASM implementations for strings >256 chars with JS fast path

Fixed

  • Simplified terminal write error handling to mark terminal as dead on any write failure
  • Fixed multi-line strings in renderOutputBlock causing width overflow
  • Fixed slash command autocomplete applying stale completion when typing quickly

Removed

  • Removed TUI layout engine exports from public API (BoxNode, ColumnNode, LayoutNode, etc.)

[8.12.7] - 2026-01-29

Fixed

  • Fixed slash command autocomplete applying stale completion when typing quickly

[8.4.1] - 2026-01-25

Added

  • Added fuzzy match function for autocomplete suggestions

[8.4.0] - 2026-01-25

Changed

  • Added Ctrl+Backspace as a delete-word-backward keybinding and improved modified backspace matching

Fixed

  • Terminal gracefully handles write failures by marking dead instead of exiting the process
  • Reserved cursor space for zero padding and corrected end-of-line cursor rendering to prevent wrap glitches
  • Corrected editor end-of-line cursor rendering assertion to use includes() instead of endsWith()

[8.2.0] - 2026-01-24

Added

  • Added mermaid diagram rendering engine (renderMermaidToPng) with mmdc CLI integration
  • Added terminal graphics encoding (iTerm2/Kitty) for mermaid diagrams with automatic width scaling
  • Added mermaid block extraction and deduplication utilities (extractMermaidBlocks)

Changed

  • Updated TypeScript configuration for better publish-time configuration handling with tsconfig.publish.json
  • Migrated file system operations from synchronous to asynchronous APIs in autocomplete provider for non-blocking I/O
  • Migrated node module imports from named to namespace imports across all packages for consistency with project guidelines

Fixed

  • Fixed crash when terminal becomes unavailable (EIO errors) by exiting gracefully instead of throwing
  • Fixed potential errors during emergency terminal restore when terminal is already dead
  • Fixed autocomplete race condition by tracking request ID to prevent stale suggestion results

[6.8.3] - 2026-01-21

Added

  • Added undo support in the editor via Ctrl+-
  • Added Alt+Delete as a delete-word-forward shortcut
  • Added configurable code block indentation for Markdown rendering
  • Added undo support in the editor via Ctrl+-.
  • Added configurable code block indentation for Markdown rendering.
  • Added Alt+Delete as a delete-word-forward shortcut.

Changed

  • Improved fuzzy matching to handle alphanumeric swaps
  • Normalized keybinding definitions to lowercase internally
  • Improved fuzzy matching to handle alphanumeric swaps.
  • Normalized keybinding definitions to lowercase internally.

Fixed

  • Added legacy terminal support for Ctrl+ symbol key combinations
  • Added legacy terminal support for Ctrl+ symbol key combinations.

[6.8.1] - 2026-01-20

Fixed

  • Fixed viewport tracking after partial renders to prevent autocomplete list artifacts

[5.6.7] - 2026-01-18

Added

  • Added configurable editor padding via editorPaddingX theme option
  • Added setMaxHeight() method to limit editor height with scrolling
  • Added Emacs-style kill ring for text deletion operations
  • Added Alt+D keybinding to delete words forward
  • Added Ctrl+Y keybinding to yank from kill ring
  • Added waitForRender() method to await pending renders
  • Added Focusable interface and hardware cursor marker support for IME positioning
  • Added support for shifted symbol keys in keybindings

Changed

  • Updated tab bar rendering to wrap text across multiple lines when content exceeds available width
  • Expanded Kitty keyboard protocol coverage for non-Latin layouts and legacy Alt sequences
  • Improved cursor positioning with safer bounds checking
  • Updated editor layout to respect configurable padding
  • Refactored scrolling logic for better viewport management

Fixed

  • Fixed key detection for shifted symbol characters
  • Fixed backspace handling with additional codepoint support
  • Fixed Alt+letter key combinations for better recognition

[5.3.1] - 2026-01-15

Fixed

  • Fixed rendering issues on Windows by preventing re-entrant renders

[5.1.0] - 2026-01-14

Added

  • Added pageUp and pageDown key support with selectPageUp/selectPageDown editor actions
  • Added isPageUp() and isPageDown() helper functions
  • Added SizeValue type for CSS-like overlay sizing (absolute or percentage strings like "50%")
  • Added OverlayHandle interface with hide(), setHidden(), isHidden() methods for overlay visibility control
  • Added visible callback to OverlayOptions for dynamic visibility based on terminal dimensions
  • Added pad parameter to truncateToWidth() for padding result with spaces to exact width

Changed

  • Changed OverlayOptions to use SizeValue type for width, maxHeight, row, and col properties
  • Changed showOverlay() to return OverlayHandle for controlling overlay visibility
  • Removed widthPercent, maxHeightPercent, rowPercent, colPercent from OverlayOptions (use percentage strings instead)

Fixed

  • Fixed numbered list items showing "1." for all items when code blocks break list continuity
  • Fixed width overflow protection in overlay compositing to prevent TUI crashes

[4.7.0] - 2026-01-12

Fixed

  • Remove trailing space padding from Text, Markdown, and TruncatedText components when no background color is set (fixes copied text including unwanted whitespace)

[4.6.0] - 2026-01-12

Added

  • Add fuzzy matching module (fuzzyMatch, fuzzyFilter) for command autocomplete
  • Add getExpandedText() to editor for expanding paste markers
  • Add backslash+enter newline fallback for terminals without Kitty protocol

Fixed

  • Remove Kitty protocol query timeout that caused shift+enter delays
  • Add bracketed paste check to prevent false key release/repeat detection
  • Rendering optimizations: only re-render changed lines
  • Refactor input component to use keybindings manager

[4.4.4] - 2026-01-11

Fixed

  • Fixed Ctrl+Enter sequences to insert new lines in the editor

[4.2.1] - 2026-01-11

Changed

  • Improved file autocomplete to show directory listing when typing @ with no query, and fall back to prefix matching when fuzzy search returns no results

Fixed

  • Fixed editor redraw glitch when canceling autocomplete suggestions
  • Fixed fd tool detection to automatically find fd or fdfind in PATH when not explicitly configured

[4.1.0] - 2026-01-10

Added

  • Added persistent prompt history storage support via setHistoryStorage() method, allowing history to be saved and restored across sessions

[4.0.0] - 2026-01-10

Added

  • EditorComponent interface for custom editor implementations
  • StdinBuffer class to split batched stdin into individual sequences
  • Overlay compositing via TUI.showOverlay() and TUI.hideOverlay() for ctx.ui.custom() with { overlay: true }
  • Kitty keyboard protocol flag 2 support for key release events (isKeyRelease(), isKeyRepeat(), KeyEventType)
  • setKittyProtocolActive(), isKittyProtocolActive() for Kitty protocol state management
  • kittyProtocolActive property on Terminal interface to query Kitty protocol state
  • Component.wantsKeyRelease property to opt-in to key release events (default false)
  • Input component onEscape callback for handling escape key presses

Changed

  • Terminal startup now queries Kitty protocol support before enabling event reporting
  • Default editor newLine binding now uses shift+enter only

Fixed

  • Key presses no longer dropped when batched with other events over SSH
  • TUI now filters out key release events by default, preventing double-processing of keys
  • matchesKey() now correctly matches Kitty protocol sequences for unmodified letter keys
  • Crash when pasting text with trailing whitespace exceeding terminal width through Markdown rendering

[3.32.0] - 2026-01-08

Fixed

  • Fixed text wrapping allowing long whitespace tokens to exceed line width

[3.20.0] - 2026-01-06

Added

  • Added isCapsLock helper function for detecting Caps Lock key press via Kitty protocol
  • Added isCtrlY helper function for detecting Ctrl+Y keyboard input
  • Added configurable editor keybindings with typed key identifiers and action matching
  • Added word-wrapped editor rendering for long lines

Changed

  • Settings list descriptions now wrap to the available width instead of truncating

Fixed

  • Fixed Shift+Enter detection in legacy terminals that send ESC+CR sequence

[3.15.1] - 2026-01-05

Fixed

  • Fixed editor cursor blinking by allowing terminal cursor positioning when enabled.

[3.15.0] - 2026-01-05

Added

  • Added inputCursor symbol for customizing the text input cursor character
  • Added symbols property to EditorTheme, MarkdownTheme, and SelectListTheme interfaces for component-level symbol customization
  • Added SymbolTheme interface for customizing UI symbols including cursors, borders, spinners, and box-drawing characters
  • Added support for custom spinner frames in the Loader component

[3.9.1337] - 2026-01-04

Added

  • Added setTopBorder() method to Editor component for displaying custom status content in the top border
  • Added getWidth() method to TUI class for retrieving terminal width
  • Added rounded corner box-drawing characters to Editor component borders

Changed

  • Changed Editor component to use proper box borders with vertical side borders instead of horizontal-only borders
  • Changed cursor style from block to thin blinking bar (▏) at end of line

[1.500.0] - 2026-01-03

Added

  • Added getText() method to Text component for retrieving current text content

[1.337.1] - 2026-01-02

Added

  • TabBar component for horizontal tab navigation
  • Emergency terminal restore to prevent corrupted state on crashes
  • Overhauled UI with welcome screen and powerline footer
  • Theme-configurable HTML export colors
  • ctx.ui.theme getter for styling status text with theme colors

Changed

  • Forked to @oh-my-pi scope with unified versioning across all packages

Fixed

  • Strip OSC 8 hyperlink sequences in visibleWidth()
  • Crash on Unicode format characters in visibleWidth()
  • Markdown code block syntax highlighting

[1.337.0] - 2026-01-02

Initial release under @oh-my-pi scope. See previous releases at badlogic/pi-mono.

[0.31.1] - 2026-01-02

Fixed

  • visibleWidth() now strips OSC 8 hyperlink sequences, fixing text wrapping for clickable links (#396 by @Cursivez)

[0.31.0] - 2026-01-02

Added

  • isShiftCtrlO() key detection function for Shift+Ctrl+O (Kitty protocol)
  • isShiftCtrlD() key detection function for Shift+Ctrl+D (Kitty protocol)
  • TUI.onDebug callback for global debug key handling (Shift+Ctrl+D)
  • wrapTextWithAnsi() utility now exported (wraps text to width, preserving ANSI codes)

Changed

  • README.md completely rewritten with accurate component documentation, theme interfaces, and examples
  • visibleWidth() reimplemented with grapheme-based width calculation, 10x faster on Bun and ~15% faster on Node (#369 by @nathyong)

Fixed

  • Markdown component now renders HTML tags as plain text instead of silently dropping them (#359)
  • Crash in visibleWidth() and grapheme iteration when encountering undefined code points (#372 by @HACKE-RC)
  • ZWJ emoji sequences (rainbow flag, family, etc.) now render with correct width instead of being split into multiple characters (#369 by @nathyong)

[0.29.0] - 2025-12-25

Added

  • Auto-space before pasted file paths: When pasting a file path (starting with /, ~, or .) and the cursor is after a word character, a space is automatically prepended for better readability. Useful when dragging screenshots from macOS. (#307 by @mitsuhiko)
  • Word navigation for Input component: Added Ctrl+Left/Right and Alt+Left/Right support for word-by-word cursor movement. (#306 by @kim0)
  • Full Unicode input: Input component now accepts Unicode characters beyond ASCII. (#306 by @kim0)

Fixed

  • Readline-style Ctrl+W: Now skips trailing whitespace before deleting the preceding word, matching standard readline behavior. (#306 by @kim0)