feat: refresh Human Gates review sessions (Closes #1433)
CI / lint (pull_request) Successful in 3m58s
CI / build-release (pull_request) Successful in 7s
CI / browser-journey (pull_request) Successful in 7m28s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy committed 2026-08-26 13:50:11 +00:00
1 parent 7dc32138e4
commit 2e9d108c6f
17 files changed
+275 -35

No files matched your search

+14 -1
View File
@@ -13,6 +13,7 @@ function createHumanGates(options = {}) {
let loadEpoch = 0;
const decisionKeys = new Map();
let decisionFlight = null;
let openFlight = null;
let onChange = options.onChange;
const escape = value => String(value ?? '').replace(/[&<>"']/g, character => ({
@@ -203,7 +204,19 @@ function createHumanGates(options = {}) {
function open() {
location.hash = '#/my-work/human-gates';
if (nodes.panel) nodes.panel.hidden = false;
return load().then(() => reviewNext());
if (openFlight) return openFlight;
const operation = (async () => {
await load();
reviewSnapshot = queue.items.slice();
reviewIndex = 0;
return reviewNext();
})();
openFlight = operation;
const clearFlight = () => {
if (openFlight === operation) openFlight = null;
};
operation.then(clearFlight, clearFlight);
return operation;
}
return {
+1 -4
View File
@@ -60,10 +60,7 @@ function createProgressiveHumanGates(options = {}) {
async function start(force = false) {
if (!force && location.hash !== '#/my-work/human-gates') return false;
if (started) {
if (nodes.panel) nodes.panel.hidden = false;
return true;
}
if (started) return controller.open().then(() => true);
if (startFlight) return startFlight;
startFlight = (async () => {
const identity = await getIdentity();
+1 -1
View File
@@ -1,7 +1,7 @@
const BASE = new URL('./', self.location.href).pathname;
importScripts(BASE + 'static/private-data-registry.js');
importScripts(BASE + 'static/background-issue-sync.js');
const CACHE = 'stackchain-dashboard-shell-v144';
const CACHE = 'stackchain-dashboard-shell-v145';
const OFFLINE_LEASE_URL = new URL(BASE + '__offline-session-lease', self.location.origin).href;
const OUTAGE_STATUSES = new Set([500, 502, 503, 504]);
const NAVIGATION_TIMEOUT_MS = self.__STACKCHAIN_NAVIGATION_TIMEOUT_MS || 4000;