Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,65 @@
# Changelog

## [v0.6.9] — 2026-07-11
## [v0.7.0] — 2026-07-18

An issue-sweep release: nine tracker items land at once — Wayland layout,
macOS per-tab state indicators, cross-tab notification dedupe, stale-spinner
and restored-session fixes, refresh-all, and quality-of-life items.

### Added

- **macOS: native tabs now show per-tab state** — "●" prefixed to the tab
title when a session is waiting on you (approval/clarify), "⟳" while it's
working (issues #64/#65). The signals existed (the page reports both) but
macOS discarded them; they now adorn the native tab title the same way the
profile-name prefix does, so a backgrounded tab's state is visible at a
glance. Attention outranks working when both apply.
- **Refresh All Tabs** (issue #76): one action — in the ⋮ menu, the macOS
View menu, or Ctrl/Cmd+Shift+R — reloads every tab in every window, so a
WebUI update no longer means clicking the "must hard refresh" banner in
each tab individually.
- **Click-to-copy version** (issue #75): the version row in the ⋮ menu (and
a new "Copy Version" item in the macOS app menu) copies a paste-ready
identifier for bug reports, confirmed with a notification.
- **Linux safe-render escape hatch** (issue #78): launching with
`HERMES_DESKTOP_SAFE_RENDER=1` disables WebKitGTK's DMABUF renderer and
compositing mode before any webview initializes — the recovery path for
GPU/driver combos where EGL fails and the window comes up blank (e.g.
"Could not create default EGL display: EGL_BAD_PARAMETER" on Fedora).
Explicitly-set `WEBKIT_*` variables always win.

### Fixed

- **Wayland: huge empty space above the WebUI** (issue #80). The v0.6.8 fix
for the X11 gap (#67) passes physical child-webview coordinates to defeat
wry's bogus X11 DPI derivation — but it applied on ALL Linux, and on native
Wayland (where wry's scale is sane) it over-corrects into a top gap. The
compensation now applies only when GDK actually runs its X11 backend
(including XWayland, which needs it); native Wayland gets plain logical
coordinates.
- **Duplicate notifications across tabs, and notification floods** (issues
#51/#81). Every tab observes the same server events, so N open tabs meant
N identical OS notifications — and a page re-firing for a still-pending
approval could pile up notifications indefinitely (reported on Linux/
Wayland as "approval kept appearing until the app crashed"). All tabs
funnel through one native handler, which now suppresses identical
notifications within a 30-second window: many tabs produce one
notification, and a persistent repeater surfaces at most once per window
as a gentle reminder instead of a flood.
- **Tab "working" spinner no longer goes stale on background tabs** (issue
#74). Hidden webviews throttle their timers, so the in-page busy reporter
could go quiet and leave a finished session spinning until you clicked the
tab. The shell now re-polls every tab's busy state on its own 4-second
loop — an eval runs regardless of timer throttling — so the spinner clears
within seconds of the session finishing, focused or not.
- **Restored session tabs showing "Session not available in web UI." at
launch** (issue #37, third and hopefully final round). The v0.6.1 retry
only caught the variant where the WebUI bounces the tab back to the root
URL; the reported symptom shows the message in place at the deep URL. The
shell now also probes the restored tab's page once (~5s after creation)
and reloads it in place if the marker is present — the programmatic
equivalent of the switch-away-and-back that always fixed it. Healthy tabs
match nothing and pay nothing.

### Fixed

Expand Down
131 changes: 120 additions & 11 deletions src-tauri/src/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ const SHORTCUT_FORWARDER: &str = r##"
var send = function (v) { e.preventDefault(); e.stopPropagation(); EMIT('shortcut', v); };
if (k === 'tab') { send(e.shiftKey ? 'prev-tab' : 'next-tab'); return; }
if (k === 'b' && e.shiftKey) { send('toggle-bar'); return; }
if (k === 'r' && e.shiftKey) { send('reload-all'); return; }
if (e.shiftKey) return;
if (k === 't') send('new-tab');
else if (k === 'n') send('new-window');
Expand Down Expand Up @@ -559,6 +560,12 @@ const BUSY_REPORTER: &str = r##"
else report();
setInterval(report, 700);
window.addEventListener('focus', report);
// Native re-poll hook (issue #74): hidden webviews throttle/suspend timers,
// so a session finishing in a background tab may never tick the interval —
// the spinner goes stale until focus. The shell evals this on its own 4s
// loop; an eval executes even when timers are throttled, and it re-reads
// the live S.busy at that moment.
window.__hermesReportBusy = report;
})();
"##;

Expand Down Expand Up @@ -614,11 +621,13 @@ pub fn init_script(label: &str, pre_paint_hex: &str, is_ssh: bool) -> String {
}
if cfg!(not(target_os = "macos")) {
parts.push(SHORTCUT_FORWARDER);
// Profile dot + working glyph are strip-only (Windows/Linux); macOS
// native tabs have no strip, so skip these reporters there (#31, #46).
// Profile dot is strip-only (Windows/Linux); macOS gets its profile
// indicator from MACOS_PROFILE_REPORTER above (#31, #44).
parts.push(PROFILE_REPORTER);
parts.push(BUSY_REPORTER);
}
// Busy state feeds the strip spinner on Win/Linux (#46) AND the native
// tab-title "⟳" adornment on macOS (#65) — inject everywhere.
parts.push(BUSY_REPORTER);
parts.push(THEME_BRIDGE);
parts.push(ROUTE_REPORTER);
parts.push(WINDOW_OPEN);
Expand Down Expand Up @@ -688,11 +697,15 @@ pub fn install(app: &AppHandle) {
crate::strip::set_tab_dot_profile(&handle, &label, &name);
}
}
// Tab busy/streaming state for the per-tab "working" glyph (#46).
// Tab busy/streaming state: the per-tab "working" glyph on the
// Win/Linux strip (#46), and the "⟳" native-title adornment on
// macOS content windows (#65).
"busy" => {
let busy = payload["value"].as_bool().unwrap_or(false);
if crate::strip::enabled() && label.starts_with("tab-") {
let busy = payload["value"].as_bool().unwrap_or(false);
crate::strip::set_tab_busy(&handle, &label, busy);
} else if cfg!(target_os = "macos") && label.starts_with("main-") {
windows::set_window_indicator(&handle, &label, Some(busy), None);
}
}
// Active-profile NAME for the macOS native tab title (issue #44).
Expand All @@ -709,12 +722,23 @@ pub fn install(app: &AppHandle) {
let body = payload["value"]["body"]
.as_str()
.unwrap_or("Your response is ready");
let _ = handle
.notification()
.builder()
.title(title)
.body(body)
.show();
// Cross-tab dedupe (issues #51/#81): every tab carries the
// notification shim independently, so N tabs observing the
// same server event (approval pending, response ready) each
// emit the same notify — and a re-firing page can loop.
// This is the single choke point all tabs funnel through;
// suppress identical title+body within a fixed window. A
// still-pending approval re-notifies at most once per
// window (gentle reminder) instead of flooding (#81), and
// app re-open with many tabs shows ONE notification (#51).
if notify_fresh(title, body) {
let _ = handle
.notification()
.builder()
.title(title)
.body(body)
.show();
}
}
}
"open-external" => {
Expand Down Expand Up @@ -778,6 +802,11 @@ pub fn install(app: &AppHandle) {
}
"next-tab" => crate::strip::cycle_tab(&handle, &label, true),
"prev-tab" => crate::strip::cycle_tab(&handle, &label, false),
// Reload every tab in every window (issue #76): one
// action to clear the per-tab "must hard refresh"
// banners after a WebUI update (also the ⋮/View menu
// "Refresh All Tabs").
"reload-all" => windows::eval_all_content(&handle, "location.reload();"),
"toggle-bar" => {
if crate::strip::enabled() && label.starts_with("tab-") {
let app = handle.clone();
Expand Down Expand Up @@ -893,3 +922,83 @@ fn handle_theme_report(app: &AppHandle, css: &str) {
let state = app.state::<AppState>();
let _ = state; // theme cache persisted above; nothing else to track
}

/// Cross-tab notification dedupe (issues #51/#81). Every tab carries the
/// notification shim independently, so N tabs observing the same server-side
/// event each emit an identical notify — and a page that re-fires for a
/// still-pending approval can loop. All tabs funnel through the single
/// `"notify"` bridge arm, so one fixed-window cache there collapses both.
/// FIXED window (timestamps aren't refreshed on suppressed hits): a pending
/// approval still re-notifies once per window as a gentle reminder, instead
/// of never again — and instead of a flood.
fn notify_fresh(title: &str, body: &str) -> bool {
use std::collections::HashMap;
use std::sync::{Mutex, OnceLock};
use std::time::Instant;
static SEEN: OnceLock<Mutex<HashMap<String, Instant>>> = OnceLock::new();
let mut seen = SEEN
.get_or_init(|| Mutex::new(HashMap::new()))
.lock()
.unwrap();
dedupe_decide(&mut seen, format!("{title}\u{1}{body}"), Instant::now())
}

/// Pure decision for [`notify_fresh`]: prune expired entries, then show only
/// if the key isn't present. Insert-on-show only — suppressed repeats do NOT
/// slide the window, so a persistent repeater surfaces once per WINDOW.
const NOTIFY_DEDUPE_WINDOW: std::time::Duration = std::time::Duration::from_secs(30);
fn dedupe_decide(
seen: &mut std::collections::HashMap<String, std::time::Instant>,
key: String,
now: std::time::Instant,
) -> bool {
seen.retain(|_, t| now.duration_since(*t) < NOTIFY_DEDUPE_WINDOW);
if seen.contains_key(&key) {
return false;
}
seen.insert(key, now);
true
}

#[cfg(test)]
mod tests {
use super::{dedupe_decide, NOTIFY_DEDUPE_WINDOW};
use std::collections::HashMap;
use std::time::{Duration, Instant};

#[test]
fn duplicate_notifications_suppressed_within_window() {
let mut seen = HashMap::new();
let t0 = Instant::now();
assert!(dedupe_decide(&mut seen, "a\u{1}b".into(), t0));
// Same title+body from another tab moments later (#51) → suppressed.
assert!(!dedupe_decide(
&mut seen,
"a\u{1}b".into(),
t0 + Duration::from_secs(2)
));
// A flood of identical re-fires (#81) stays suppressed inside the window…
assert!(!dedupe_decide(
&mut seen,
"a\u{1}b".into(),
t0 + Duration::from_secs(15)
));
// …but a still-pending approval re-notifies once the window lapses
// (fixed window: the suppressed hits above must not have slid it).
assert!(dedupe_decide(
&mut seen,
"a\u{1}b".into(),
t0 + NOTIFY_DEDUPE_WINDOW + Duration::from_secs(1)
));
}

#[test]
fn distinct_notifications_pass_through() {
let mut seen = HashMap::new();
let t0 = Instant::now();
assert!(dedupe_decide(&mut seen, "a\u{1}b".into(), t0));
// Different body (another session finishing) is NOT collapsed.
assert!(dedupe_decide(&mut seen, "a\u{1}c".into(), t0));
assert!(dedupe_decide(&mut seen, "x\u{1}b".into(), t0));
}
}
49 changes: 49 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,24 @@ fn main() {
unsafe { (xlib.XInitThreads)() };
}

// Linux safe-render escape hatch (issue #78): on some GPU/driver combos
// (NVIDIA proprietary, some VMs, Fedora+EGL mismatches) WebKitGTK's DMABUF
// renderer fails hard — "Could not create default EGL display:
// EGL_BAD_PARAMETER" and a blank window, app unusable. Setting
// HERMES_DESKTOP_SAFE_RENDER=1 flips WebKitGTK to its safe paths BEFORE
// any webview initializes. Explicit user-set WEBKIT_* values always win.
#[cfg(target_os = "linux")]
if std::env::var("HERMES_DESKTOP_SAFE_RENDER").is_ok_and(|v| v == "1") {
for (k, v) in [
("WEBKIT_DISABLE_DMABUF_RENDERER", "1"),
("WEBKIT_DISABLE_COMPOSITING_MODE", "1"),
] {
if std::env::var(k).is_err() {
std::env::set_var(k, v);
}
}
}

tauri::Builder::default()
.plugin(tauri_plugin_single_instance::init(|app, _argv, _cwd| {
// Second launch (e.g. double-opening the .app/.exe): focus the
Expand Down Expand Up @@ -406,6 +424,16 @@ fn main() {
if strip::enabled() {
strip::recapture_profiles(&sess_handle);
}
// Busy re-poll (issue #74): hidden webviews throttle their
// timers, so BUSY_REPORTER's 700ms interval can go quiet in
// a background tab and leave the spinner stale after the
// session finishes. An eval executes regardless of timer
// throttling and re-reads the live S.busy; the reporter's
// debounce means this emits only on an actual change.
windows::eval_all_content(
&sess_handle,
"window.__hermesReportBusy && window.__hermesReportBusy();",
);
});
}
// Chrome poller — the Tauri stand-in for the Swift app's
Expand Down Expand Up @@ -440,6 +468,27 @@ fn main() {
"new_tab" => conn::open_new_session(app, true),
"paste" => paste::paste_into_focused(app),
"reload" => windows::active_content_eval(app, "location.reload();"),
// Reload EVERY tab in every window (issue #76): one action to
// clear the per-tab "must hard refresh" banners after a WebUI
// update, instead of clicking through each tab.
"reload_all" => windows::eval_all_content(app, "location.reload();"),
// Click-to-copy the version from the ⋮/app menu (issue #75) —
// exact paste-ready string for bug reports, confirmed by a
// notification (it's a direct user action, so always confirm).
"copy_version" => {
let v = format!(
"Hermes WebUI Desktop v{} ({})",
app.package_info().version,
std::env::consts::OS
);
let copied = arboard::Clipboard::new()
.and_then(|mut c| c.set_text(v.clone()))
.is_ok();
if copied {
use tauri_plugin_notification::NotificationExt;
let _ = app.notification().builder().title("Copied").body(v).show();
}
}
"quit" => app.exit(0),
"check_updates" => updater::spawn_check(app, true),
"reveal_logs" => {
Expand Down
28 changes: 23 additions & 5 deletions src-tauri/src/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ pub fn build(app: &AppHandle) -> tauri::Result<Menu<tauri::Wry>> {
.separator()
.item(&MenuItemBuilder::with_id("check_updates", "Check for Updates…").build(app)?)
.item(&MenuItemBuilder::with_id("whats_new", "What's New").build(app)?)
.item(
// Paste-ready version string for bug reports (issue #75).
&MenuItemBuilder::with_id("copy_version", "Copy Version").build(app)?,
)
.item(&MenuItemBuilder::with_id("reveal_logs", "Reveal Log File").build(app)?)
.separator()
.item(
Expand Down Expand Up @@ -77,6 +81,12 @@ pub fn build(app: &AppHandle) -> tauri::Result<Menu<tauri::Wry>> {
.accelerator("CmdOrCtrl+R")
.build(app)?,
)
.item(
// Reload every tab in every window (issue #76).
&MenuItemBuilder::with_id("reload_all", "Refresh All Tabs")
.accelerator("CmdOrCtrl+Shift+R")
.build(app)?,
)
.separator()
.item(
&MenuItemBuilder::with_id("zoom_in", "Zoom In")
Expand Down Expand Up @@ -156,6 +166,12 @@ pub fn build_strip_menu(app: &AppHandle) -> tauri::Result<Menu<tauri::Wry>> {
items.push(Box::new(PredefinedMenuItem::separator(app)?));
items.push(Box::new(item("reload", "Reload\tCtrl+R")?));
items.push(Box::new(item("find", "Find in Page…\tCtrl+F")?));
// One action to reload every tab in every window (issue #76) — clears the
// per-tab "must hard refresh" banners after a WebUI update.
items.push(Box::new(item(
"reload_all",
"Refresh All Tabs\tCtrl+Shift+R",
)?));
items.push(Box::new(PredefinedMenuItem::separator(app)?));
items.push(Box::new(item("zoom_in", "Zoom In\tCtrl+=")?));
items.push(Box::new(item("zoom_out", "Zoom Out\tCtrl+-")?));
Expand All @@ -164,11 +180,13 @@ pub fn build_strip_menu(app: &AppHandle) -> tauri::Result<Menu<tauri::Wry>> {
items.push(Box::new(item("preferences", "Preferences…\tCtrl+,")?));
items.push(Box::new(item("open_browser", "Open in Browser")?));
items.push(Box::new(PredefinedMenuItem::separator(app)?));
items.push(Box::new(
MenuItemBuilder::with_id("about_version", format!("Hermes WebUI Desktop v{version}"))
.enabled(false)
.build(app)?,
));
// Click-to-copy (issue #75): the version row is a live item — clicking it
// copies a paste-ready identifier for bug reports (confirmed by a
// notification via the copy_version handler).
items.push(Box::new(item(
"copy_version",
&format!("Hermes WebUI Desktop v{version} — click to copy"),
)?));
items.push(Box::new(item("whats_new", "What's New")?));
items.push(Box::new(item("check_updates", "Check for Updates…")?));
items.push(Box::new(item("reveal_logs", "Reveal Log File")?));
Expand Down
8 changes: 8 additions & 0 deletions src-tauri/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ pub struct AppState {
/// prefix. Display-only; the cookie-value `window_profiles` above remains
/// the source for restore re-seeding.
pub window_profile_names: Mutex<HashMap<String, String>>,
/// macOS only: content-window label -> (busy, attention) for the native
/// tab-title adornment (issues #64/#65) — "●" when the session waits on
/// you, "⟳" while it works. Win/Linux keep these per-TabEntry (the strip
/// dot and spinner) instead. busy arrives via BUSY_REPORTER bridge events
/// (now injected on macOS too); attention via the leading ● marker on the
/// reported document.title, which the mac branch previously discarded.
pub window_indicators: Mutex<HashMap<String, (bool, bool)>>,
/// macOS only: set once per launch after the first connect to fire the
/// one-time "tabs exist" discoverability hint at most once per run (issue
/// #42); the persisted `tabsHintShown` pref is the across-launch gate.
Expand Down Expand Up @@ -166,6 +173,7 @@ impl AppState {
strip: Mutex::new(HashMap::new()),
window_profiles: Mutex::new(HashMap::new()),
window_profile_names: Mutex::new(HashMap::new()),
window_indicators: Mutex::new(HashMap::new()),
tabs_hinted: AtomicBool::new(false),
navigated: Mutex::new(HashSet::new()),
session_restored: AtomicBool::new(false),
Expand Down
Loading
Loading