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

Resolves incorrect/stale values shown in the cell inspector and standardizes null handling.

  • Updates cell-inspector-store.ts to allow string | null, and modifies toggle to prefer existing store value on open; open/updateValue/toggle accept nulls
  • In CellInspector.svelte, only syncs when open/not locked and ignores initial empty string; renders null explicitly
  • Normalizes hover/focus handlers across table cells, KPIs, big numbers, leaderboards, and pivot tables to always call cellInspectorStore.updateValue, passing null for null/undefined

Written by Cursor Bugbot for commit 1f8b58e. 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.

? state.value
: state.value !== ""
? state.value
: value,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty string cell values display stale data

Medium Severity

The toggle function and subscription use "" (empty string) as a sentinel value to detect "no value set", but empty string is also a valid cell value. When a user hovers over a cell containing an empty string and presses Space, the check state.value !== "" fails, causing the function to fall back to the passed value parameter (which is stale from a previous session) instead of using the actual empty string from the hover. This causes the cell inspector to display incorrect data for empty string cells.

Additional Locations (1)

Fix in Cursor Fix in Web

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
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