Skip to content

Fix boolean field variants in combined item infoboxes#212

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-alchable-info-box
Draft

Fix boolean field variants in combined item infoboxes#212
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-alchable-info-box

Conversation

Copilot AI commented Feb 2, 2026

Copy link
Copy Markdown
Contributor

Description

Combined item pages with differing boolean field values were incorrectly using shared parameters instead of variants. This was a general issue affecting any boolean field where one variant had a defined value and another had undefined.

Examples:

  • Items where one is alchable and another isn't would output |alchable = No instead of |alchable1 = Yes and |alchable2 = No
  • Items where one is a placeholder and another isn't would output |placeholder = Yes instead of |placeholder1 = No and |placeholder2 = Yes

Root cause: InfoboxItem was setting boolean fields to undefined when they should be explicit boolean values. InfoboxTemplate.buildMultipleParams() filters out undefined values before comparison, causing it to incorrectly use shared parameters when values differ.

Changes

  • Changed alchable field (line 37): now returns true instead of undefined for alchable items (when NO_ALCHABLE_PARAM is not set)
  • Changed placeholder field (line 30): now returns false instead of undefined for non-placeholder items (when placeholderLinkedItem <= 1)
  • Added test case for combined items with different alchable values
  • Added test case for combined items with different placeholder values

Result

// Before: undefined filtered out → incorrect shared param
alchable: item.params?.get(NO_ALCHABLE_PARAM) === 1 ? false : undefined,
placeholder: item.placeholderLinkedItem > 1 ? true : undefined,

// After: explicit boolean values → correct variants
alchable: item.params?.get(NO_ALCHABLE_PARAM) === 1 ? false : true,
placeholder: item.placeholderLinkedItem > 1 ? true : false,

Now correctly outputs:

  • Both alchable → |alchable = Yes
  • Both not alchable → |alchable = No
  • Different alchable → |alchable1 = Yes and |alchable2 = No
  • Different placeholder → |placeholder1 = No and |placeholder2 = Yes

Checklist

  • Tests added for changes
  • Changeset added
Original prompt

I see a bug where the alchable info box item field is not correctly outputting for a combined item page. I believe this is simply due to it setting to undefined when an item does not have the no alch parameter. Because if one item has undefined it would not include the field, meaning when it gets combined instead of using variants it only sets the one that has Yes.

The proper solution might actually be to ensure the variants are used if one item has a field and the other does not.

Expected behavior:
|alchable1 = Yes
|alchable2 = No

Actual:
|alchable = Yes


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: allenkinzalow <2922507+allenkinzalow@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix alchable info box output for combined item page Fix alchable field variants in combined item infoboxes Feb 2, 2026
Copilot AI requested a review from allenkinzalow February 2, 2026 00:56

@allenkinzalow allenkinzalow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@copilot While this does fix the issue for alchable, it does not fix the issue where one item variant has a field as true and the other has undefined and it not treating those two values as field1=true, field2=false.

…ined

Co-authored-by: allenkinzalow <2922507+allenkinzalow@users.noreply.github.com>

Copilot AI commented Feb 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot While this does fix the issue for alchable, it does not fix the issue where one item variant has a field as true and the other has undefined and it not treating those two values as `field...

Fixed in commit 3f89cef. Changed both alchable and placeholder fields to use explicit true/false values instead of undefined. The template now correctly generates variants when fields differ (e.g., |alchable1 = Yes and |alchable2 = No). Added tests for both fields with combined items.

Copilot AI changed the title Fix alchable field variants in combined item infoboxes Fix boolean field variants in combined item infoboxes Feb 4, 2026
Copilot AI requested a review from allenkinzalow February 4, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants