Follow-up from review on #1057.
WorkflowGrid.vue builds pinRank = new Map(pinnedShareIds.map((id, i) => [id, i])), which keeps the LAST index for a repeated key, while use-case-resolver.ts dedupes pins first-wins. [slug].astro feeds raw def.pins (not the resolved list), so the two derivations can drift. Latent today (no page repeats a pin), and the client re-sort is genuinely required.
Proposed: extract one orderByPins(templates, pinnedShareIds) pure function used by both the resolver and the WorkflowGrid re-sort, with a unit test (the ordering is currently untested).
Reported by @MaanilVerma.
Follow-up from review on #1057.
WorkflowGrid.vuebuildspinRank = new Map(pinnedShareIds.map((id, i) => [id, i])), which keeps the LAST index for a repeated key, whileuse-case-resolver.tsdedupes pins first-wins.[slug].astrofeeds rawdef.pins(not the resolved list), so the two derivations can drift. Latent today (no page repeats a pin), and the client re-sort is genuinely required.Proposed: extract one
orderByPins(templates, pinnedShareIds)pure function used by both the resolver and the WorkflowGrid re-sort, with a unit test (the ordering is currently untested).Reported by @MaanilVerma.