Skip to content

fix(datagrid): edit JSON cells inline and open blob hex editor on double-click#1588

Merged
datlechin merged 2 commits into
mainfrom
fix/json-blob-cell-inline-edit
Jun 5, 2026
Merged

fix(datagrid): edit JSON cells inline and open blob hex editor on double-click#1588
datlechin merged 2 commits into
mainfrom
fix/json-blob-cell-inline-edit

Conversation

@datlechin
Copy link
Copy Markdown
Member

Problem

Double-clicking or pressing Enter on a JSON cell did nothing. You could only edit JSON through the chevron popover. Blob cells had the same gap.

Root cause: editEligibility blocked JSON and blob columns from inline editing, so beginCellEdit refused them and nothing happened. The data grid also had two separate routing systems for "edit this cell" (the CellInteractionResolver vs. a direct beginCellEdit path) that could disagree.

Fix

  • JSON cells now edit inline on double-click, Enter, and click-on-focused, like any other cell. The chevron still opens the tree editor.
  • Blob cells open the hex editor on double-click (binary has no inline text edit), matching the chevron.
  • CellInteractionResolver is now the single source of truth for cell-body interaction, used by all three entry points.

Behavior matrix

Column type Double-click / Enter / click-focused Chevron
text, integer, date, enum, boolean, FK inline edit picker / menu
json inline edit JSON tree
blob hex editor hex editor
read-only (any) inline viewer (none)
text with "Display as JSON/PHP" JSON / PHP editor (none)

Cleanup (no behavior change beyond the above)

  • Rewrote resolve to match production reality and removed two unreachable branches: columnType.isJsonType (a JSON column can only carry .raw, per applicableFormats) and the content-detection block (effectiveFormat always returns a non-nil format, so it was never reached).
  • Removed canStartInlineEdit (its only caller now routes through the resolver) and three write-only CellContext fields.
  • Double-click is handled in DataGridCellView (the native pattern for view-based NSTableView), not the unreliable NSTableView.doubleAction.

Tests

  • Rewrote CellInteractionResolverTests to production inputs.
  • Added InlineEditEligibilityTests (JSON eligible, blob not, text yes) and DataGridCellViewDoubleClickTests.
  • All pass; build green; swiftlint --strict clean.

Docs

  • Updated data-grid.mdx and json-viewer.mdx: double-click edits inline, the chevron opens the viewer.

@mintlify
Copy link
Copy Markdown

mintlify Bot commented Jun 5, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
TablePro 🟢 Ready View Preview Jun 5, 2026, 5:56 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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: 82f9611a93

ℹ️ 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 +62 to 63
case .raw, .uuid, .unixTimestamp, .unixTimestampMillis, .none:
return plainText(for: context, isReadOnly: isReadOnly)
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 the JSON viewer for read-only JSON columns

In read-only result grids (isTableEditable == false), native JSON columns now hit the .raw/.none branch and return viewInline, because effectiveFormat defaults to .raw and the resolver no longer checks columnType.isJsonType. The documented fallback chevron is not available in that context (DataGridCellView only draws chevrons when the cell is editable), so users double-clicking or pressing Enter on JSON columns from read-only queries lose the structured JSON viewer entirely.

Useful? React with 👍 / 👎.

@datlechin datlechin merged commit 3f476b8 into main Jun 5, 2026
4 checks passed
@datlechin datlechin deleted the fix/json-blob-cell-inline-edit branch June 5, 2026 06:10
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: 6dae692eb0

ℹ️ 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 +62 to 63
case .raw, .uuid, .unixTimestamp, .unixTimestampMillis, .none:
return plainText(for: context, isReadOnly: isReadOnly)
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 Restore auto-routing for PHP serialized cells

When no display-format override is saved, effectiveFormat returns .raw, so this branch now sends PHP-serialized TEXT values to plainText instead of running CellValueContentDetector. That breaks the documented auto-open path (docs/features/php-viewer.mdx:12-15): double-click/Enter on a value like a:0:{} just starts text editing or inline viewing unless the user manually sets Display as > PHP Serialized.

Useful? React with 👍 / 👎.

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