-
Notifications
You must be signed in to change notification settings - Fork 164
Cell inspector data display #8702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cell inspector data display #8702
Conversation
…ortcut The toggle function was overwriting the store's value (set by hover's updateValue call) with a potentially stale local value from the CellInspector component. Now when opening, toggle() preserves the store's existing value if one was set via updateValue(), falling back to the passed value only if the store's value is empty. Fixes: APP-693 Co-authored-by: eric.okuma <eric.okuma@rilldata.com>
|
Cursor Agent can help with this pull request. Just |
- Updated cell-inspector-store to accept null values (string | null type) - Changed toggle to use nullish coalescing (??) to preserve null values - Updated CellInspector to show 'null' instead of 'No value' for null cells - Updated subscription to sync null values when inspector is open - Modified all cell components to call updateValue even for null values: - LeaderboardCell.svelte - Cell.svelte (virtualized-table) - VirtualTableCell.svelte - FlatTable.svelte - NestedTable.svelte - RegularTable.svelte - KPI.svelte - MeasureBigNumber.svelte Fixes: APP-693 Co-authored-by: eric.okuma <eric.okuma@rilldata.com>
Co-authored-by: eric.okuma <eric.okuma@rilldata.com>
The nullish coalescing operator (??) was treating null as a fallback case, causing the inspector to show a stale value instead of null. Changed to check for empty string (the initial state) instead, so that null values from hovering over null cells are properly preserved when toggling the inspector open. Co-authored-by: eric.okuma <eric.okuma@rilldata.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
web-common/src/features/dashboards/stores/cell-inspector-store.ts
Outdated
Show resolved
Hide resolved
Changed sentinel value from empty string to undefined: - undefined = no value set yet (initial state / not hovered) - null = cell contains null value - string (including '') = cell contains a string value Also added distinct display for empty strings showing '(empty string)' to distinguish from null or missing values. Co-authored-by: eric.okuma <eric.okuma@rilldata.com>
| cellInspectorStore.updateValue(value.toString()); | ||
| } | ||
| // Always update the value in the store, but don't change visibility | ||
| cellInspectorStore.updateValue( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a lot of duplication for null check. Lets move all of it to cellInspectorStore.updateValue
| isOpen: boolean; | ||
| value: string; | ||
| // undefined = no value set yet, null = cell contains null, string = cell value (including empty string) | ||
| value: string | null | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have a separate field, hasValue instead of messing about with null/undefined values.
- Added hasValue boolean field instead of using undefined as sentinel - Moved null check logic into updateValue() which now accepts unknown - Simplified all cell components to just pass raw value to updateValue() - normalizeValue() helper converts null/undefined to null, else to string Co-authored-by: eric.okuma <eric.okuma@rilldata.com>
* Fix cell inspector showing incorrect data when opened via keyboard shortcut The toggle function was overwriting the store's value (set by hover's updateValue call) with a potentially stale local value from the CellInspector component. Now when opening, toggle() preserves the store's existing value if one was set via updateValue(), falling back to the passed value only if the store's value is empty. Fixes: APP-693 Co-authored-by: eric.okuma <eric.okuma@rilldata.com> * Support null values in cell inspector - Updated cell-inspector-store to accept null values (string | null type) - Changed toggle to use nullish coalescing (??) to preserve null values - Updated CellInspector to show 'null' instead of 'No value' for null cells - Updated subscription to sync null values when inspector is open - Modified all cell components to call updateValue even for null values: - LeaderboardCell.svelte - Cell.svelte (virtualized-table) - VirtualTableCell.svelte - FlatTable.svelte - NestedTable.svelte - RegularTable.svelte - KPI.svelte - MeasureBigNumber.svelte Fixes: APP-693 Co-authored-by: eric.okuma <eric.okuma@rilldata.com> * Fix prettier formatting in cell-inspector-store Co-authored-by: eric.okuma <eric.okuma@rilldata.com> * Fix toggle to preserve null values from hover The nullish coalescing operator (??) was treating null as a fallback case, causing the inspector to show a stale value instead of null. Changed to check for empty string (the initial state) instead, so that null values from hovering over null cells are properly preserved when toggling the inspector open. Co-authored-by: eric.okuma <eric.okuma@rilldata.com> * Fix empty string cell values displaying stale data Changed sentinel value from empty string to undefined: - undefined = no value set yet (initial state / not hovered) - null = cell contains null value - string (including '') = cell contains a string value Also added distinct display for empty strings showing '(empty string)' to distinguish from null or missing values. Co-authored-by: eric.okuma <eric.okuma@rilldata.com> * Refactor cell inspector store based on code review - Added hasValue boolean field instead of using undefined as sentinel - Moved null check logic into updateValue() which now accepts unknown - Simplified all cell components to just pass raw value to updateValue() - normalizeValue() helper converts null/undefined to null, else to string Co-authored-by: eric.okuma <eric.okuma@rilldata.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Fixes APP-693: Cell inspector shows incorrect data on certain UX paths.
The cell inspector was displaying stale or "No value" data when opened via the Spacebar after hovering over a cell. This happened because the
togglefunction incell-inspector-store.tswas overwriting the correctly updated store value (from hover) with a stale local value fromCellInspector.sveltewhen the inspector was closed.The fix modifies the
togglefunction to prioritize the existingstate.valuewhen opening the inspector, ensuring that the value set by a preceding hover event is preserved and displayed correctly. The passedvalueis now only used as a fallback.Checklist:
Linear Issue: APP-693
Note
Medium Risk
Touches shared
cellInspectorStoresemantics and updates many callers, so regressions could affect inspector behavior across multiple dashboard/table views. Changes are UI-only and don’t impact auth or persisted data.Overview
Fixes the cell inspector showing stale/incorrect content when opened via keyboard by changing
cellInspectorStore.toggleto prefer the existing hoveredstate.value(and only fall back to the passed value when no hover value has been recorded).Refactors the store to accept
unknowninputs viaupdateValue, normalize them internally (null/undefined→null, everything else →String(...)), and trackhasValueso the inspector only updates from the store when a value has actually been set.Updates all hover/focus emitters (tables, pivot cells, KPI/big-number, leaderboard) to pass raw values into
updateValueinstead of pre-stringifying/guarding, and tweaksCellInspector.svelterendering to explicitly shownulland(empty string).Written by Cursor Bugbot for commit 79c4d48. This will update automatically on new commits. Configure here.