From b6029220ffb376fc0d8807109c0511a022cf342d Mon Sep 17 00:00:00 2001 From: Hare Date: Mon, 6 Jul 2026 22:51:25 +0900 Subject: [PATCH] fix: refine workspace runtime UI --- crates/worker-runtime/README.md | 33 +++ crates/workspace-server/src/hosts.rs | 18 +- web/workspace/src/app.css | 72 +++++- .../lib/workspace-pages/WorkspacePage.svelte | 40 ++-- .../workspace-settings/SettingsPage.svelte | 222 ++++++++++-------- .../workspace-sidebar/WorkspaceSidebar.svelte | 60 +++-- 6 files changed, 283 insertions(+), 162 deletions(-) create mode 100644 crates/worker-runtime/README.md diff --git a/crates/worker-runtime/README.md b/crates/worker-runtime/README.md new file mode 100644 index 00000000..72d5768a --- /dev/null +++ b/crates/worker-runtime/README.md @@ -0,0 +1,33 @@ +# worker-runtime + +`worker-runtime` owns the Runtime authority surface for Worker management. A Runtime process bundles Worker lifecycle management, the HTTP/WebSocket control API, and the Worker execution backend. + +## Run the local Runtime server + +From the repository root: + +```bash +cargo run -p worker-runtime \ + --features ws-server,fs-store \ + --bin worker-runtime-rest-server \ + -- --workspace . +``` + +By default the server listens on: + +```text +127.0.0.1:38800 +``` + +To bind another address explicitly: + +```bash +cargo run -p worker-runtime \ + --features ws-server,fs-store \ + --bin worker-runtime-rest-server \ + -- --workspace . --bind 127.0.0.1:38800 +``` + +`--workspace` is currently a legacy bootstrap input for the v0 local materializer / Worker profile resolution path. It is not intended to be the long-term Runtime identity or a single-workspace binding. Future Runtime launches should receive Workspace / Repository context through Worker launch requests and config bundles instead. + +The REST server is intended for a trusted Backend/proxy, not direct browser access. diff --git a/crates/workspace-server/src/hosts.rs b/crates/workspace-server/src/hosts.rs index 4107aa59..001cfc2a 100644 --- a/crates/workspace-server/src/hosts.rs +++ b/crates/workspace-server/src/hosts.rs @@ -1885,11 +1885,7 @@ impl WorkspaceWorkerRuntime for RemoteWorkerRuntime { true, response.runtime.worker_creation_available, ), - diagnostics: vec![diagnostic( - "remote_runtime_backend_proxy", - DiagnosticSeverity::Info, - "Remote Runtime is accessed only by backend-owned REST/WS clients".to_string(), - )], + diagnostics: Vec::new(), }, Err(diagnostic) => RuntimeSummary { runtime_id: self.runtime_id.clone(), @@ -1922,11 +1918,7 @@ impl WorkspaceWorkerRuntime for RemoteWorkerRuntime { observed_at: Utc::now().to_rfc3339(), last_seen_at: None, capabilities: remote_runtime_capabilities(limit, true, false), - diagnostics: vec![diagnostic( - "remote_runtime_backend_proxy", - DiagnosticSeverity::Info, - "Remote host endpoint and credentials are backend-private".to_string(), - )], + diagnostics: Vec::new(), }], Vec::new(), ) @@ -2010,11 +2002,7 @@ impl WorkspaceWorkerRuntime for RemoteWorkerRuntime { kind: "remote_runtime_worker_created".to_string(), detail: "worker-runtime REST create endpoint accepted the Worker".to_string(), }], - diagnostics: vec![diagnostic( - "remote_runtime_backend_proxy", - DiagnosticSeverity::Info, - "Remote create used a backend-owned REST client; browser-facing payload exposes only runtime_id plus worker_id".to_string(), - )], + diagnostics: Vec::new(), }, Err(diagnostic) => WorkerSpawnResult { state: WorkerOperationState::Rejected, diff --git a/web/workspace/src/app.css b/web/workspace/src/app.css index f448b453..6c548afb 100644 --- a/web/workspace/src/app.css +++ b/web/workspace/src/app.css @@ -1226,28 +1226,74 @@ background: rgba(255, 255, 255, 0.03); } -.settings-runtime-card { - display: grid; - gap: 0.75rem; +.settings-runtime-table-wrap { + overflow-x: auto; border: 1px solid var(--line); border-radius: 1rem; - padding: 1rem; background: var(--bg-raised); } -.settings-runtime-card header { - display: flex; - justify-content: space-between; - gap: 1rem; - align-items: flex-start; +.settings-runtime-table { + width: 100%; + min-width: 48rem; + border-collapse: collapse; } -.settings-runtime-card.inactive { - opacity: 0.86; +.settings-runtime-table th, +.settings-runtime-table td { + padding: 0.8rem 0.9rem; + border-bottom: 1px solid var(--line); + text-align: left; + vertical-align: top; } -.settings-identity-list.compact { - grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); +.settings-runtime-table th { + color: var(--text-muted); + font-size: 0.72rem; + letter-spacing: 0.05em; + text-transform: uppercase; +} + +.settings-runtime-table tr:last-child td { + border-bottom: 0; +} + +.settings-runtime-table tr.inactive { + opacity: 0.78; +} + +.settings-runtime-table td { + color: var(--text-muted); +} + +.settings-runtime-table td > strong, +.settings-runtime-table td > span, +.settings-runtime-table td > code, +.settings-runtime-table td > small { + display: block; +} + +.settings-runtime-table strong { + color: var(--text-strong); +} + +.settings-runtime-table code { + margin-top: 0.15rem; + overflow-wrap: anywhere; +} + +.settings-runtime-table small { + color: var(--text-muted); +} + +.settings-runtime-detail-row td { + padding-top: 0; + background: rgba(255, 255, 255, 0.025); +} + +.settings-muted-action { + color: var(--text-muted); + font-size: 0.82rem; } .settings-action-row { diff --git a/web/workspace/src/lib/workspace-pages/WorkspacePage.svelte b/web/workspace/src/lib/workspace-pages/WorkspacePage.svelte index e9d99d4d..3933843c 100644 --- a/web/workspace/src/lib/workspace-pages/WorkspacePage.svelte +++ b/web/workspace/src/lib/workspace-pages/WorkspacePage.svelte @@ -1,4 +1,5 @@