Skip to content

Add individual label fields for pivot aggregation while keeping combined labels - #19

Merged
jumpingrabbit merged 5 commits into
mainfrom
copilot/fix-pivot-table-labels
Nov 10, 2025
Merged

jumpingrabbit merged 5 commits into
mainfrom
copilot/fix-pivot-table-labels

Conversation

Copilot AI commented Nov 10, 2025 •

Copy link
Copy Markdown
Contributor

Cards with multiple labels were aggregated as a single combined label (e.g., "Car, Home") instead of allowing each label to be counted independently in pivot operations.

Changes

src/js/modal.js:

  • Keep the original combined Labels field that joins all labels with commas
  • Add individual dynamic fields for each label (e.g., Label Car, Label Home)
  • Each card now has both the combined labels field AND individual label fields

.gitignore:

  • Added package-lock.json and .parcel-cache/ to prevent unnecessary files from being committed

Example

Before:

'Labels': cardItem.labels.map(label => label.name).join(', ')
// Card with ["Car", "Home"] → single row: { ..., Labels: "Car, Home" }

After:

'Labels': cardItem.labels.map(label => label.name).join(', ')
// Plus individual label fields:
cardItem.labels.forEach(label => {
    customMap[`Label ${label.name}`] = label.name;
});

// Card with ["Car", "Home"] → single row:
// { 
//   ..., 
//   Labels: "Car, Home",
//   "Label Car": "Car",
//   "Label Home": "Home"
// }

This approach allows users to:

  • Pivot on the combined Labels field for label combinations

  • Pivot on individual Label {name} fields to count each label separately

  • Fixes Labels #16

Original prompt

This section details on the original issue you should resolve

<issue_title>Labels</issue_title>
<issue_description>When using labels in pivot table, it shows all label combinations. If a card has multiple labels, it's showing that as a unique label, versus two separate labels.

For example if a card has a label of
"Car" "Home"

The pivot table lists it as "Car Home"
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 10, 2025 23:22
Co-authored-by: jumpingrabbit <13073856+jumpingrabbit@users.noreply.github.com>
…rows

Co-authored-by: jumpingrabbit <13073856+jumpingrabbit@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pivot table to show separate labels Explode multi-label cards into separate rows for pivot aggregation Nov 10, 2025
Copilot AI requested a review from jumpingrabbit November 10, 2025 23:28
@jumpingrabbit

Copy link
Copy Markdown
Member

@copilot No.

The idea is to have in addition to 'Labels': cardItem.labels.map(label => label.name).join(', ') also

Label {labels[0].name}: {labels[0].name},
Label {labels[1].name}: {labels[1].name},
...

Also, do not commit package-lock.json

Co-authored-by: jumpingrabbit <13073856+jumpingrabbit@users.noreply.github.com>

Copilot AI commented Nov 10, 2025

Copy link
Copy Markdown
Contributor Author

@copilot No.

The idea is to have in addition to 'Labels': cardItem.labels.map(label => label.name).join(', ') also
...

Updated the implementation in commit b780c89:

  • Kept the original 'Labels': cardItem.labels.map(label => label.name).join(', ') field
  • Added individual label fields: 'Label Car': 'Car', 'Label Home': 'Home', etc.
  • Removed package-lock.json and added it to .gitignore

Cards with multiple labels now have both the combined field and individual fields, allowing pivoting on either.

Copilot AI changed the title Explode multi-label cards into separate rows for pivot aggregation Add individual label fields for pivot aggregation while keeping combined labels Nov 10, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR resolves an issue where cards with multiple labels were aggregated as a single combined label instead of allowing each label to be counted independently in pivot operations.

  • Adds individual dynamic fields for each label (e.g., Label Car, Label Home) while preserving the existing combined Labels field
  • Updates .gitignore to exclude Parcel cache directory
  • Enables users to pivot on either combined label strings or individual labels

Reviewed Changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
src/js/modal.js Adds individual label fields to the card data map, creating separate pivotable fields for each label on a card
.gitignore Adds .parcel-cache/ directory to prevent build cache from being committed

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jumpingrabbit
jumpingrabbit merged commit 5b621e9 into main Nov 10, 2025
8 checks passed
@jumpingrabbit
jumpingrabbit deleted the copilot/fix-pivot-table-labels branch November 10, 2025 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Labels

3 participants