RightPanel/RelatedDesigns: patternsPerUser type is stricter than the getPatterns response it is filled from
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 65/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
Start with the PatternsPerUser interface and the patternsPerUser prop in the RightPanel and RelatedDesigns components, then check CustomCatalogCard and the onSuggestedPatternClick argument type. Compare them with GetPatternsApiResponse from @meshery/schemas 1.3.44. Done when patternsPerUser is optional, typed from the canonical response, and a host passing the getPatterns data type-checks without casts.
索引モデルが issue の本文から書いたものです。
説明
What is wrong
RightPanel and RelatedDesigns declare patternsPerUser as required and typed { patterns: Pattern[] }:
interface PatternsPerUser {
patterns: Pattern[];
}
Hosts fill this prop from the canonical getPatterns operation in @meshery/schemas. Its response (GetPatternsApiResponse) has patterns optional, and its items do not guarantee every field Pattern requires (avatarUrl, user, and the metric counts). So a host that passes the operation's data straight through gets a type error. This happens even against the @meshery/schemas 1.3.44 that Sistent itself depends on:
Type 'GetPatternsApiResponse | undefined' is not assignable to type 'PatternsPerUser'.
The component already treats the data as optional at runtime. RelatedDesigns reads patternsPerUser?.patterns?.filter((pattern) => pattern.id !== details.id) || [], and uses only id plus fields the card already treats as optional. The declared type is stricter than the code, so the only ways a host can satisfy it are inventing values or casting.
Proposed change
- Make
patternsPerUseroptional onRightPanelPropsandRelatedDesignsProps. - Type it from the canonical response, for example
Pick<GetPatternsApiResponse, 'patterns'>, rather than requiringPattern[]. - Narrow
onSuggestedPatternClick's argument andCustomCatalogCard'spatternto the fields they actually read.
Context
This surfaced when layer5labs/meshery-extensions moved to @sistent/sistent 0.23.0. Sistent 0.22.6's type declarations did not export RightPanel at all, so this mismatch was hidden behind a missing-export error. Kanvas records the one remaining error in its typecheck baseline, linked to this issue, until a Sistent release fixes the type.
- 主要言語
- TypeScript
- スター
- 140
- フォーク
- 244
- 平均マージ
- 2日 18時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
layer5io/sistent のほかの issue
-
area/docs language/markdown
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
PermissionShield: make the permissions docs link configurable instead of hard-coding docs.meshery.io対応中かも @SajanBisht が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
layer5io/sistent#1883 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
InfoTooltip is not keyboard reachable and has no accessible name再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
[UI] Permission Shield tooltip uses fixed `placement="top"` instead of adaptive placement対応中かも @dhruveshmishra が 85 日前に担当しました。 オープンcomponent/ui help wanted kind/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
layer5io/sistent#1772 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
Barrel re-exports DateTimePickerProps from the optional peer @mui/x-date-pickers, so the type is `any` for consumers who skip it対応中かも @Valyrian-Code が 95 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
layer5io/sistent#1749 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
layer5io/sistent の issue をすべて見る
似ている issue
-
b:minor bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
software-mansion/argent#1698 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
better-auth/better-auth#12132 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
automation missing-model model-sync provider:tinfoil
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
anomalyco/models.dev#12053 ·
メンテナーはふだん 1 日以内に返信
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
hurttlocker/o8#5112 ·