Skip to content

Extend reflexive association limit from 2 to 4#30

Merged
haan merged 3 commits into
mainfrom
feat/reflexive-associations-limit-4
May 12, 2026
Merged

Extend reflexive association limit from 2 to 4#30
haan merged 3 commits into
mainfrom
feat/reflexive-associations-limit-4

Conversation

@haan
Copy link
Copy Markdown
Owner

@haan haan commented May 12, 2026

Closes #29

Summary

  • Adds two new reflexive association positions: lower-right (index 2) and lower-left (index 3), completing a clockwise arrangement around the node corners
  • Lower loops mirror the upper-loop geometry vertically: anchors attach to the bottom edge of the node and the loop extends downward
  • Label transforms (multiplicities, roles, association name) and resize handle drag direction are updated for lower loops
  • The interactive limit check, Java import limit, and dialog copy are all updated from 2 to 4

Test plan

  • All 316 unit tests pass (npm test)
  • Draw a class with 4 reflexive associations and verify all four corners render correctly clockwise
  • Check multiplicity and role labels appear on the correct sides without overlap for all four positions
  • Drag width and height handles on lower-right and lower-left loops and confirm they resize correctly
  • Attempt to add a 5th reflexive association and confirm the limit dialog appears
  • Import a Java model with 4 reflexive associations on one class and confirm all 4 are imported

Laurent Haan added 3 commits May 12, 2026 14:45
Adds lower-right (index 2) and lower-left (index 3) positions, arranged
clockwise from the existing upper-left and upper-right. Lower loops mirror
the upper geometry vertically, extending downward from the bottom edge of
the node. Label transforms, resize handle drag direction, and side
assignment logic are all updated accordingly. The import limit and the
limit dialog copy are updated to reflect four.
The side check only matched 'right', so 'lower-right' fell into the
left-side branch and computed the width in the wrong direction. Both
right-side positions extend outerX to the right of the node and need
nextPoint.x - startAnchor.x.
- Expose isRight from getReflexiveAssociationLayout so callers do not
  re-derive it from side string comparisons; use layout.isRight in both
  ReflexiveAssociation.jsx and useModelState.js
- Rename topSegmentCenter to outerEdgeSegmentCenter to match the
  outerEdgeY naming introduced for lower loops
- Extract getEndRoleTransform helper in ReflexiveAssociation.jsx for
  consistency with the other three label transform functions
- Remove getOppositeReflexiveSide, which had no remaining callers after
  the third-pass logic was replaced with the four-side cycle
- Add tests: outerX direction for all four sides, four reflexive edges
  each assigned a distinct side, import limit accepts 4 and drops a 5th
- Fix javaModelizerImport test to filter by REFLEXIVE_EDGE_TYPE instead
  of the incorrect "reflexive" string (test was passing vacuously)
@haan haan self-assigned this May 12, 2026
@haan haan merged commit 6e40412 into main May 12, 2026
1 check passed
@haan haan deleted the feat/reflexive-associations-limit-4 branch May 12, 2026 13:13
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.

Feature: increase reflexive association limit

1 participant