Repository navigation
fix(datagrid): keep a detached row inspector value window writing the rows it was opened for - #2870
Merged
Merged
Conversation
… rows it was opened for
…commit # Conflicts: # CHANGELOG.md # TablePro/Models/UI/MultiRowEditState.swift # TablePro/Views/Main/Extensions/MainContentView+EventHandlers.swift
…commit # Conflicts: # CHANGELOG.md # TablePro/Views/Main/Extensions/MainContentView+EventHandlers.swift
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.
Two defects found while investigating #2851, both about the value window a row inspector field detaches into.
Text typed into the window was dropped once another row was selected
RowInspectorView.popOutbuilt its commit closure around the field'sUUIDand looked the field up on every keystroke.MultiRowEditState.configurereissues those ids whenever the selection changes, and reissues one when an inline grid edit changes that cell's value, so after either the lookup failed and the closure returned. Nothing was recorded, nothing was shown, and nothing said so, whiledocs/features/json-viewer.mdxpromises those edits join the same pending changes as the field.The window now captures the column and the rows it was opened for. While that selection is still the one on screen the commit is an ordinary field edit; once it has moved the value goes to the rows the window was opened for rather than into whatever is selected now, which #2858 made possible by keying the staging on
RowID.The JSON rendering stayed on the row as it was
The inspector rebuilds
RowInspectorContextwhen its Fields/JSON control changes, which covers editing in Fields and then switching to JSON. It does not cover a value window that is still open and still writing while JSON is the rendering on screen: the edit reachesTableRowsand the grid, and moves nothingInspectorTriggerwatches.stageInspectorFieldEditnow bumpsinspectorRowContentRevision, and the inspector rebuilds its context from it while JSON is showing. Debounced on its own task slot, because the window commits per keystroke andJSONRowInspectorViewModel.updatecancels the reader's fetches on every content change. The field list is deliberately not rebuilt: a rebuilt field takes a new id, which would drop first responder out of the window being typed into.Verification
verify.sh buildPASS.verify.sh testPASS: 84 cases overMultiRowEditStateDetachedCommitTests,MultiRowEditStateTests,InspectorFieldEditStagingTests,MultiRowEditStateJsonTests.swiftlint --strictclean on the changed files.NSWindowthe runner has to target before typing, and the row behind it can only be selected through an offset click on the grid. Noted rather than written, per rule 4.