fix(fresh-ui): key ChartBlock lists + correct Toast setTimeout ref type (#206)#223
Conversation
🤖 Augment PR SummarySummary: Fixes two registry-source issues in 🤖 Was this summary useful? React with 👍 or 👎 |
| <div class='ns-colchart__yaxis'> | ||
| {ticks.map((tick) => <span class='ns-colchart__ytick'>{formatTick(tick)}</span>)} | ||
| {ticks.map((tick, i) => ( | ||
| <span key={i} class='ns-colchart__ytick'>{formatTick(tick)}</span> |
There was a problem hiding this comment.
key={i} works for satisfying JSX key requirements, but if ticks/data can ever be inserted/reordered/filtered between renders, index keys can cause Preact to reconcile the wrong DOM nodes (e.g., bars/labels “swap” while keeping prior state). Consider using a stable value-based key (e.g., tick, or a stable datum identifier) when available.
Other locations where this applies: packages/fresh-ui/registry/components/ui/chart-block.tsx:76, packages/fresh-ui/registry/components/ui/chart-block.tsx:89
Severity: low
Other Locations
packages/fresh-ui/registry/components/ui/chart-block.tsx:76packages/fresh-ui/registry/components/ui/chart-block.tsx:89
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Summary
Fixes two copied-source registry defects in
@netscript/fresh-ui: ChartBlock column lists now have JSX keys, and Toast timeout refs use the actualsetTimeouthandle type under Deno/Node type scopes.Scope
@netscript/fresh-uiregistry source, Archetype 4, frontend overlaySlices
6a0aa156Validation
deno lint packages/fresh-ui/registry/components/ui/chart-block.tsx packages/fresh-ui/registry/islands/Toast.tsx— PASS,Checked 2 filesdeno check packages/fresh-ui/registry/islands/Toast.tsx— PASSdeno fmt --check packages/fresh-ui/registry/components/ui/chart-block.tsx packages/fresh-ui/registry/islands/Toast.tsx— PASS,Checked 2 filesHarness
.llm/tmp/run/fix-fresh-ui-registry-lint-check--206/Drift / Debt
packages/fresh-ui/registry/islands/Toast.tsx.Closes #206