Skip to content

fix: merge keeps matching label/comments/color instead of joining duplicates#532

Open
FelipeDefensor wants to merge 1 commit into
TimeLineAnnotator:devfrom
FelipeDefensor:fix/merge-keeps-matching-fields
Open

fix: merge keeps matching label/comments/color instead of joining duplicates#532
FelipeDefensor wants to merge 1 commit into
TimeLineAnnotator:devfrom
FelipeDefensor:fix/merge-keeps-matching-fields

Conversation

@FelipeDefensor

Copy link
Copy Markdown
Collaborator

Summary

  • When every merged hierarchy has the same label or comments, the merged unit adopts that single value instead of concatenating identical copies with the configured separator.
  • Same rule for color: when every merged unit shares a non-empty color, the merged unit keeps it (previously color was always dropped on merge).

Test plan

  • pytest -n auto tests/timelines/hierarchy tests/ui/timelines/hierarchy — 172 passed.
  • New tests cover identical-values-no-separator, mixed empties + identical non-empties, identical colors preserved, differing colors fall back to empty.

…oining duplicates

When every selected hierarchy has the same label, comments, or color,
the merged unit adopts that single value. Previously identical labels
and comments were concatenated with the merge separator, and the color
was always dropped on merge.
@FelipeDefensor FelipeDefensor added this to the 0.6.3 milestone May 13, 2026
@FelipeDefensor FelipeDefensor requested a review from azfoo June 23, 2026 15:10
@FelipeDefensor FelipeDefensor modified the milestones: 0.6.3, 0.6.4 Jun 23, 2026
@FelipeDefensor

Copy link
Copy Markdown
Collaborator Author

Forgot to ask for a review on this one, sorry.

@azfoo azfoo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

just that one line, good to go otherwise.

Comment on lines +411 to +413
colors = [h.color for h in hierarchies]
if colors[0] and all(c == colors[0] for c in colors[1:]):
attr_to_new_value["color"] = colors[0]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

perhaps:

colors = (h.color for h in hierarchies)
if len(colors) == 1: ...

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