Skip to content

Commit 0fb25da

Browse files
authored
Durable Session PR #5 (Icon Flyover, More Bug Fixes, Corner Cases) (#2825)
* Track wave version when job was created (for future backward compat) * New Flyover Menu off of "shell durability" icon. Help + Actions + UX * Bug with conn typeahead not closing when clicking disconnect * Auto-reconnect jobs that have been disconnected (check for "gone" state) * Disable tab indicator stuff (only indicates tab not block) * Fix bug with dev logging path on connserver * Fix bugs with restarting blockcontrollers on startup * Fix bugs with getting HasExited status from job manager * Fix startup files, quoting, tilde, etc in start job flow * ...
1 parent b882e38 commit 0fb25da

File tree

22 files changed

+637
-158
lines changed

22 files changed

+637
-158
lines changed

cmd/wsh/cmd/wshcmd-connserver.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ func serverRun(cmd *cobra.Command, args []string) error {
375375
var logFile *os.File
376376
if connServerDev {
377377
var err error
378-
logFile, err = os.OpenFile("/tmp/connserver.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
378+
logFilePath := fmt.Sprintf("/tmp/waveterm-connserver-%d.log", os.Getuid())
379+
logFile, err = os.OpenFile(logFilePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
379380
if err != nil {
380381
fmt.Fprintf(os.Stderr, "failed to open log file: %v\n", err)
381382
log.SetFlags(log.LstdFlags | log.Lmicroseconds)

docs/docs/config.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ wsh editconfig
6666
| term:shiftenternewline | bool | when enabled, Shift+Enter sends escape sequence + newline (\u001b\n) instead of carriage return, useful for claude code and similar AI coding tools (default false) |
6767
| term:macoptionismeta | bool | on macOS, treat the Option key as Meta key for terminal keybindings (default false) |
6868
| term:bellsound <VersionBadge version="v0.14" /> | bool | when enabled, plays the system beep sound when the terminal bell (BEL character) is received (default false) |
69-
| term:bellindicator <VersionBadge version="v0.14" /> | bool | when enabled, shows a visual indicator in the tab when the terminal bell is received (default true) |
69+
| term:bellindicator <VersionBadge version="v0.14" /> | bool | when enabled, shows a visual indicator in the tab when the terminal bell is received (default false) |
7070
| term:durable <VersionBadge version="v0.14" /> | bool | makes remote terminal sessions durable across network disconnects (defaults to true) |
7171
| editor:minimapenabled | bool | set to false to disable editor minimap |
7272
| editor:stickyscrollenabled | bool | enables monaco editor's stickyScroll feature (pinning headers of current context, e.g. class names, method names, etc.), defaults to false |
@@ -133,7 +133,7 @@ For reference, this is the current default configuration (v0.11.5):
133133
"window:savelastwindow": true,
134134
"telemetry:enabled": true,
135135
"term:bellsound": false,
136-
"term:bellindicator": true,
136+
"term:bellindicator": false,
137137
"term:copyonselect": true,
138138
"term:durable": true,
139139
"waveai:showcloudmodes": true,

frontend/app/block/blockframe-header.tsx

Lines changed: 2 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
renderHeaderElements,
1010
} from "@/app/block/blockutil";
1111
import { ConnectionButton } from "@/app/block/connectionbutton";
12+
import { DurableSessionFlyover } from "@/app/block/durable-session-flyover";
1213
import { ContextMenuModel } from "@/app/store/contextmenu";
1314
import { getConnStatusAtom, recordTEvent, WOS } from "@/app/store/global";
1415
import { globalStore } from "@/app/store/jotaiStore";
@@ -23,52 +24,6 @@ import * as jotai from "jotai";
2324
import * as React from "react";
2425
import { BlockFrameProps } from "./blocktypes";
2526

26-
function getDurableIconProps(jobStatus: BlockJobStatusData, connStatus: ConnStatus, isConfigedDurable?: boolean | null) {
27-
let color = "text-muted";
28-
let titleText = "Durable Session";
29-
let iconType: "fa-solid" | "fa-regular" = "fa-solid";
30-
31-
if (isConfigedDurable === false) {
32-
color = "text-muted";
33-
titleText = "Standard Session";
34-
iconType = "fa-regular";
35-
return { color, titleText, iconType };
36-
}
37-
38-
const status = jobStatus?.status;
39-
if (status === "connected") {
40-
color = "text-sky-500";
41-
titleText = "Durable Session (Attached)";
42-
} else if (status === "disconnected") {
43-
color = "text-sky-300";
44-
titleText = "Durable Session (Detached)";
45-
} else if (status === "init") {
46-
color = "text-sky-300";
47-
titleText = "Durable Session (Starting)";
48-
} else if (status === "done") {
49-
color = "text-muted";
50-
const doneReason = jobStatus?.donereason;
51-
if (doneReason === "terminated") {
52-
titleText = "Durable Session (Ended, Exited)";
53-
} else if (doneReason === "gone") {
54-
titleText = "Durable Session (Ended, Environment Lost)";
55-
} else if (doneReason === "startuperror") {
56-
titleText = "Durable Session (Ended, Failed to Start)";
57-
} else {
58-
titleText = "Durable Session (Ended)";
59-
}
60-
} else if (status == null) {
61-
if (!connStatus?.connected) {
62-
color = "text-muted";
63-
titleText = "Durable Session (Awaiting Connection)";
64-
} else {
65-
color = "text-muted";
66-
titleText = "No Session";
67-
}
68-
}
69-
return { color, titleText, iconType };
70-
}
71-
7227
function handleHeaderContextMenu(
7328
e: React.MouseEvent<HTMLDivElement>,
7429
blockId: string,
@@ -217,7 +172,6 @@ const BlockFrame_Header = ({
217172
let viewIconUnion = util.useAtomValueSafe(viewModel?.viewIcon) ?? blockViewToIcon(blockData?.meta?.view);
218173
const preIconButton = util.useAtomValueSafe(viewModel?.preIconButton);
219174
const useTermHeader = util.useAtomValueSafe(viewModel?.useTermHeader);
220-
const termDurableStatus = util.useAtomValueSafe(viewModel?.termDurableStatus);
221175
const termConfigedDurable = util.useAtomValueSafe(viewModel?.termConfigedDurable);
222176
const hideViewName = util.useAtomValueSafe(viewModel?.hideViewName);
223177
const magnified = jotai.useAtomValue(nodeModel.isMagnified);
@@ -227,8 +181,6 @@ const BlockFrame_Header = ({
227181
const isTerminalBlock = blockData?.meta?.view === "term";
228182
viewName = blockData?.meta?.["frame:title"] ?? viewName;
229183
viewIconUnion = blockData?.meta?.["frame:icon"] ?? viewIconUnion;
230-
const connName = blockData?.meta?.connection;
231-
const connStatus = jotai.useAtomValue(getConnStatusAtom(connName));
232184

233185
React.useEffect(() => {
234186
if (magnified && !preview && !prevMagifiedState.current) {
@@ -240,12 +192,6 @@ const BlockFrame_Header = ({
240192

241193
const viewIconElem = getViewIconElem(viewIconUnion, blockData);
242194

243-
const { color: durableIconColor, titleText: durableTitle, iconType: durableIconType } = getDurableIconProps(
244-
termDurableStatus,
245-
connStatus,
246-
termConfigedDurable
247-
);
248-
249195
return (
250196
<div
251197
className={cn("block-frame-default-header", useTermHeader && "!pl-[2px]")}
@@ -272,9 +218,7 @@ const BlockFrame_Header = ({
272218
/>
273219
)}
274220
{useTermHeader && termConfigedDurable != null && (
275-
<div className="iconbutton disabled text-[13px] ml-[-4px]" key="durable-status">
276-
<i className={`fa-sharp ${durableIconType} fa-shield ${durableIconColor}`} title={durableTitle} />
277-
</div>
221+
<DurableSessionFlyover key="durable-status" blockId={nodeModel.blockId} viewModel={viewModel} placement="bottom" divClassName="iconbutton disabled text-[13px] ml-[-4px]" />
278222
)}
279223
<HeaderTextElems viewModel={viewModel} blockData={blockData} preview={preview} error={error} />
280224
<HeaderEndIcons viewModel={viewModel} nodeModel={nodeModel} blockId={nodeModel.blockId} />

0 commit comments

Comments
 (0)