Skip to content

Conversation

@ericokuma
Copy link
Contributor

@ericokuma ericokuma commented Jan 26, 2026

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 toggle function in cell-inspector-store.ts was overwriting the correctly updated store value (from hover) with a stale local value from CellInspector.svelte when the inspector was closed.

The fix modifies the toggle function to prioritize the existing state.value when opening the inspector, ensuring that the value set by a preceding hover event is preserved and displayed correctly. The passed value is now only used as a fallback.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Linear Issue: APP-693

Open in Cursor Open in Web


Note

Medium Risk
Touches shared cellInspectorStore semantics 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.toggle to prefer the existing hovered state.value (and only fall back to the passed value when no hover value has been recorded).

Refactors the store to accept unknown inputs via updateValue, normalize them internally (null/undefinednull, everything else → String(...)), and track hasValue so 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 updateValue instead of pre-stringifying/guarding, and tweaks CellInspector.svelte rendering to explicitly show null and (empty string).

Written by Cursor Bugbot for commit 79c4d48. This will update automatically on new commits. Configure here.

…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
Copy link

cursor bot commented Jan 26, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

cursoragent and others added 3 commits January 26, 2026 22:27
- 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>
@ericokuma ericokuma requested a review from AdityaHegde January 26, 2026 22:56
@ericokuma ericokuma marked this pull request as ready for review January 26, 2026 22:56
Copy link

@cursor cursor bot left a 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.

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(
Copy link
Collaborator

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;
Copy link
Collaborator

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>
@ericokuma ericokuma requested a review from AdityaHegde January 27, 2026 18:02
@ericokuma ericokuma merged commit 6d3ebc1 into main Jan 30, 2026
7 checks passed
@ericokuma ericokuma deleted the cursor/APP-693-cell-inspector-data-display-06f9 branch January 30, 2026 23:14
k-anshul pushed a commit that referenced this pull request Feb 2, 2026
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants