Skip to content

feat(schema): per-component searchable, filterable, sortable and facetable flags - #261

Merged
Plopix merged 2 commits into
mainfrom
feat/schema-component-indexing-flags
Oct 29, 2026
Merged

Plopix merged 2 commits into
mainfrom
feat/schema-component-indexing-flags

Conversation

@Plopix

@Plopix Plopix commented Oct 29, 2026

Copy link
Copy Markdown
Member

What

Declares the four per-component Discovery indexing flags on the shared component config base, so every component type's input and output config accepts and keeps them:

  • searchable, filterable, sortable, facetable — optional booleans, undefined means true, query surface only (discoverable: false stays the master switch; changes take effect at the tenant's next re-ignition).

Bumps the package to 6.17.0.

Why

The mass-operations worker validates every file with OperationsSchema and hands the parsed result on, and zod strips undeclared keys. So today a file with config.singleLine.searchable: false validates and the flag is silently dropped before it reaches the API. The backend side landed in CrystallizeAPI/crystallize#940 (held until this is published and pinned).

Tests

  • tests/mass-operation/component-indexing-flags.test.ts: round trip for all 19 component types, nested inside contentChunk / componentChoice / componentMultipleChoice / piece, variant components, shape and piece create/update/upsert; unset stays unset; false is kept distinct from unset; non-boolean values and null are rejected (same contract as required and discoverable); the read-side ShapeSchema keeps the flags.
  • Fixture tests/mass-operation/valid-files/mass-ops-shape-indexing-flags.json covering every type.

Release

Independent of #260 (selection option label), merges cleanly with it in either order. #260 has no version bump, so merging both before tagging gives one 6.17.0 covering both. Backend follow-up after publish: bump the pin and name the flags explicitly in the mass-op config input mapper.

…table flags

Mirrors crystallize-backend ab0c4e40b0 (#940), which added the four Discovery
indexing flags to the component base config.

The mass-operations worker hands OperationsSchema's parsed output to the
converters, and zod strips unknown keys, so until this schema declared them a
mass-operation file setting `searchable: false` on a shape component validated
fine and the flag was silently dropped before reaching the API.

Added to GenericComponentConfigSchema so every component config, input and
output, gets them: the structural ones (contentChunk, componentChoice,
componentMultipleChoice, piece) and the derived ones (paragraphCollection,
itemRelations, numeric, propertiesTable, colors, selection, singleLine, files)
included. Optional booleans with no default: unset stays unset, which the
backend reads as "on"; `false` is the point.
@Plopix
Plopix merged commit ae3bf14 into main Oct 29, 2026
4 checks passed
@Plopix
Plopix deleted the feat/schema-component-indexing-flags branch October 29, 2026 21:41
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