feat(datagrid): read-only cell viewer with unified interaction dispatcher#1341
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CellInteractionResolver(pure value-type): single source of truth that maps cell context to aCellInteractionMode. Replaces the duplicated decision trees previously scattered acrosshandleDoubleClick,insertNewline, andhandleChevronAction.CellOverlayBaseshared base class forCellOverlayEditorandCellOverlayViewer— positioning, dismiss observers, raise-to-front. Editor down 295→120 LOC, viewer 235→70 LOC, base 200 LOC.JSONViewerView(isEditable: false)reused for read-only JSON popover via newJSONViewerContentViewwrapper.HexEditorContentViewgetsisEditableparameter; viewer mode hides the editable hex section and Save button.Fixes part 2 of #1336 (part 1 — Cmd+C single-cell — landed via #1337/#1338).
Test plan
SELECT 'A', 'B'). Double-clickAcell — inline overlay opens withAselected. Cmd+C copies justA.xcodebuild test -only-testing:TableProTests/CellInteractionResolverReadOnlyTests+CellInteractionResolverEditableTests.Architecture
The refactor introduces three new value-types and one new sibling overlay class, eliminating ~140 LOC of geometry+observer duplication. Cell-interaction routing is now driven by one resolver; double-click, Return key, and (future) chevron action all consume the same
CellInteractionMode.