summaryrefslogtreecommitdiffhomepage
path: root/src/features/layout/ui/TileStack.svelte
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-09-04 00:51:47 +0900
committerAdam Malczewski <[email protected]>2026-09-04 00:51:47 +0900
commit60a726883be85c174e88ae832ef95f3c0f084ec9 (patch)
treea2fa46d35041cab5a0c27f0080c58d9fe8443a12 /src/features/layout/ui/TileStack.svelte
parent3a4922a05930b0dc22740bf5621910803e8f275e (diff)
downloaddispatch-web-60a726883be85c174e88ae832ef95f3c0f084ec9.tar.gz
dispatch-web-60a726883be85c174e88ae832ef95f3c0f084ec9.zip
fix(plugins): make groupByTier duplicate-key-proof; normalize tiers at the boundary
PluginTable.svelte renders a keyed each ({#each groups as group (group.tier)}); groupByTier's old "rest" bucket for unknown tiers fell back to key "standard", producing a DUPLICATE standard group (and thus an each_key_duplicate crash in Svelte 5, blanking both manager tables) whenever tierless rows were present alongside canonical standard rows. groupByTier now buckets through a Map keyed by the NORMALIZED tier — each canonical tier can yield at most one group, so duplicate keys are impossible by construction, and no row is ever dropped. Unknown/missing tiers fold into the standard bucket rather than forming a separate trailing group. The normalization (normalizeTier, in types.ts next to tierLabel/TIER_ORDER) also runs at the pluginNodes boundary, so every node's tier is canonical before any tier-keyed consumer sees it — including tierLabel's exhaustive switch, which rendered an empty badge for out-of-contract values. Normalizing into an existing bucket (option a) was chosen over a synthetic "unknown" group because it needs no new UI vocabulary and keeps every consumer total. Tests: all-canonical order, unknown tier ("kernel"), and missing tier each assert no duplicate keys, no dropped rows, and the right group/row counts from the Loaded-table view; the boundary test pins pluginNodes' canonical output. Plugins-feature vitest green (95 tests); svelte-check, biome, and vite build green.
Diffstat (limited to 'src/features/layout/ui/TileStack.svelte')
0 files changed, 0 insertions, 0 deletions