feat(datagrid): highlight rules that color rows or cells by value - #2738
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
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
Highlight rules color data grid rows, or single cells, by their values (#2723).
Application Support/TablePro/HighlightRules/<connection>.json, moved on a table, database or schema rename, and removed when the connection is deleted. They are device-local and never synced. A query result that resolved one table uses that table's rules; any other query result keeps its rules on the tab only.Why the row view changed
Row color was one derived value (
RowVisualState) read atTableViewCoordinator.visualState(for:), butDataGridRowViewpainted a copy pushed into it while the pinned gutter and the cells read the live value. Any path that rebuilt the index without pushing split the wash from the gutter. One shipped case: delete an existing row together with a new, unsaved row, and the existing row lost its red wash across the data columns while its gutter stayed red. A value rule would make this routine, because an edit can flip a row's highlight. So the row view now reads its state live, every state change invalidates the whole row and its gutter band, and highlights are composed inside the same chokepoint. Structure and Create Table grids supply their own state and are never highlighted.Matching
HighlightConditionevaluates theFilterOperatorvocabulary in memory against raw stored values, mirroringFilterSQLGenerator: NULL fails every comparison,= NULLmeans IS NULL on a non-text column, "is empty" is NULL or'', numeric columns compare as numbers, boolean columns accepttrue/1/t/yes, and a value is compared exactly as stored so a paddedCHARcell matches its own quick rule. Searches and regex patterns are capped at 10,000 characters. Results are cached per row id alongside the formatted-text cache, so they share its lifetime (a page change or edit drops them) and are evaluated only for rows that draw.What I tested
HighlightConditionTests,HighlightRuleSetTests,HighlightRuleDescriptionTests,HighlightRuleStorageTests,TableViewCoordinatorHighlightTests, plus new cases inDataGridCellAppearanceTests,DataGridRowTintThemeTests(rewritten over a coordinator, including the live-state regression),DataGridUpdateSnapshotTests,RowDisplayCacheTests,ResultStatusModelTests,MainMenuValidationTests.HighlightRulesUITests: add a rule from the status bar, close with Escape, reopen and find it; an empty rule is dropped on close; the cell menu offers Highlight and opens the rules.code-reviewskill instead; its four findings are fixed.ColumnJumpUITestsfails, identically, onorigin/maintoo, so it is not from this change.MainMenuValidationTests.onlyConnectedPhaseEnablesCommandswas red on main after feat(plugins): add a Cloudflare R2 SQL driver #2030 gated the page commands oncanNavigatePageswithout setting it in the test's all-capable context. This PR sets it, one line in a file it already edits.Not in this PR
Text color and bold styles, custom colors, AND/OR rules, iCloud sync, undo for rule edits, and highlighting in exports, JSON view, Compare panes or iOS.
Screenshots
There is no before: the grid had no value highlighting. After, light and dark:
Fixes #2723
https://claude.ai/code/session_01WA4qjtY9TiRD6QuqhhW5Yr