WORK-344
Setting up your dashboard 0 entities found · 9/32 branches scanned
ID:WORK-344Status:ready

Expose group metadata in collection item templates

When collection groups results, the per-item template can't see which group it belongs to or that group's size — so authors drop to aggregate for anything group-aware. Expose the group key (and count) on $item so grouped collections can render group context inline.

Priority:lowComplexity:simpleMilestone:v0.19.0Source:SPEC-070
claude/v0.19-milestone-planning View source

Criteria completion

Criteria completion: 0 of 4 (0%) checked; tracking started on Jun 3, no incremental history yet0%25%50%75%100%Jun 3Jun 15

Tracking started Jun 3 — check back for trends.

Branches 3
claude/v0.19-milestone-planning current ready
changeset-release/main readyclaude/v0.19.0-rollups-2 donemain done
History 1
  1. 33e11b7
    Created (ready)by bjornolofandersson

Acceptance Criteria

  • In a grouped collection, the per-item template can read the item's group key (e.g. $item.group).
  • The group's size is available to the template (e.g. $item.groupCount).
  • Ungrouped collections are unaffected; existing templates keep working.
  • Tests cover a grouped template reading the group key and count.

Approach

In collection-resolve.ts, when grouping, bind the group key/count into the $item scope passed to transformDeferredTemplate for each item. Reuse the groupEntities output which already knows group membership.

References

  • packages/runes/src/collection-resolve.ts, collection-helpers.ts
  • SPEC-070