From dd95486e7f552c387533b76db05b385c17e219e2 Mon Sep 17 00:00:00 2001 From: james hadfield Date: Wed, 12 Jun 2024 14:50:58 +1200 Subject: [PATCH] Allow branch labels from second tree Branch labels were already rendered correctly on the RHS tree if the key was present in the LHS tree, so all that's required is to add label keys which are only observed in the RHS tree to appear in the sidebar branch label selector. Closes #1780 --- src/components/controls/choose-branch-labelling.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/controls/choose-branch-labelling.js b/src/components/controls/choose-branch-labelling.js index 20ed093fa..36539c4b2 100644 --- a/src/components/controls/choose-branch-labelling.js +++ b/src/components/controls/choose-branch-labelling.js @@ -11,7 +11,10 @@ import Toggle from "./toggle"; @connect((state) => ({ selected: state.controls.selectedBranchLabel, showAll: state.controls.showAllBranchLabels, - available: state.tree.availableBranchLabels, + available: Array.from( + (new Set(state.tree.availableBranchLabels)) + .union(new Set(state.treeToo?.availableBranchLabels ?? [])) + ), canRenderBranchLabels: state.controls.canRenderBranchLabels })) class ChooseBranchLabelling extends React.Component {