fix(datagrid): edit JSON cells inline and open blob hex editor on double-click#1588
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
💡 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".
| case .raw, .uuid, .unixTimestamp, .unixTimestampMillis, .none: | ||
| return plainText(for: context, isReadOnly: isReadOnly) |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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".
| case .raw, .uuid, .unixTimestamp, .unixTimestampMillis, .none: | ||
| return plainText(for: context, isReadOnly: isReadOnly) |
There was a problem hiding this comment.
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 👍 / 👎.
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:
editEligibilityblocked JSON and blob columns from inline editing, sobeginCellEditrefused them and nothing happened. The data grid also had two separate routing systems for "edit this cell" (theCellInteractionResolvervs. a directbeginCellEditpath) that could disagree.Fix
CellInteractionResolveris now the single source of truth for cell-body interaction, used by all three entry points.Behavior matrix
Cleanup (no behavior change beyond the above)
resolveto match production reality and removed two unreachable branches:columnType.isJsonType(a JSON column can only carry.raw, perapplicableFormats) and the content-detection block (effectiveFormatalways returns a non-nil format, so it was never reached).canStartInlineEdit(its only caller now routes through the resolver) and three write-onlyCellContextfields.DataGridCellView(the native pattern for view-basedNSTableView), not the unreliableNSTableView.doubleAction.Tests
CellInteractionResolverTeststo production inputs.InlineEditEligibilityTests(JSON eligible, blob not, text yes) andDataGridCellViewDoubleClickTests.swiftlint --strictclean.Docs
data-grid.mdxandjson-viewer.mdx: double-click edits inline, the chevron opens the viewer.