Skip to content

Export the feature-row classification alongside the points feature state - #146

Merged
xinaesthete merged 1 commit into
mainfrom
claude/export-feature-row-state
Aug 12, 2026
Merged

Export the feature-row classification alongside the points feature state#146
xinaesthete merged 1 commit into
mainfrom
claude/export-feature-row-state

Conversation

@xinaesthete

Copy link
Copy Markdown
Contributor

Follow-on to #144, found while building the equivalent points feature UI in MDV against the published 0.7.0.

The gap

#144 exported usePointsFeatureState, which returns the raw engine signals for a layer: residentCodes, loadedMatchingCodes, matchingLoadState, supportsOnDemandLoad. What it does not export is the thing that reads those signals.

describeFeatureRowState takes the six booleans a feature list already has and returns the row's rendered state — greyed, a short label, and a sentence explaining why — with a precedence that is not obvious from the outside:

  • resident / rendered (its points are in memory) beat selection and scan state;
  • a deselected-but-loaded feature is cached, not dropped, because deselecting filters the in-memory batch rather than re-scanning;
  • !residentKnown means "can't distinguish", which has to read as shown, not as not loaded.

Get that order wrong and the panel greys a feature the canvas is currently drawing. That is exactly the class of divergence the built-in panel's comment calls out ("drives both the dimming and the diagnostic tooltip so they can never disagree") — but only for consumers who can reach the function.

What this adds

Values: describeFeatureRowState, featureRowOpacity.
Types: FeatureRowState, FeatureRowStateInput, FeatureRowTone.

Both were already exported from featureRowState.ts; this re-exports them through SpatialCanvas/public.ts and the package entry, which is the only route out (the package publishes just a "." export). No behaviour change — PointsFeatureFilterPanel is already the caller.

The module was deliberately split out of the panel file so it exports no component (a mixed component + plain-function export breaks Fast Refresh for that file). Re-exporting through public.ts keeps that split intact.

Verification

  • pnpm --filter @spatialdata/vis build, then imported the built dist/index.js: both values resolve as functions, and calling describeFeatureRowState with a selected+scanning row returns {tone: "loading", greyed: true, …} with featureRowOpacity 0.6. Types present in dist/index.d.ts.
  • pnpm --filter @spatialdata/vis test — 149 tests, 16 files, passing.
  • Biome clean.

Minor changeset included.

`usePointsFeatureState` hands back the raw engine signals for a feature —
resident, rendered, scanning, whether the element supports an on-demand scan —
and `describeFeatureRowState` is what reads them: dimmed or not, a short label,
and the sentence explaining why. Only the first half was reachable from the
package entry, so an embedder building its own feature list got the data without
the reading of it, and had to re-derive a precedence (resident/rendered beat
selection and scan state) whose failure mode is a panel greying a feature the
canvas is drawing.

No behaviour change; these already backed the built-in feature filter panel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@xinaesthete, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4fd09b94-ebfd-4ba4-b8f2-7dd8eafc6e77

📥 Commits

Reviewing files that changed from the base of the PR and between 1996ffe and f460ee8.

📒 Files selected for processing (3)
  • .changeset/export-feature-row-classification.md
  • packages/vis/src/SpatialCanvas/public.ts
  • packages/vis/src/index.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@xinaesthete
xinaesthete merged commit 9cd27cc into main Aug 12, 2026
7 checks passed
@xinaesthete
xinaesthete deleted the claude/export-feature-row-state branch August 12, 2026 12:44
This was referenced Aug 12, 2026
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.

1 participant