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

Method refocusNode

frontend/app/store/focusManager.ts:76–95  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74 }
75
76 refocusNode() {
77 const ftype = globalStore.get(this.focusType);
78 if (ftype == "waveai") {
79 WaveAIModel.getInstance().focusInput();
80 return;
81 }
82 const layoutModel = getLayoutModelForStaticTab();
83 const lnode = globalStore.get(layoutModel.focusedNode);
84 if (lnode == null || lnode.data?.blockId == null) {
85 return;
86 }
87 layoutModel.focusNode(lnode.id);
88 const blockId = lnode.data.blockId;
89 const bcm = getBlockComponentModel(blockId);
90 const ok = bcm?.viewModel?.giveFocus?.();
91 if (!ok) {
92 const inputElem = document.getElementById(`${blockId}-dummy-focus`);
93 inputElem?.focus();
94 }
95 }
96}

Callers 3

setWaveAIFocusedMethod · 0.95
setBlockFocusMethod · 0.95
switchBlockInDirectionFunction · 0.80

Calls 7

getBlockComponentModelFunction · 0.90
getMethod · 0.80
focusInputMethod · 0.80
focusNodeMethod · 0.80
getInstanceMethod · 0.45
giveFocusMethod · 0.45

Tested by

no test coverage detected