From 1e240790084a78c3a33d8ecaeddf7bc3ebb85fa1 Mon Sep 17 00:00:00 2001 From: falkoro <39274208+falkoro@users.noreply.github.com> Date: Sat, 6 Jun 2026 10:04:47 +0200 Subject: [PATCH] Reclaim top-bar room: inline tickers, drop redundant pills, gate Safe shot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move the ticker bar into the top bar next to the wordmark (scrolls horizontally) — reclaims its whole separate row. - Remove the always-true "dashboard signed in" pill; show the access pill only when shells are LOCKED (hide the redundant "shells unlocked" via .access-pill.on{display:none}). - Gate the "Safe shot" button behind DASHBOARD_ENABLE_SAFE_SHOT (env_flag, default off) — config.enable_safe_shot conditionally renders the button in pages.rs. Verified live: tickers inline, authState/safeShotBtn absent, refresh + sign-out intact, build green, console clean. Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/prefs.ts | 1 - public/app.css | 8 ++++++++ public/prefs.js | 1 - src/config.rs | 4 ++++ src/pages.rs | 8 +++++++- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/frontend/prefs.ts b/frontend/prefs.ts index 3767053..80adac8 100644 --- a/frontend/prefs.ts +++ b/frontend/prefs.ts @@ -87,7 +87,6 @@ function applyPrefs(): void { Array.from(lineSel.options).forEach((opt) => { opt.textContent = `${opt.value} lines`; }); lineSel.dataset.labeled = '1'; } - q('#authState').textContent = 'dashboard signed in'; q('#shells').classList.toggle('focus-mode', viewMode === 'focus'); applySidebar(); } diff --git a/public/app.css b/public/app.css index 4713875..842a5cc 100644 --- a/public/app.css +++ b/public/app.css @@ -720,3 +720,11 @@ button.rm-temp:hover,button.rm-temp:focus-visible{background:rgba(139,246,255,.1 .session-actions{display:none!important} .terminal-panel .panel-header{margin-bottom:8px} .terminal-panel .panel-header p{display:none} +/* Tickers ride inside the top bar next to the wordmark now (reclaims their own row). The bar + scrolls horizontally so a long ticker list never grows the header's height. */ +.topbar .ticker-strip{flex:1 1 auto;min-width:0;margin:0;align-items:center} +.topbar .ticker-bar{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;min-height:30px;padding:5px 9px} +.topbar .ticker-bar::-webkit-scrollbar{display:none} +.topbar .ticker-strip button{min-height:30px} +/* "shells unlocked" is the redundant happy path — only surface the access pill when LOCKED. */ +.access-pill.on{display:none} diff --git a/public/prefs.js b/public/prefs.js index bc879d9..8558862 100644 --- a/public/prefs.js +++ b/public/prefs.js @@ -85,7 +85,6 @@ function applyPrefs() { Array.from(lineSel.options).forEach((opt) => { opt.textContent = `${opt.value} lines`; }); lineSel.dataset.labeled = '1'; } - q('#authState').textContent = 'dashboard signed in'; q('#shells').classList.toggle('focus-mode', viewMode === 'focus'); applySidebar(); } diff --git a/src/config.rs b/src/config.rs index 370b855..ca36f6b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -60,6 +60,9 @@ pub struct Config { // Gather CPU/RAM/load/temps for remote hosts over SSH (one extra /proc read per poll). // Default on; set DASHBOARD_REMOTE_METRICS=0 to keep remote cards to ping + containers only. pub remote_metrics: bool, + // "Safe shot" generates a shareable, redacted screenshot. Off by default; set + // DASHBOARD_ENABLE_SAFE_SHOT=1 to show the top-bar button. + pub enable_safe_shot: bool, pub allowed_origins: Vec, pub show_unknown_sessions: bool, pub known_sessions: Vec, @@ -206,6 +209,7 @@ impl Config { remote_metrics: env::var("DASHBOARD_REMOTE_METRICS") .map(|v| parse_flag(&v)) .unwrap_or(true), + enable_safe_shot: env_flag("DASHBOARD_ENABLE_SAFE_SHOT"), // Extra browser Origins allowed to open the /api/term WebSocket (beyond same-host). allowed_origins: split_env("DASHBOARD_ALLOWED_ORIGINS"), show_unknown_sessions: env_flag("DASHBOARD_SHOW_UNKNOWN_SESSIONS"), diff --git a/src/pages.rs b/src/pages.rs index 5123201..2557c89 100644 --- a/src/pages.rs +++ b/src/pages.rs @@ -16,11 +16,17 @@ pub fn dashboard(model: &SessionModel, config: &Config) -> String { let data = serde_json::to_string(model) .unwrap_or_else(|_| "{}".to_string()) .replace('<', "\\u003c"); + let safe_shot_btn = if config.enable_safe_shot { + r##""## + } else { + "" + }; let v = asset_ver(config); let html = format!( - r##"ShellDeck

ShellDeck

{}dashboard signed insyncingshells locked
Sign out
No tickers configured
{}
"##, + r##"ShellDeck

ShellDeck

{}syncingshells locked
No tickers configured
{}Sign out
{}
"##, data, html_escape(&model.hostname), + safe_shot_btn, workspace(&links_panel_html(config)) ); bust_assets(&html, &v)