Skip to content

feat(linux-grid): pick an enum or set cell's labels from a menu - #3880

Merged
datlechin merged 6 commits into
TableProApp:mainfrom
sedax90:feat/linux-grid-enum-picker
Oct 30, 2026
Merged

datlechin merged 6 commits into
TableProApp:mainfrom
sedax90:feat/linux-grid-enum-picker

Conversation

@sedax90

@sedax90 sedax90 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Return, F2, a double click or Edit Cell on an enum or set cell opens a menu of the column's labels under the cell: radio items for an enum, check items for a set, the cell's value marked. It is a stock GtkPopoverMenu built from a menu model, one per grid.
  • A click or Return picks a label and closes the menu. Space on a set member toggles it and keeps the menu open. Every pick is one pending edit, so undo, Safe Mode and save treat it like a typed value.
  • A set writes its checked labels in the column's order and keeps any member the labels do not name. Unchecking the last member writes the empty set.
  • The menu also has Set to Empty, Set to NULL and Set to DEFAULT, each shown only where the cell takes it.
  • Typing, Tab and Insert Row still edit an enum cell's text in place. An enum with no labels from the catalog or more than 100, and a set with an empty label, edit as text.
  • Row Details shows a Pick a Value button beside an editable enum or set field, with the same labels.
  • Labels keep their underscores in the menu, an empty label shows as Empty, and a ClickHouse label with a NUL shows it as ␀ and is picked by position.
  • Fixed: a MySQL SET treated the empty string as NULL, so clearing a set cell wrote NULL and Set to Empty was hidden.
  • Fixed: closing a grid menu (cell menu or labels) left the keyboard on a control below the rows; the menu's cell takes it back.
  • text_like_kinds_edit_inline_and_only_text_takes_line_breaks now pins an enum with no labels to the text editor, since an enum with labels opens the menu.

Screenshots

DuckDB table, size ENUM('small', 'medium', 'large', 'x_large'), Return on a size cell.

Light Dark
Before: a text editor Before, light Before, dark
After: the labels After, light After, dark
After: Row Details Row Details, light Row Details, dark

Test plan

  • ui::data_grid::edit::tests::choices (new): the marked label and a pick, labels with _ and the empty label, a NUL label, Set to NULL from the menu, set members toggled down to the empty set, Set to Empty on a set, Tab into an enum cell, a value with a line break, Edit Cell from the cell menu, the keyboard back on the cell after the menu closes.
  • tests::menus::a_closed_cell_menu_gives_the_keyboard_back_to_its_cell, row_detail::tests::an_enum_field_picks_from_its_labels, cell_editor_kind, choice_menu::tests, and in tablepro-core parse_edit_text and kind (an empty set stays the empty string, fails on main).
  • verify.sh: lint PASS, test tablepro 2549 passed, test tablepro-core 845 passed.
  • Real build on Xvfb: picked a label on a DuckDB table and saved it.

@datlechin
datlechin merged commit b97715e into TableProApp:main Oct 30, 2026
36 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.

2 participants