Skip to content

Export the points feature-state API from the vis entry point - #144

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

Export the points feature-state API from the vis entry point#144
xinaesthete merged 1 commit into
mainfrom
claude/export-points-feature-state

Conversation

@xinaesthete

@xinaesthete xinaesthete commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Re-exports the points feature-state API from packages/vis/src/index.ts.

The gap

SpatialCanvas/public.ts already exports PointsFeatureStateProvider, usePointsFeatureState and the points engine types, and the comment above them describes the intended integration:

…take pointsEngine + resolvePointsTarget off the renderer-hook result, wrap a subtree in <PointsFeatureStateProvider>, and consume the usePoints* hooks.

But src/index.ts never re-exported any of it, and the package publishes only a "." export, so there is no deep-import route either. In published 0.6.0 the sole occurrence of usePointsFeatureState in dist/index.js is inside an error message string.

So the documented path is reachable from inside this repo and nowhere else. The demo panels work because they import by relative path, which is why nothing caught it.

What this adds

Values: PointsFeatureStateProvider, usePointsFeatureState.
Types: PointsDataEngine, PointsLoadTarget, PointsFeatureState, PointsFeatureSelection, PointsFeatureStateProviderProps.

No behaviour change — this is purely the surface an embedding application needs in order to build its own points feature UI instead of reimplementing the engine subscription.

Why it came up

Building the equivalent points layer UI in MDV. The engine itself is reachable, structurally, through useSpatialCanvasRendererFromLayerInputs's return type — so MDV can bridge it from the chart to its layer dialog, which is what it now does. What is not reachable is the React state layer, leaving an embedder to hand-roll the useSyncExternalStore subscription and its derived reads. That is around 40 lines of duplicated logic plus the React Compiler 'use no memo' hatch these hooks need, which is the kind of thing worth not having two of.

Verification

  • pnpm --filter @spatialdata/vis build, then imported the built dist/index.js: both values resolve as functions, and the types appear in dist/index.d.ts.
  • pnpm --filter @spatialdata/vis test — 149 tests, 16 files, passing.
  • Biome clean.

Minor changeset included, so this can go out in the next release.

Summary by CodeRabbit

  • New Features

    • Added public exports for the points feature-state provider and hook.
    • Added public access to related points engine and state types, enabling easier integration with the package.
  • Documentation

    • Documented the new points feature-state API exports.

`SpatialCanvas/public.ts` exports `PointsFeatureStateProvider`,
`usePointsFeatureState` and the engine types, and its comment tells you to take
`pointsEngine` off the renderer hook and wrap a subtree in the provider. But
`src/index.ts` never re-exported any of it, and the package publishes only a "."
export, so there was no deep-import route either — the documented path was
reachable from inside this repo and nowhere else. The demo panels work because
they import by relative path, which is why nothing caught it.

Found while building the equivalent points UI in MDV, where the engine is
reachable through the renderer's return type but the React state layer is not,
leaving an embedder to reimplement the engine subscription instead.

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

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ed22ff61-e1c3-4a10-a7eb-e06b5888264c

📥 Commits

Reviewing files that changed from the base of the PR and between 5efb75d and 1448450.

📒 Files selected for processing (2)
  • .changeset/export-the-points-feature-state-api.md
  • packages/vis/src/index.ts

📝 Walkthrough

Walkthrough

The package entry now exports the points feature-state provider, hook, and related engine and state types. A changeset documents these public exports. No behavior changes are introduced.

Changes

Points feature-state API

Layer / File(s) Summary
Expose points feature-state API
.changeset/export-the-points-feature-state-api.md, packages/vis/src/index.ts
The package entry exports the points engine and feature-state types, PointsFeatureStateProvider, and usePointsFeatureState. The changeset documents the new public API.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: exporting the points feature-state API from the vis entry point.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/export-points-feature-state

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 b7059d8 into main Aug 12, 2026
7 checks passed
@xinaesthete
xinaesthete deleted the claude/export-points-feature-state branch August 12, 2026 11:21
@github-actions github-actions Bot mentioned this pull request 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