@floless/app 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52609,7 +52609,7 @@ function appVersion() {
52609
52609
  return resolveVersion({
52610
52610
  isSea: isSea2(),
52611
52611
  sqVersionXml: readSqVersionXml(),
52612
- define: true ? "0.13.0" : void 0,
52612
+ define: true ? "0.14.0" : void 0,
52613
52613
  pkgVersion: readPkgVersion()
52614
52614
  });
52615
52615
  }
@@ -52619,7 +52619,7 @@ function resolveChannel(s) {
52619
52619
  return "dev";
52620
52620
  }
52621
52621
  function appChannel() {
52622
- return resolveChannel({ isSea: isSea2(), define: true ? "0.13.0" : void 0 });
52622
+ return resolveChannel({ isSea: isSea2(), define: true ? "0.14.0" : void 0 });
52623
52623
  }
52624
52624
 
52625
52625
  // oauth-presets.ts
package/dist/web/aware.js CHANGED
@@ -1904,7 +1904,7 @@
1904
1904
  openNotesPopover({ component: 'app', version, anchorEl: $appUpdate, onUpdate: applyAppUpdate });
1905
1905
  };
1906
1906
  refreshUpdate();
1907
- setInterval(refreshUpdate, 6 * 60 * 60 * 1000); // re-check every 6h so a long-running window notices
1907
+ setInterval(refreshUpdate, 60 * 60 * 1000); // hourly backstop; the focus re-check (below) is the fast path
1908
1908
  }
1909
1909
 
1910
1910
  // Dev-override helper — the ONLY forced-visible path. Reveals a pill with a fixed
@@ -2002,7 +2002,34 @@
2002
2002
  openNotesPopover({ component: 'aware', version, anchorEl: $awareUpdate, onUpdate: applyAwareUpdate });
2003
2003
  };
2004
2004
  refreshAwareUpdate();
2005
- setInterval(refreshAwareUpdate, 6 * 60 * 60 * 1000); // re-check every 6h
2005
+ setInterval(refreshAwareUpdate, 60 * 60 * 1000); // hourly backstop; the focus re-check (below) is the fast path
2006
+ }
2007
+
2008
+ // Re-check both update pills the instant the tab/window regains focus, so returning
2009
+ // to a long-open tab surfaces a freshly-released version immediately instead of waiting
2010
+ // out the hourly backstop poll above — the gap that used to make users hard-refresh (F5)
2011
+ // to see a new release. Guards: only when the tab is actually visible (never poll for a
2012
+ // backgrounded tab); throttled so rapid focus/blur — or the interval firing alongside —
2013
+ // can't storm the feed; and skipped while a pill is mid-apply (disabled, "Updating…") so
2014
+ // a focus event never stomps an in-flight update. Each refresh is already a no-op when its
2015
+ // pill is absent (dev hides them unless force-flagged), so this is safe to wire whenever
2016
+ // either pill exists.
2017
+ if ($appUpdate || $awareUpdate) {
2018
+ const UPDATE_FOCUS_THROTTLE_MS = 10 * 1000;
2019
+ let lastUpdateCheck = Date.now(); // the on-load checks above just ran — don't immediately re-fire
2020
+ const recheckUpdatesOnFocus = () => {
2021
+ if (document.visibilityState !== 'visible') return;
2022
+ // Offline: a failing fetch lands in refreshUpdate's catch and would briefly hide an
2023
+ // already-shown pill — skip and let the next focus/interval (back online) re-check.
2024
+ if (!navigator.onLine) return;
2025
+ const now = Date.now();
2026
+ if (now - lastUpdateCheck < UPDATE_FOCUS_THROTTLE_MS) return;
2027
+ lastUpdateCheck = now;
2028
+ if ($appUpdate && !$appUpdate.disabled) refreshUpdate();
2029
+ if ($awareUpdate && !$awareUpdate.disabled) refreshAwareUpdate();
2030
+ };
2031
+ document.addEventListener('visibilitychange', recheckUpdatesOnFocus);
2032
+ window.addEventListener('focus', recheckUpdatesOnFocus);
2006
2033
  }
2007
2034
 
2008
2035
  // The AWARE version label, once it's a notes affordance (post in-place upgrade),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {