diff --git a/src/main.tsx b/src/main.tsx index 2e7ef0a5..cab59775 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -568,10 +568,31 @@ class CmdInput extends React.Component<{}, {}> { let istrIdx : number = 0; let line : string = null; let idx : number = 0; + let hitems : HistoryItem[] = inputModel.historyItems.get() ?? []; return ( -
+
- history! +
+ showing history for + {" "} + [this session ⌘S] + {" "} + [this window ⌘W] + {" "} + [this remote ⌘R] + {" "} + [including metacmds ⌘M] +
+
+ + [no history] + + 0}> + +
{idx+1} item
+
+
+
diff --git a/src/model.ts b/src/model.ts index 066a4f69..fec0681c 100644 --- a/src/model.ts +++ b/src/model.ts @@ -604,7 +604,7 @@ class InputModel { } this.historyShow.set(true); this.historyItems.set(hinfo.items); - }); + })(); } flashInfoMsg(info : InfoType, timeoutMs : number) : void { @@ -1294,8 +1294,10 @@ class Model { loadSessionList() : void { let url = new URL("http://localhost:8080/api/get-all-sessions"); fetch(url).then((resp) => handleJsonFetchResponse(url, resp)).then((data) => { - this.runUpdate(data.data, false); - this.sessionListLoaded.set(true); + mobx.action(() => { + this.runUpdate(data.data, false); + this.sessionListLoaded.set(true); + })(); return; }).catch((err) => { this.errorHandler("getting session list", err, false); diff --git a/src/sh2.less b/src/sh2.less index 5f0c9a7d..726c027e 100644 --- a/src/sh2.less +++ b/src/sh2.less @@ -43,7 +43,7 @@ html, body, #main { display: flex; flex-direction: row; background-color: black; - flex-grow: 1; + height: calc(100% - 45px); .session-view { flex-grow: 1; @@ -534,7 +534,7 @@ body .xterm .xterm-viewport { } } -.cmd-input-info, .xterm-viewport { +.cmd-input-info, .xterm-viewport, .cmd-history { &::-webkit-scrollbar { background-color: #777; width: 5px; @@ -578,6 +578,7 @@ body .xterm .xterm-viewport { max-height: max(300px, 40%); display: flex; flex-direction: column; + position: relative; &.has-info { padding-top: 5px; @@ -613,6 +614,34 @@ body .xterm .xterm-viewport { } } + .cmd-history { + color: @term-white; + margin-bottom: 5px; + overflow-y: auto; + flex-shrink: 1; + + .history-title { + position: absolute; + top: 5px; + left: 20px; + background-color: black; + font-family: 'JetBrains Mono', monospace; + font-weight: 600; + font-size: 14px; + color: #729fcf; + padding-bottom: 4px; + } + + .history-items { + margin-top: 24px; + color: #d3d7cf; + font-size: 12px; + font-family: 'JetBrains Mono', monospace; + white-space: pre; + padding-bottom: 6px; + } + } + .cmd-input-info { flex-shrink: 1; overflow-y: auto;