Skip to content

DataTable: cell-cursor table with frozen columns#89

Merged
meszmate merged 1 commit intomainfrom
feature/datatable-upgrades
Apr 23, 2026
Merged

DataTable: cell-cursor table with frozen columns#89
meszmate merged 1 commit intomainfrom
feature/datatable-upgrades

Conversation

@meszmate
Copy link
Copy Markdown
Owner

Summary

Adds `DataTable`, a third table component for the "spreadsheet view" use case: many columns, navigable cell-by-cell, leftmost columns pinned so they stay visible while the rest of the grid scrolls horizontally.

How it differs from existing components

Component Cursor Columns Best for
`Table` row compile-time count small static tables
`SortableTable` row compile-time count sortable lists
`DataTable` (new) cell runtime count databases, log fields, CSVs

Features

  • Cell-level cursor with arrow / hjkl navigation
  • Page up/down, goto first/last row/column
  • Frozen columns: first N columns never scroll out of view
  • Horizontal scrolling for non-frozen columns when they exceed available width
  • Configurable per-column width and alignment (left/center/right)
  • Distinct styles for cursor cell vs cursor row vs header
  • Visible "│" separator between frozen and scrolling regions

Test plan

  • `zig build test` — added 6 tests covering right-clamp, down-cursor, frozen offset behavior, view content, frozen separator rendering, and column-count validation

DataTable targets the spreadsheet view: many columns, navigable
cell-by-cell, leftmost columns pinned so they stay visible while the
rest of the grid scrolls horizontally. Distinct from Table
(compile-time column count, row-only cursor) and SortableTable
(sorting/styling).

Runtime column count makes it a good fit for dynamic schemas (database
results, log fields, CSV files). Includes vim-style and arrow-key
navigation, page up/down, goto first/last row/column, and styling for
cursor cell vs cursor row vs frozen separator.
@meszmate meszmate merged commit 625aaf2 into main Apr 23, 2026
9 checks passed
@meszmate meszmate deleted the feature/datatable-upgrades branch April 24, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant