Skip to content

fix(mapping): correct category option listing in global mapping dialog#1051

Open
ifoche wants to merge 1 commit intodevelopmentfrom
fix/category-option-mapping
Open

fix(mapping): correct category option listing in global mapping dialog#1051
ifoche wants to merge 1 commit intodevelopmentfrom
fix/category-option-mapping

Conversation

@ifoche
Copy link
Copy Markdown
Member

@ifoche ifoche commented Mar 4, 2026

Summary

  • Fix duplicate category options in global mapping destination picker — each option now appears exactly once instead of N times (once per parent category)
  • Fix mapped selections appearing lost when re-opening the mapping dialog
  • Fix automap results being invisible in the selection window

Root cause: MappingDialog always used modelFactory("categoryOptions") which resolved to CategoryOptionMappedModel — a model that expands each category option into N composite-ID rows. The fix passes the correct model from MappingTable to MappingDialog via the config, using GlobalCategoryOptionModel (plain IDs, no expansion) for global mapping while preserving composite IDs for nested mapping.

Related Tasks

Test plan

  • Run yarn test — all 388 tests pass (47 files)
  • Run yarn build core-app — builds cleanly
  • Manual: go to Global Mapping, open category options mapping dialog, verify no duplicates
  • Manual: map a category option to a destination, close and re-open dialog, verify selection persists
  • Manual: use automap on category options, open dialog, verify automap result is visible
  • Manual: verify nested category option mapping (within a category combo) still works with composite IDs

🤖 Generated with Claude Code

MappingDialog always used modelFactory("categoryOptions") which resolved
to CategoryOptionMappedModel — a model that expands each category option
into N rows (one per parent category) with composite IDs. This caused
three bugs in global mapping: duplicate destination entries, mappings
appearing lost on re-open, and automap results invisible.

Fix by passing the source model from MappingTable to MappingDialog via
config, so the destination picker uses the same model as the source
(GlobalCategoryOptionModel for global mapping, which lists plain IDs
without category expansion). Falls back to modelFactory for nested
mapping contexts.

Also adds .claude/ to .gitignore and includes OpenSpec change artifacts.

Closes: https://app.clickup.com/t/869bvjqn0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bundlemon
Copy link
Copy Markdown

bundlemon bot commented Mar 4, 2026

BundleMon

No change in files bundle size

Groups updated (1)
Status Path Size Limits
Build Folder
./**/*
2.78MB (-111B 0%) +20%

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@ifoche ifoche force-pushed the fix/category-option-mapping branch from 1ce0c6f to 867e314 Compare March 4, 2026 15:23
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.

1 participant