Skip to content

Conversation

@andrewwallacespeckle
Copy link
Contributor

@andrewwallacespeckle andrewwallacespeckle commented Oct 7, 2025

Ensures type safety between frontend and backend for viewer filtering system.

Shared package:

  • Added Zod schemas for all filter condition types (NumericFilterCondition, StringFilterCondition, BooleanFilterCondition, ExistenceFilterCondition)
  • Added runtime value objects (*Values) for use with Object.values()
  • Export validation helpers: parseSerializedFilters(), parseQueryCriteria()
  • Export discriminated union type SerializedFilterData for type-safe filter serialization

Frontend:

  • Replaced local enum definitions with imports from @speckle/shared/viewer/filters
  • Maintained backward compatibility via const objects that support dot notation (e.g., NumericFilterCondition.IsBetween)
  • Updated getConditionsForType() to use new *Values objects

@andrewwallacespeckle andrewwallacespeckle changed the title feat(fe): shared filter types using zod chore(fe): migrate frontend filter types to shared zod schemas Oct 7, 2025
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.

2 participants