Skip to content

chore: upgrade @meshery/schemas to v1.0.5 and use View types#1396

Merged
leecalcote merged 2 commits intomasterfrom
chore/upgrade-schemas-v1.0.5-view-types
Apr 7, 2026
Merged

chore: upgrade @meshery/schemas to v1.0.5 and use View types#1396
leecalcote merged 2 commits intomasterfrom
chore/upgrade-schemas-v1.0.5-view-types

Conversation

@yi-nuo426
Copy link
Copy Markdown
Contributor

Summary

  • Bump @meshery/schemas from ^1.0.4 to ^1.0.5
  • Replace Pattern stand-in type with MesheryViewWithLocation from schemas v1.0.5 in useViewsAssignment.tsx
  • Add type guards for optional id field (schema View has id?: string vs Pattern's required id: string)

The View components in Sistent were using the Pattern type as a stand-in since no proper View types existed. Schemas v1.0.5 provides dedicated View types in v1beta1/view/View.ts.

Resolves #1394
Resolves #1395

Test plan

  • All 21 tests pass (verified in pre-commit hook)
  • npm run build succeeds after npm install pulls v1.0.5
  • Workspace View assignment/unassignment flows work correctly

Replace Pattern stand-in type with proper MesheryViewWithLocation
from the dedicated view package in workspace View components.

Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
Copilot AI review requested due to automatic review settings April 7, 2026 05:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades @meshery/schemas and updates the workspace view-assignment hook to use the newly available View types from schemas v1.0.5, replacing the prior Pattern stand-in.

Changes:

  • Bump @meshery/schemas dependency from ^1.0.4 to ^1.0.5.
  • Update useViewsAssignment.tsx to use MesheryViewWithLocation from schemas instead of Pattern.
  • Add ID type-guards to handle id?: string in the View schema when computing added/removed IDs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/custom/Workspaces/hooks/useViewsAssignment.tsx Switch hook generics/state to schema View types and add ID filtering to support optional id.
package.json Upgrade @meshery/schemas to v1.0.5.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…wsAssignment

Filter out views with undefined id when setting state to prevent
unstable React keys downstream. Replace !!id with typeof id === 'string'
for explicit type narrowing that correctly handles edge cases.

Signed-off-by: Lee Calcote <lee.calcote@layer5.io>
@leecalcote leecalcote merged commit 36455fc into master Apr 7, 2026
5 checks passed
@leecalcote leecalcote deleted the chore/upgrade-schemas-v1.0.5-view-types branch April 7, 2026 05:58
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.

feat: Update View components to use standalone View schema types chore: Upgrade @meshery/schemas to v1.0.5

3 participants