diff options
| author | Somhairle H. Marisol <[email protected]> | 2026-09-21 21:04:01 +0800 |
|---|---|---|
| committer | Somhairle H. Marisol <[email protected]> | 2026-09-21 21:04:01 +0800 |
| commit | 7c3a0728570f84f5c7d5f396c5a5d5c11f5fb661 (patch) | |
| tree | 71fd4e277f5000f78370d12cae4edbbec75af8a5 | |
| parent | 374afdcd7172402a0be0371964fd6d4040610d5a (diff) | |
| download | somhairles-dream-fsharp-7c3a0728570f84f5c7d5f396c5a5d5c11f5fb661.tar.gz | |
feat(ui): remove masthead connection readout and its dead state plumbing
| -rw-r--r-- | public/App.js | 12 | ||||
| -rw-r--r-- | public/index.html | 9 | ||||
| -rw-r--r-- | public/styles.css | 39 | ||||
| -rw-r--r-- | src/SomhairlesDream.Frontend/App.fs | 9 |
4 files changed, 1 insertions, 68 deletions
diff --git a/public/App.js b/public/App.js index 7aac7f0..a91f298 100644 --- a/public/App.js +++ b/public/App.js @@ -782,10 +782,6 @@ export function updateState(payload) { } } -export function updateStreamState(message) { - setText("stream-state", message); -} - export function startPlaceholderPlayback() { replayIndex(0); setText("replay-button", "暂停占位演示"); @@ -879,10 +875,6 @@ export function connectToServer(selection) { eventSource(source); source.onmessage = ((event) => { updateState(JSON.parse(event.data)); - updateStreamState("实时链路 · SSE 已连接"); - }); - source.onerror = ((_arg) => { - updateStreamState("实时链路 · 等待自动重连"); }); } @@ -1003,7 +995,6 @@ export function startRun(selection) { body: JSON.stringify(requestBody), }; setText("run-message", "正在启动设计运行"); - updateStreamState("实时链路 · 等待服务端确认"); startImmediate(singleton.Delay(() => singleton.TryWith(singleton.Delay(() => singleton.Bind(awaitPromise(fetch("/api/runs/start", requestOptions)), (_arg) => { let arg; const response = _arg; @@ -1011,7 +1002,6 @@ export function startRun(selection) { return singleton.Bind(awaitPromise(response.json()), (_arg_1) => { updateState(_arg_1); connectToServer(selection); - updateStreamState("实时链路 · SSE 已连接"); return singleton.Zero(); }); } @@ -1022,12 +1012,10 @@ export function startRun(selection) { } else { setText("run-message", (arg = (response.status | 0), toText(printf("启动失败 · HTTP %d"))(arg))); - updateStreamState("实时链路 · 启动失败"); return singleton.Zero(); } })), (_arg_2) => { setText("run-message", "启动失败 · 无法连接服务端"); - updateStreamState("实时链路 · 连接失败"); return singleton.Zero(); }))); } diff --git a/public/index.html b/public/index.html index d58853c..b52705c 100644 --- a/public/index.html +++ b/public/index.html @@ -18,13 +18,6 @@ </head> <body> <main class="shell"> - <header class="masthead masthead-compact"> - <div class="connection-readout" aria-live="polite"> - <span class="signal-mark" aria-hidden="true"></span> - <span id="stream-state">实时链路 · 等待启动</span> - </div> - </header> - <section class="mission-strip" aria-label="当前任务"> <div> <span class="eyebrow">PROJECT</span> @@ -147,6 +140,6 @@ <span>heritage 参考线保留占位演示 · F# / OPEN CODE</span> </footer> </main> - <script type="module" src="/App.js?v=ui6"></script> + <script type="module" src="/App.js?v=ui7"></script> </body> </html> diff --git a/public/styles.css b/public/styles.css index bd4e3be..68ca987 100644 --- a/public/styles.css +++ b/public/styles.css @@ -55,7 +55,6 @@ button:focus-visible { padding: 34px 0 24px; } -.masthead, .mission-strip, .panel-heading, .label-row, @@ -67,17 +66,6 @@ button:focus-visible { justify-content: space-between; } -.masthead-compact { - justify-content: flex-end; -} - -.masthead { - gap: 24px; - padding-bottom: 30px; - border-bottom: 1px solid var(--line); -} - -.brand-lockup h1, .panel-heading h2, .timeline-header h2 { margin: 0; @@ -85,18 +73,12 @@ button:focus-visible { letter-spacing: -0.025em; } -.brand-lockup h1 { - font-size: clamp(2rem, 4vw, 3.7rem); - line-height: 1; -} - .panel-heading h2, .timeline-header h2 { font-size: 1.12rem; } .eyebrow, -.connection-readout, .event-count, .mesh-label, .replay-state, @@ -118,16 +100,6 @@ button:focus-visible { letter-spacing: 0.16em; } -.connection-readout { - display: flex; - align-items: center; - gap: 10px; - color: var(--mint); - font-size: 0.72rem; - white-space: nowrap; -} - -.signal-mark, .status-dot { display: inline-block; width: 8px; @@ -696,17 +668,6 @@ button:focus-visible { padding-top: 20px; } - .masthead { - align-items: flex-start; - flex-direction: column; - gap: 18px; - padding-bottom: 22px; - } - - .connection-readout { - font-size: 0.64rem; - } - .mission-strip { grid-template-columns: 1fr 1fr; } diff --git a/src/SomhairlesDream.Frontend/App.fs b/src/SomhairlesDream.Frontend/App.fs index 3665c43..82bae88 100644 --- a/src/SomhairlesDream.Frontend/App.fs +++ b/src/SomhairlesDream.Frontend/App.fs @@ -630,9 +630,6 @@ let updateState (payload: SnapshotPayload) = else showFrameMetadata frame -let updateStreamState message = - setText "stream-state" message - let startPlaceholderPlayback () = replayIndex <- 0 setText "replay-button" "暂停占位演示" @@ -712,9 +709,7 @@ let connectToServer (selection: RunSelection) = source.onmessage <- fun event -> let payload = JS.JSON.parse(event.data) :?> SnapshotPayload updateState payload - updateStreamState "实时链路 · SSE 已连接" - source.onerror <- fun _ -> updateStreamState "实时链路 · 等待自动重连" let inputValue id = (element id :?> HtmlInput).value @@ -833,7 +828,6 @@ let startRun (selection: RunSelection) = "body" ==> JS.JSON.stringify requestBody ] setText "run-message" "正在启动设计运行" - updateStreamState "实时链路 · 等待服务端确认" async { try @@ -844,7 +838,6 @@ let startRun (selection: RunSelection) = let payload = value :?> SnapshotPayload updateState payload connectToServer selection - updateStreamState "实时链路 · SSE 已连接" elif response.status = 409 then // The run id already exists on the server. If it completed // earlier, replay its published history instead of treating @@ -853,10 +846,8 @@ let startRun (selection: RunSelection) = loadHistoryFor selection else setText "run-message" (sprintf "启动失败 · HTTP %d" response.status) - updateStreamState "实时链路 · 启动失败" with _ -> setText "run-message" "启动失败 · 无法连接服务端" - updateStreamState "实时链路 · 连接失败" } |> Async.StartImmediate |
