Skip to content

DataTableColumnToggle: custom label & initial column visibility (+ NativeSelectIcon chevron)#465

Closed
pierry01 wants to merge 3 commits into
ruby-ui:mainfrom
pierry01:feat/column-toggle-label-and-select-icon
Closed

DataTableColumnToggle: custom label & initial column visibility (+ NativeSelectIcon chevron)#465
pierry01 wants to merge 3 commits into
ruby-ui:mainfrom
pierry01:feat/column-toggle-label-and-select-icon

Conversation

@pierry01

@pierry01 pierry01 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

1. DataTableColumnToggle — custom trigger label + initial column visibility

  • New label: option (defaults to "Columns") so the trigger text can be localized/customized.
  • Reads a :visible key per column, so a column can start hidden (checkbox unchecked) instead of every column defaulting to checked.
  • Adds checked: utility classes to the checkbox for a clearer checked state.
render RubyUI::DataTableColumnToggle.new(
  label: "Colunas",
  columns: [
    {key: :email, label: "Email"},
    {key: :salary, label: "Salary", visible: false} # starts hidden
  ]
)
Before After
image image

Tests added in test/ruby_ui/data_table_column_toggle_test.rb for both the custom label and the initial-visibility behavior.

2. NativeSelectIcon — remove hardcoded chevron

Removes the default chevron path from the icon SVG.

Before After
image image

Testing

ruby -I. -Itest test/ruby_ui/data_table_column_toggle_test.rb   # 3 runs, 0 failures
ruby -I. -Itest test/ruby_ui/native_select_test.rb              # 1 run, 0 failures

pierry01 and others added 2 commits July 9, 2026 12:39
…in DataTableColumnToggle

Adds a `label:` option (defaults to "Columns") so the trigger text can be
localized/customized, and reads `:visible` per column so a column can start
hidden (checkbox unchecked). Also adds `checked:` styling to the checkbox.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pierry01 pierry01 marked this pull request as ready for review July 9, 2026 15:46
@pierry01 pierry01 requested a review from cirdes as a code owner July 9, 2026 15:46
…eSelectIcon

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@pierry01

pierry01 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Splitting this into two single-concern PRs per @cirdes's review:

Closing this one in favor of those. 🙏

@pierry01 pierry01 closed this Jul 9, 2026
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