Skip to content

fix(bindx-ui): offer no filter actions on an empty has-one cell - #137

Open
matej21 wants to merge 2 commits into
mainfrom
fix/has-one-column-empty-cell-filter
Open

matej21 wants to merge 2 commits into
mainfrom
fix/has-one-column-empty-cell-filter

Conversation

@matej21

@matej21 matej21 commented Sep 29, 2026

Copy link
Copy Markdown
Member

Fixes #136

Problem

DataGridHasOneColumn wraps every cell in the include/exclude filter tooltip when the related handle has an id. A disconnected has-one still returns a placeholder id (__placeholder_…), so an empty cell got the tooltip too. „Filter" or „Exclude" there stored the placeholder id in the filter artifact, and the server rejected the resulting { id: { eq: "__placeholder_…" } } condition as an invalid id.

Change

  • has-one-column.tsx: wrap the cell only when the related id is a persisted id (isPersistedId). An empty relation, and a temporary id, render the plain cell content.
  • An empty value stays filterable through the column's null („N/A") filter.
  • has-many-column.tsx is not changed: a has-many handle has no id, so its wrapper already returns the plain content.

Tests

  • New tests/react/dataview/hasOneColumnEmptyCellFilter.test.tsx: a grid with one connected and one empty author. The connected cell has the tooltip trigger; the empty cell has none. It fails on main (commit c741fad) and passes with the fix.
  • bun run typecheck and bun run test (2199 pass) pass locally. The browser suite was not run locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_013L98ArhvRJ1p7riCvTRXBf

matej21 and others added 2 commits September 29, 2026 13:09
A disconnected has-one still exposes a placeholder id, so the cell
wrapper's `if (!id)` guard never triggered on an empty relation. The
cell offered include/exclude, and either action filtered on
`__placeholder_…`, which the server rejects as an invalid id.

Wrap the cell only when the related id is a persisted one. An empty
value stays filterable through the column's null filter.

Fixes #136

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013L98ArhvRJ1p7riCvTRXBf
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.

DataGridHasOneColumn offers include/exclude on an empty has-one cell and filters on a placeholder id

1 participant