Skip to content

Commit 3c4682e

Browse files
committed
Ensure nodes are expanded
1 parent bb61b5e commit 3c4682e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

extensions/ql-vscode/src/view/results/alert-table.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ export class PathTable extends React.Component<PathTableProps, PathTableState> {
344344

345345
jumpToLocation(loc, this.props.databaseUri);
346346
const newSelection = { ...selectedPath, pathNodeIndex: nextIndex };
347-
return { ...prevState, selectedItem: newSelection };
347+
const newExpanded = new Set(prevState.expanded);
348+
// In case we're jumping from the main alert row to its first path step, expand the enclosing nodes so the selected
349+
// node is actually visible.
350+
newExpanded.add(Keys.keyToString({ resultIndex: newSelection.resultIndex }));
351+
newExpanded.add(Keys.keyToString({ resultIndex: newSelection.resultIndex, pathIndex: newSelection.pathIndex }));
352+
return { ...prevState, selectedItem: newSelection, expanded: newExpanded };
348353
});
349354
}
350355

0 commit comments

Comments
 (0)