MCPcopy
hub / github.com/wavetermdev/waveterm / refocusNode

Function refocusNode

frontend/app/store/global.ts:574–593  ·  view source on GitHub ↗
(blockId: string)

Source from the content-addressed store, hash-verified

572
573// pass null to refocus the currently focused block
574function refocusNode(blockId: string) {
575 if (blockId == null) {
576 blockId = getFocusedBlockId();
577 if (blockId == null) {
578 return;
579 }
580 }
581 const layoutModel = getLayoutModelForStaticTab();
582 const layoutNodeId = layoutModel.getNodeByBlockId(blockId);
583 if (layoutNodeId?.id == null) {
584 return;
585 }
586 layoutModel.focusNode(layoutNodeId.id);
587 const bcm = getBlockComponentModel(blockId);
588 const ok = bcm?.viewModel?.giveFocus?.();
589 if (!ok) {
590 const inputElem = document.getElementById(`${blockId}-dummy-focus`);
591 inputElem?.focus();
592 }
593}
594
595async function loadConnStatus() {
596 const connStatusArr = await ClientService.GetAllConnStatus();

Callers 8

handleMouseDownFunction · 0.90
setAIPanelVisibleMethod · 0.90
globalRefocusFunction · 0.90
goParentDirectoryMethod · 0.90
handleOpenFileMethod · 0.90
tab.tsxFile · 0.90
handleBlurFunction · 0.90

Calls 6

getFocusedBlockIdFunction · 0.85
getBlockComponentModelFunction · 0.85
getNodeByBlockIdMethod · 0.80
focusNodeMethod · 0.80
giveFocusMethod · 0.45

Tested by

no test coverage detected