@@ -537,6 +537,31 @@ const PROFILE_REPORTER: &str = r##"
537537 })();
538538"## ;
539539
540+ /// S16 — busy/streaming reporter (issue #46): watch the WebUI's `S.busy` flag —
541+ /// the same state that drives the web app's in-progress spinner — and report
542+ /// working/idle over the bridge, so the strip can show a per-tab "working"
543+ /// glyph (you can see which background tabs have a run in flight). `S` is a
544+ /// top-level `const` in the WebUI's classic, deferred `ui.js`, reachable as a
545+ /// free variable from this injected script (same page realm where the
546+ /// notification shim patches `window.Notification`). Polled at 700ms + on
547+ /// focus, debounced to emit only on change. The try/catch guards the brief
548+ /// pre-`ui.js` window where `S` is still in its temporal dead zone.
549+ const BUSY_REPORTER : & str = r##"
550+ (function () {
551+ var last = null;
552+ var report = function () {
553+ try {
554+ var b = (typeof S !== 'undefined' && S) ? !!S.busy : false;
555+ if (b !== last) { last = b; EMIT('busy', b); }
556+ } catch (e) {}
557+ };
558+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', report);
559+ else report();
560+ setInterval(report, 700);
561+ window.addEventListener('focus', report);
562+ })();
563+ "## ;
564+
540565/// macOS-only profile reporter (issue #44). macOS uses native tabs with no
541566/// strip, so there's nowhere to hang the Win/Linux color dot — surface the
542567/// active profile in the native tab TITLE instead. Mirrors `PROFILE_REPORTER`
@@ -589,9 +614,10 @@ pub fn init_script(label: &str, pre_paint_hex: &str, is_ssh: bool) -> String {
589614 }
590615 if cfg ! ( not( target_os = "macos" ) ) {
591616 parts. push ( SHORTCUT_FORWARDER ) ;
592- // Profile dot is strip-only (Windows/Linux); macOS native tabs have no
593- // dot , so skip the reporter's polling there (issue #31).
617+ // Profile dot + working glyph are strip-only (Windows/Linux); macOS
618+ // native tabs have no strip , so skip these reporters there (#31, #46 ).
594619 parts. push ( PROFILE_REPORTER ) ;
620+ parts. push ( BUSY_REPORTER ) ;
595621 }
596622 parts. push ( THEME_BRIDGE ) ;
597623 parts. push ( ROUTE_REPORTER ) ;
@@ -662,6 +688,13 @@ pub fn install(app: &AppHandle) {
662688 crate :: strip:: set_tab_dot_profile ( & handle, & label, & name) ;
663689 }
664690 }
691+ // Tab busy/streaming state for the per-tab "working" glyph (#46).
692+ "busy" => {
693+ if crate :: strip:: enabled ( ) && label. starts_with ( "tab-" ) {
694+ let busy = payload[ "value" ] . as_bool ( ) . unwrap_or ( false ) ;
695+ crate :: strip:: set_tab_busy ( & handle, & label, busy) ;
696+ }
697+ }
665698 // Active-profile NAME for the macOS native tab title (issue #44).
666699 // Non-default name → title prefix; empty → no prefix.
667700 "mac-profile" => {
0 commit comments