Skip to content

Commit 6addea5

Browse files
dprevost-LMImeta-codesync[bot]
authored andcommitted
fix(community-cli-plugin): Add description in target debugs to distinguish RN Bridge and reanimated (facebook#54198)
Summary: As I point out in this [issue](facebook#50696 (comment)), when integrating reanimated, we end up with two debug targets having the same title. This can confuse and lead people to think something is wrong. Adding the description alongside the title to better explain where the second debug target comes from eliminates the confusion. Changelog: [Internal] Pull Request resolved: facebook#54198 Test Plan: Tested in [this RN 82 project](https://github.com/dprevost-LMI/rn82/tree/reanimated) with the latest reanimated by overriding the code in the `node_module` Before: <img width="406" height="94" alt="Screenshot 2025-10-18 at 10 52 18 AM" src="https://github.com/user-attachments/assets/e517bf53-5176-479f-9fbb-3f4b46089395" /> After: <img width="522" height="78" alt="Screenshot 2025-10-18 at 10 56 27 AM" src="https://github.com/user-attachments/assets/aa14aebd-4c13-4249-bb00-63972302ab40" /> Reviewed By: hoxyq Differential Revision: D85041647 Pulled By: huntie fbshipit-source-id: 0a1cc9cc2fb0fadf31c8c60de19d77cfb01d072a
1 parent b78099b commit 6addea5

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

packages/community-cli-plugin/src/commands/start/OpenDebuggerKeyboardHandler.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,26 @@ export default class OpenDebuggerKeyboardHandler {
9494
const target = targets[0];
9595
void this.#tryOpenDebuggerForTarget(target);
9696
} else {
97-
this.#targetsShownForSelection = targets;
98-
9997
if (targets.length > 9) {
10098
this.#log(
10199
'warn',
102100
'10 or more debug targets available, showing the first 9.',
103101
);
104102
}
103+
const targetsShown = targets.slice(0, 9);
104+
const hasDuplicateTitles =
105+
new Set(targetsShown.map(target => target.title)).size <
106+
targetsShown.length;
107+
this.#targetsShownForSelection = targetsShown;
105108

106109
this.#setTerminalMenu(
107-
`Multiple debug targets available, please select:\n ${targets
108-
.slice(0, 9)
109-
.map(
110-
({title}, i) =>
111-
`${styleText(['white', 'inverse'], ` ${i + 1} `)} - "${title}"`,
112-
)
110+
`Multiple debug targets available, please select:\n ${targetsShown
111+
.map(({title, description}, i) => {
112+
const descriptionSuffix = hasDuplicateTitles
113+
? ` (${description})`
114+
: '';
115+
return `${styleText(['white', 'inverse'], ` ${i + 1} `)} - "${title}${descriptionSuffix}"`;
116+
})
113117
.join('\n ')}`,
114118
);
115119
}

0 commit comments

Comments
 (0)