Nested Groups Fixes
This commit is contained in:
@@ -83,10 +83,19 @@
|
||||
lastColorMapId = colorMapId;
|
||||
});
|
||||
|
||||
// Get all interactive button indices
|
||||
// Helper to check if a line or its children contain buttons
|
||||
function hasButtons(line: TerminalLine): boolean {
|
||||
if (line.type === 'button') return true;
|
||||
if (line.type === 'group' && line.children) {
|
||||
return line.children.some(child => hasButtons(child));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get all interactive button indices (including buttons nested in groups)
|
||||
const buttonIndices = $derived(
|
||||
displayedLines
|
||||
.map((item, i) => item.parsed.line.type === 'button' ? i : -1)
|
||||
.map((item, i) => hasButtons(item.parsed.line) ? i : -1)
|
||||
.filter(i => i !== -1)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user