RightPanel/RelatedDesigns: patternsPerUser type is stricter than the getPatterns response it is filled from
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 140
- Fork
- 243
- Merge medio
- 6g 23h
- PR unite (30g)
- 13
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di layer5io/sistent
-
InfoTooltip is not keyboard reachable and has no accessible nameForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
[UI] Permission Shield tooltip uses fixed `placement="top"` instead of adaptive placementForse già presa @dhruveshmishra l’ha presa 72 giorni fa. Apertacomponent/ui help wanted kind/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
layer5io/sistent#1772 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Barrel re-exports DateTimePickerProps from the optional peer @mui/x-date-pickers, so the type is `any` for consumers who skip itForse già presa @Valyrian-Code l’ha presa 82 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
layer5io/sistent#1749 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
ESM build is not loadable by Node: extensionless 'lodash/debounce' specifier in dist/index.mjsForse di nuovo libera @Salmaan-M l’ha presa 86 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
layer5io/sistent#1739 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] Modal hardcodes aria-labelledby and aria-describedby pointing to nonexistent element IDsForse già presa @PARTH-TUSSLE l’ha presa 6 giorni fa. Apertacomponent/ui kind/bug language/typescript
layer5io/sistent#1864 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di layer5io/sistent
Issue simili
-
bug engine
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
frostney/GocciaScript#1746 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
agilepathway/label-checker#739 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
CopilotKit/OpenBot#800 ·
I maintainer di solito rispondono entro 1 giorno
-
Endpoint links in the tag operations list are below the 24px target sizeForse già presa @AdzerKI l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
ehmpathy/rhachet-roles-bhuild#471 ·
I maintainer di solito rispondono entro 1 giorno