Skip to content

fix(datagrid): cell/selection copy, persist hidden columns & filters, JSON popover#1459

Merged
datlechin merged 17 commits into
TableProApp:mainfrom
J2TeamNNL:fix/datagrid
May 29, 2026
Merged

fix(datagrid): cell/selection copy, persist hidden columns & filters, JSON popover#1459
datlechin merged 17 commits into
TableProApp:mainfrom
J2TeamNNL:fix/datagrid

Conversation

@J2TeamNNL
Copy link
Copy Markdown
Contributor

@J2TeamNNL J2TeamNNL commented May 28, 2026

Summary

  • Context menu Copy copies the clicked cell value, or the rectangular grid selection when one exists, matching Cmd+C. The row-number column copies the full row. Copy As keeps Rows, With Headers, JSON, CSV, Markdown, and the SQL variants.
  • Hidden columns persist when you change them and are restored before the first load, so reopening a table keeps them hidden and the query omits them instead of running SELECT *.
  • Applied filters persist on Apply, so reopening a table restores the last filter.
  • Filter bar visibility follows the Panel State setting: Always Hide stays closed, Always Show stays open, Restore Last shows the bar only when a saved filter exists.
  • JSON detail popover shows long string values up to 300 characters in the tree view (raw value unchanged).

Test plan

  • Right-click a cell → Copy → pastes the cell value (blob → 0x…, NULL → NULL)
  • Select a range of cells → right-click → Copy → pastes the selection (matches Cmd+C)
  • Right-click the row-number column → Copy → pastes the full row
  • Copy As → Rows / With Headers still work
  • Hide a column, close the tab, reopen the table → column stays hidden and the query omits it
  • Apply a filter, close the tab, reopen → filter restored (Restore Last)
  • Panel State Always Hide → table opens with the filter bar closed
  • Panel State Restore Last with no saved filter → filter bar stays closed
  • Panel State Always Show → filter bar open even with no filter
  • Open a row with a long JSON string → popover shows up to 300 chars, copy gives the full value

# Conflicts:
#	.gitignore
#	CHANGELOG.md
#	CLAUDE.md
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c191cc3a52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +434 to +436
if let clickedColumnIndex = sender.representedObject as? NSNumber {
return clickedColumnIndex.intValue
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve row-copy fallback from row-number menu

When the context menu is opened from the row-number/non-data column on the currently focused row, representedObject is nil, so this fallback reuses the focused data column and Copy copies that cell instead of the full row. This breaks the advertised row-header fallback path; the focused-cell fallback needs to be gated so a click that resolved to a non-data column still dispatches row copy.

Useful? React with 👍 / 👎.

@datlechin datlechin changed the title fix(datagrid): copy cell, hidden columns, JSON popover, filter bar default fix(datagrid): cell/selection copy, persist hidden columns & filters, JSON popover May 29, 2026
@datlechin
Copy link
Copy Markdown
Member

Pushed review fixes (commits 15d0198a, ac29ba8b):

  • Persistence: hidden columns and applied filters now persist on change, so reopening a table restores the hidden-column set (no more SELECT *) and the last applied filter. Previously these only saved on tab switch, so closing without switching lost them. Regression tests added.
  • Filter bar default: the three Panel States are now distinct, resolved in one place (FilterCoordinator.resolvedRestoredState). Restore Last shows the bar only when a saved filter exists, instead of popping an empty bar on every table open. Reverted the docs/CHANGELOG line that described the old behavior.
  • Copy menu: removed the redundant Copy As → Cell Value (top-level Copy already copies the cell). Context-menu Copy now honors a rectangular grid selection, matching Cmd+C.
  • Deduped the column-scoping query rebuild and removed dead code.

Build and swiftlint --strict clean; affected suites pass.

Note: this branch is behind main (CHANGELOG entries sit under [0.46.0]). Rebase onto main before merge so they move to [Unreleased].

@datlechin datlechin merged commit 8762395 into TableProApp:main May 29, 2026
4 checks passed
@J2TeamNNL J2TeamNNL deleted the fix/datagrid branch May 30, 2026 04:26
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