Skip to content

Unify pin ordering: WorkflowGrid re-sort vs use-case-resolver dedup have opposite duplicate semantics #1071

Description

@mobeenabdullah

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions