Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

RightPanel/RelatedDesigns: patternsPerUser type is stricter than the getPatterns response it is filled from

オープン
#1,873 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@PARTH-TUSSLE がすでに取り組んでいます。

2026年10月18日 から。

  • #1882 @PARTH-TUSSLE による — オープン

評価

難易度
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 patternsPerUser optional on RightPanelProps and RelatedDesignsProps.
  • Type it from the canonical response, for example Pick<GetPatternsApiResponse, 'patterns'>, rather than requiring Pattern[].
  • Narrow onSuggestedPatternClick's argument and CustomCatalogCard's pattern to 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

layer5io/sistent のほかの issue

layer5io/sistent の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。