Skip to content

Refactor DataTab to use scrollable DataTable for data preview#24

Merged
raulcd merged 2 commits intoraulcd:mainfrom
jacopoprandelli:issue-23/data-tab-empty-wide-parquet
Nov 15, 2025
Merged

Refactor DataTab to use scrollable DataTable for data preview#24
raulcd merged 2 commits intoraulcd:mainfrom
jacopoprandelli:issue-23/data-tab-empty-wide-parquet

Conversation

@jacopoprandelli
Copy link
Contributor

@jacopoprandelli jacopoprandelli commented Nov 14, 2025

Summary
Replace the Rich Table preview with Textual’s DataTable, wrapping it in HorizontalScroll so wide Parquet schemas stay accessible while preserving formatting. This is just one possible implementation.

Changes

  • Swap _create_data_table to build a Textual DataTable (cursor support, zebra stripes, border styling, NULL highlighting).
  • Size columns via header-based min_width and wrap the widget in HorizontalScroll inside compose so wide schemas remain accessible.
  • Yield Static error/empty states through the Textual compose API to match the new widget structure.

Closes #23

Copy link
Owner

@raulcd raulcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I plan to do quite a big overhaul of the initially hacked TUI to make it more composable. I'll take a look at your PR once I have some time and will probably merge it but then I'll refactor. For example there's quite a lot of logic on this module that doesn't belong here and should live in the reader.

@jacopoprandelli
Copy link
Contributor Author

Yeah it makes sense. Thanks for the great tool!

Copy link
Owner

@raulcd raulcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the PR. As suggested I plan to refactor the tui soon but I'll base it on your work here. Thanks for the changes!
Just a small nit about some of the attributes which doesn't seem strictly necessary when creating a DataTable.

@raulcd raulcd merged commit 4334509 into raulcd:main Nov 15, 2025
2 checks passed
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.

Data tab shows empty preview for wide Parquet files

2 participants