Skip to content

feat(datagrid): wrap long values onto several lines in the data grid - #4378

Merged
datlechin merged 4 commits into
mainfrom
feat/datagrid-word-wrap
Nov 20, 2026
Merged

datlechin merged 4 commits into
mainfrom
feat/datagrid-word-wrap

Conversation

@datlechin

@datlechin datlechin commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Wrap Text for the data grid on macOS, Windows and Linux: the whole grid of one tab, in tables, views and query results.
  • A row fits its tallest cell, up to 10 lines. A value that needs more ends in one ellipsis.
  • A line break in the value starts a new line while wrap is on. Wrap off keeps the one-line path it had.
  • Command in the View menu and the column header menu. A setting gives new tabs their default; open tabs keep their own choice.
  • The flag is saved with the tab on macOS and Windows. Linux keeps it for the tab's life.
  • macOS: heightOfRow answered only while wrap is on, heights from a per-row line count measured with Core Text, both panes noted in one call with the first visible row held in place.
  • Windows: a second core fetch that keeps line breaks (core decision 0041), a RowHeights store behind RowTop/RowHeightOf/RowAt (Windows decision 0024).
  • Linux: GridCell measures height for width while wrap is on (Linux decision 0047).

Defects fixed along the way:

  • Windows: a cell tip showed two ellipses on a truncated value.
  • Windows: the grid jumped to another row when the font size changed the row height.
  • Core and Windows: NEL, U+2028 and U+2029 were not flattened with the other line breaks.
  • Linux: a multi-line value cut to one line showed no tooltip.

Pinned tests changed on purpose:

  • Linux tests/menus.rs: the header menu has 10 actions and the row-number header menu lists grid.wrap-text.
  • Windows QueryTabTests.ARunSendsTheSelectionOrTheWholeTextWhenNothingIsSelected: the snapshot gains WrapText = false.

Docs: TableProApp/docs#259 (draft).

Before After
Light Before, light After, light
Dark Before, dark After, dark

Windows and Linux shots: the Windows UI test WrapTextTests writes 185-grid-wrap-text and 186-grid-wrap-text-header-menu to the CI screenshot artifact.

Test plan

  • macOS: DataGridWordWrapTests, DataGridWrapLayoutTests, DataTabWrapTextTests, SpecialCharacterTextTests are new; 229 cases over 17 suites pass.
  • Windows: RowHeightsTests, WrapTextTests and the core cell_text tests are new; the solution's 2327 cases pass on macOS. TablePro.DataGrid.Tests and the UI tests run only in CI.
  • Linux: data_grid/tests/wrap.rs is new; tablepro 3684 cases and tablepro-linux-platform 69 cases pass in the dev container.
  • Checked on a macOS Debug build with a seeded table tab, light and dark.

Fixes #4329

@datlechin
datlechin merged commit 1b458b8 into main Nov 20, 2026
2 checks passed
@datlechin
datlechin deleted the feat/datagrid-word-wrap branch November 20, 2026 14:25
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.

add a word-wrap option to view long values as multi line in table and views

1 participant