Skip to content

[Frontend][Review] Headlines are paired to operations by index while the two arrays use different orderings #2563

Description

@Chris0Jeky

What

ReviewProposalCard.vue pairs presentation headlines with operations by array index, but the two arrays are not guaranteed to be in the same order, so a multi-operation proposal can display the wrong headline against an operation.

Mechanism

  • AutomationProposalService.BuildPresentation (backend/src/Taskdeck.Application/Services/AutomationProposalService.cs:1735-1737) builds presentation.operationHeadlines sorted by Sequence.
  • MapToDto (same file, :1650) maps proposal.Operations in unordered EF .Include order.
  • ReviewProposalCard.vue:120-126 then indexes one array with the other's position.

When EF returns operations in an order that does not match Sequence, headline n is rendered against operation n of a differently-ordered list. On a review surface whose entire purpose is that the human sees exactly what will be applied, a mispaired headline is a trust defect rather than a cosmetic one.

Why it is filed rather than fixed in PR #2541

Found during the review of #2541 (move-card headline enrichment). It is pre-existing, independent of that PR's gate fix, and fixing it there would have widened a scoped fix beyond its finding.

Suggested fix

Sort operations by sequence before indexing. PaperReviewView.vue:953-956 already does exactly this and is the reference shape.

Belt-and-braces alternative: have the backend emit operations pre-sorted by Sequence in MapToDto, so both consumers get a stable contract instead of each re-sorting. That is the better fix if the DTO order is not relied on elsewhere.

Also worth knowing (declined, recorded so it is not re-raised)

A related concern about operationColumnId falling back to sourceColumnId was raised and declined as unreachable: grep -rn "sourceColumnId" backend/src finds it only as a local variable in ProposalConflictDetector.cs:411-424. No operation parameters payload ever carries that key.

Refs #1761

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

    Priority VMeta-tracking, archival consistency, historical context.bugSomething isn't workingfrontendPrimary implementation impact in Vue/TypeScript UI and client runtime.product-truthProduct or docs claim something unsupported, misleading, or silently untrue; truth-repair work.

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions