Skip to content

Commit

Permalink
Don't try to sync-navigate to a node that is hidden in layout.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 683220206
  • Loading branch information
Google AI Edge authored and copybara-github committed Oct 7, 2024
1 parent 557efd5 commit 79b2a87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/ui/src/components/visualizer/sync_navigation_button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,13 @@ export class SyncNavigationButton {
SyncNavigationMode.MATCH_NODE_ID,
SyncNavigationMode.VISUALIZER_CONFIG,
SyncNavigationMode.UPLOAD_MAPPING_FROM_COMPUTER,
SyncNavigationMode.LOAD_MAPPING_FROM_CNS,
]
: [
SyncNavigationMode.DISABLED,
SyncNavigationMode.MATCH_NODE_ID,
SyncNavigationMode.UPLOAD_MAPPING_FROM_COMPUTER,
SyncNavigationMode.LOAD_MAPPING_FROM_CNS,
];

// If there is sync navigation data passed through visualizer config, set
// the sync navigation data for the "visualizer config" mode and select the
// mode by default.
Expand Down
7 changes: 6 additions & 1 deletion src/ui/src/components/visualizer/webgl_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,12 @@ export class WebglRenderer implements OnInit, OnDestroy {
data.nodeId,
);
const mappedNode = this.curModelGraph.nodesById[mappedNodeId];
if (mappedNode && mappedNode.id !== this.selectedNodeId) {
const hideInLayout = isOpNode(mappedNode) && mappedNode.hideInLayout;
if (
mappedNode &&
mappedNode.id !== this.selectedNodeId &&
!hideInLayout
) {
this.revealNode(mappedNodeId, false);
}
}
Expand Down

0 comments on commit 79b2a87

Please sign in to comment.