Skip to content

feat(settings): add a NULL display setting for the data grid - #1343

Merged
debba merged 3 commits into
TabularisDB:mainfrom
Mittalnew:feat/null-display-setting
Nov 2, 2026
Merged

debba merged 3 commits into
TabularisDB:mainfrom
Mittalnew:feat/null-display-setting

Conversation

@Mittalnew

Copy link
Copy Markdown
Contributor

Closes #1300

Adds a "NULL Display" option under Settings > General so users can choose how NULL values look in the data grid.

Options:

  • Default: the current translated "null" label (unchanged look)
  • (null)
  • ∅
  • Empty cell: no text, but a small muted dot so a NULL still looks different from an empty string

Changes:

  • New utils/nullDisplay.ts with the NullDisplay type and getNullDisplayLabel helper
  • New nullDisplay setting in SettingsContext (default "default")
  • DataGrid passes the chosen label down to DataGridRow, which uses it for NULL cells
  • dataGridCell renders the muted dot when the label is empty
  • New button group in GeneralTab, with strings added to all 11 locale files
  • Rust AppConfig gets a null_display field, and it is merged in persistence.rs so the setting is saved

This is display only. Copy, export and editing keep their own NULL text.

Tests:

  • tests/utils/nullDisplay.test.ts for the helper
  • New tests in dataGridCell.test.tsx and DataGrid.test.tsx for the grid rendering
  • New tests/components/settings/GeneralTab.test.tsx for the setting buttons
  • persistence_tests.rs now also saves nullDisplay

"rows": "linhas",
"copyFormat": "Formato de Cópia Padrão",
"copyFormatDesc": "Escolha o formato padrão ao copiar linhas com Ctrl+C / Cmd+C.",
"nullDisplay": "Exibição de NULL",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: Inconsistent indentation. This line has 5 leading spaces while every other key in the file uses 4.

Suggested change
"nullDisplay": "Exibição de NULL",
"nullDisplay": "Exibição de NULL",

const stickyColumnHeaders = settings.stickyColumnHeaders ?? true;
const zebraStripes = settings.resultZebraStripes ?? false;
// Display only (#1300): copy and export keep their own NULL text.
const nullLabel = getNullDisplayLabel(settings.nullDisplay, t('dataGrid.null'));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

SUGGESTION: The fit-column-width measurement in the same component (const nullLabel = t('dataGrid.null') near line 1680) still measures NULL cells with the default label. With ∅, (null) or the empty-cell option, auto-fit widths will not match what is rendered (e.g. (null) can be truncated, and empty is over-wide). Consider reusing this nullLabel there.

@kilo-code-bot

kilo-code-bot Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental review of the latest commit (0745758..13b5771) found no issues. The commit adds the nullDisplay, nullDisplayDesc and nullDisplayEmpty keys to the Vietnamese locale (vi.json). The keys match the English locale and the JSON structure is valid.

Files Reviewed (1 file in this increment)
  • packages/web-ui/src/i18n/locales/vi.json
Previous Review Summaries (2 snapshots, latest commit 0745758)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 0745758)

Status: No Issues Found | Recommendation: Merge

Incremental review of the latest commit (fc7fea2..0745758) found no issues. Both earlier suggestions are fixed:

  • The fit-column-width measurement now uses the shared nullLabel from the NULL display setting, and the useCallback dependencies are updated to match.
  • The nullDisplay key in pt-BR.json now has the correct indentation.
Files Reviewed (2 files in this increment)
  • packages/web-ui/src/components/ui/DataGrid.tsx
  • packages/web-ui/src/i18n/locales/pt-BR.json

Previous review (commit fc7fea2)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/web-ui/src/i18n/locales/pt-BR.json 578 Extra leading space (5 instead of 4) on the new nullDisplay key
packages/web-ui/src/components/ui/DataGrid.tsx 397 Fit-column-width measurement (~line 1680) still uses the default dataGrid.null label, so auto-fit widths don't match the chosen NULL display
Files Reviewed (24 files)
  • packages/web-ui/src/components/settings/GeneralTab.tsx
  • packages/web-ui/src/components/ui/DataGrid.tsx - 1 issue
  • packages/web-ui/src/components/ui/DataGridRow.tsx
  • packages/web-ui/src/contexts/SettingsContext.ts
  • packages/web-ui/src/i18n/locales/*.json (11 files) - 1 issue (pt-BR)
  • packages/web-ui/src/utils/dataGridCell.tsx
  • packages/web-ui/src/utils/nullDisplay.ts
  • packages/web-ui/tests/components/settings/GeneralTab.test.tsx
  • packages/web-ui/tests/components/ui/DataGrid.test.tsx
  • packages/web-ui/tests/utils/dataGridCell.test.tsx
  • packages/web-ui/tests/utils/nullDisplay.test.ts
  • src-tauri/src/application/persistence.rs
  • src-tauri/src/application/persistence_tests.rs
  • src-tauri/src/config.rs

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5.5 · Input: 258 · Output: 895 · Cached: 158K

Review guidance: REVIEW.md from base branch main

debba
debba previously approved these changes Nov 2, 2026

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @Mittalnew for keeping this display-only and for adding the dot that distinguishes an empty-looking NULL from an empty string. I checked the grid rendering, width measurement and persistence changes, and ran the four changed frontend test files (158 tests) plus the persistence tests (10 tests) on this branch.

One small follow-up: please add settings.nullDisplay, settings.nullDisplayDesc and settings.nullDisplayEmpty to vi.json too. Vietnamese is in SUPPORTED_LANGUAGES, but those three new labels currently fall back to English.

I'm happy with this apart from that nit. I'll keep the merge pending my manual checks in the app.

@Mittalnew

Copy link
Copy Markdown
Contributor Author

@debba Thanks for the review. Added settings.nullDisplay, settings.nullDisplayDesc and settings.nullDisplayEmpty to vi.json.

@debba debba left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @Mittalnew for adding the three Vietnamese labels so this setting is covered there too. The NULL marker still distinguishes an empty-looking NULL from an empty string, and the chosen label is also used for column width measurement.

I checked the updated locale and the display and persistence paths on this head. All 340 selected frontend tests, including the locale checks, and the 10 Rust persistence tests pass. Typecheck passes too. I have not found any remaining issues. Approved.

@debba
debba merged commit ae5b1c3 into TabularisDB:main Nov 2, 2026
14 checks passed
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.

[Feat]: Settings: choose how NULL is shown in the data grid

2 participants