create-heresay 0.2.32 → 0.2.34

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-heresay",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
4
4
  "description": "Set up your own Heresay: in-app feedback that every report gets a hearing. Creates a Firebase project in your Google account and deploys the dashboard, API and SDK to it.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/release/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.32
1
+ 0.2.34
@@ -1,3 +1,3 @@
1
1
  /** The Heresay release. Bumped by the release script; the CLI and /v1/health report it. */
2
- export const VERSION = '0.2.32';
2
+ export const VERSION = '0.2.34';
3
3
  //# sourceMappingURL=version.js.map
@@ -9,6 +9,7 @@
9
9
  <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
10
10
  <link href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Figtree:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
11
11
  <link rel="stylesheet" href="/dashboard.css">
12
+ <link rel="stylesheet" href="/workspace.css">
12
13
  </head>
13
14
  <body class="booting pending">
14
15
 
@@ -39,20 +40,32 @@
39
40
  </div>
40
41
 
41
42
  <div id="app" hidden>
42
- <header class="top">
43
- <a href="#/" aria-label="Your apps"><img src="/logo.svg" alt="Heresay" height="28" style="display:block"></a>
43
+ <a class="skip-link" href="#view">Skip to content</a>
44
+ <aside class="sidebar" aria-label="Workspace navigation">
45
+ <button id="nav-close" class="btn ghost nav-close" type="button" aria-label="Close navigation">×</button>
46
+ <a class="brand" href="#/inbox" aria-label="Heresay inbox"><img src="/logo.svg" alt="Heresay" height="30"></a>
47
+ <div class="workspace-label"><span class="workspace-icon" aria-hidden="true">H</span><span>Your workspace</span><span class="workspace-role" id="workspace-role"></span></div>
44
48
  <nav class="tabs" aria-label="Main">
45
- <a href="#/" data-nav="apps">Apps</a>
46
- <a href="#/team" data-nav="team">Team</a>
47
- <a href="#/notifications" data-nav="notifications">Notifications</a>
48
- <a href="#/chat" data-nav="chat">Chat apps</a>
49
+ <a href="#/inbox" data-nav="inbox"><span class="nav-icon" data-icon="inbox"></span>Inbox<span id="inbox-count" class="nav-count" hidden></span></a>
50
+ <a href="#/apps" data-nav="apps"><span class="nav-icon" data-icon="apps"></span>Apps</a>
51
+ <a href="#/connect" data-nav="connect"><span class="nav-icon" data-icon="repos"></span>Connected repos</a>
52
+ <a href="#/chat" data-nav="chat"><span class="nav-icon" data-icon="chat"></span>Chat apps</a>
49
53
  </nav>
50
- <span class="spacer"></span>
51
- <span id="who" class="who"></span>
52
- <button id="signout" class="btn ghost">Sign out</button>
53
- </header>
54
+ <div class="nav-section">Workspace</div>
55
+ <nav class="tabs" aria-label="Workspace settings">
56
+ <a href="#/team" data-nav="team"><span class="nav-icon" data-icon="team"></span>Team</a>
57
+ <a href="#/notifications" data-nav="notifications"><span class="nav-icon" data-icon="bell"></span>Notifications</a>
58
+ </nav>
59
+ <div class="sidebar-bottom">
60
+ <a class="help-link" href="/docs.html" target="_blank" rel="noopener"><span class="nav-icon" data-icon="help"></span>Help &amp; docs<span aria-hidden="true">↗</span></a>
61
+ <div class="account"><span id="account-avatar" class="avatar" aria-hidden="true">H</span><span id="who" class="who"></span></div>
62
+ <button id="signout" class="btn ghost signout">Sign out</button>
63
+ </div>
64
+ </aside>
65
+ <button id="nav-scrim" class="nav-scrim" type="button" aria-label="Close navigation" tabindex="-1"></button>
66
+ <header class="workspace-top"><button id="nav-toggle" class="btn ghost" aria-label="Open navigation" aria-expanded="false" type="button">☰</button><span class="breadcrumb">Workspace <span aria-hidden="true">/</span> <span id="page-label">Apps</span></span><span class="top-caption">Every report gets a hearing.</span></header>
54
67
  <div id="update" class="update" role="status" hidden></div>
55
- <main id="view"></main>
68
+ <main id="view" tabindex="-1"></main>
56
69
  </div>
57
70
 
58
71
  <script src="/__/firebase/10.14.1/firebase-app-compat.js"></script>
@@ -41,6 +41,45 @@
41
41
  return n;
42
42
  }
43
43
 
44
+ // Reuse the dashboard's outline icon language throughout the workspace chrome.
45
+ var NAV_ICONS = {
46
+ inbox: '<path d="M4 4h16l2 12v4H2v-4zM2 14h6l2 3h4l2-3h6"/>',
47
+ apps: '<rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/>',
48
+ repos: '<circle cx="6" cy="5" r="2"/><circle cx="6" cy="19" r="2"/><circle cx="18" cy="5" r="2"/><path d="M6 7v10M18 7v2a4 4 0 0 1-4 4h-4a4 4 0 0 0-4 4"/>',
49
+ chat: '<path d="M21 11a9 9 0 0 1-9 9H4l-2 2V11a9 9 0 0 1 19 0z"/>',
50
+ team: '<circle cx="9" cy="8" r="3"/><path d="M2 21v-3a7 7 0 0 1 14 0v3M16 5a3 3 0 0 1 0 6M22 21v-3a7 7 0 0 0-4-6"/>',
51
+ bell: '<path d="M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4"/>',
52
+ help: '<circle cx="12" cy="12" r="9"/><path d="M9 9a3 3 0 0 1 6 0c0 2-3 2-3 5M12 17h.01"/>'
53
+ };
54
+ document.querySelectorAll('[data-icon]').forEach(function (n) {
55
+ n.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true">' + NAV_ICONS[n.dataset.icon] + '</svg>';
56
+ });
57
+ function setNavigation(open, restoreFocus) {
58
+ $('app').classList.toggle('nav-open', open);
59
+ $('nav-toggle').setAttribute('aria-expanded', String(open));
60
+ $('nav-toggle').setAttribute('aria-label', open ? 'Close navigation' : 'Open navigation');
61
+ $('view').inert = open;
62
+ document.querySelector('.sidebar').inert = window.innerWidth <= 640 && !open;
63
+ if (open) $('nav-close').focus();
64
+ else if (restoreFocus) $('nav-toggle').focus();
65
+ }
66
+ $('nav-toggle').onclick = function () { setNavigation(!$('app').classList.contains('nav-open'), true); };
67
+ $('nav-close').onclick = $('nav-scrim').onclick = function () { setNavigation(false, true); };
68
+ document.addEventListener('keydown', function (e) {
69
+ if (e.key === 'Escape' && $('app').classList.contains('nav-open')) setNavigation(false, true);
70
+ if (e.key === 'Tab' && $('app').classList.contains('nav-open')) {
71
+ var nodes = document.querySelector('.sidebar').querySelectorAll('a, button');
72
+ var first = nodes[0], last = nodes[nodes.length - 1];
73
+ if (e.shiftKey && document.activeElement === first) { e.preventDefault(); last.focus(); }
74
+ else if (!e.shiftKey && document.activeElement === last) { e.preventDefault(); first.focus(); }
75
+ }
76
+ if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'k' && $('report-search')) {
77
+ e.preventDefault(); $('view').classList.remove('detail-open'); $('report-search').focus();
78
+ }
79
+ });
80
+ window.addEventListener('resize', function () { setNavigation(window.innerWidth <= 640 && $('app').classList.contains('nav-open'), false); });
81
+ document.querySelector('.skip-link').onclick = function (e) { e.preventDefault(); $('view').focus(); };
82
+
44
83
  function show(which) {
45
84
  ['gate', 'blocked', 'app'].forEach(function (id) { $(id).hidden = id !== which; });
46
85
  syncLoader();
@@ -88,14 +127,15 @@
88
127
 
89
128
  /** One message at a time, bottom of the screen, with an optional action. Read out by screen readers. */
90
129
  var toastBox = null, toastTimer = null;
91
- function toast(text, action) {
130
+ /** `failed`: something didn't work, so no tick. */
131
+ function toast(text, action, failed) {
92
132
  if (!toastBox) {
93
133
  toastBox = el('div', { class: 'toast', role: 'status', 'aria-live': 'polite' });
94
134
  document.body.appendChild(toastBox);
95
135
  }
96
136
  clearTimeout(toastTimer);
97
137
  toastBox.textContent = '';
98
- toastBox.appendChild(el('span', { class: 'toast-tick', 'aria-hidden': 'true' }));
138
+ if (!failed) toastBox.appendChild(el('span', { class: 'toast-tick', 'aria-hidden': 'true' }));
99
139
  toastBox.appendChild(el('span', { text: text }));
100
140
  if (action) toastBox.appendChild(el('button', { type: 'button', text: action.label, onclick: function () { hideToast(); action.run(); } }));
101
141
  toastBox.classList.add('on');
@@ -180,6 +220,9 @@
180
220
  api('GET', '/me').then(function (b) {
181
221
  me = b;
182
222
  $('who').textContent = b.email;
223
+ $('who').title = b.email;
224
+ $('account-avatar').textContent = b.email.slice(0, 2).toUpperCase();
225
+ $('workspace-role').textContent = b.role === 'owner' ? 'Owner' : 'Member';
183
226
  try {
184
227
  var after = JSON.parse(localStorage.getItem('heresay.after') || 'null');
185
228
  localStorage.removeItem('heresay.after');
@@ -254,14 +297,19 @@
254
297
  var hash = location.hash.replace(/^#\/?/, '');
255
298
  var query = new URLSearchParams(hash.split('?')[1] || '');
256
299
  var parts = hash.split('?')[0].split('/').filter(Boolean);
300
+ var active = ['team', 'notifications', 'chat', 'connect', 'inbox'].indexOf(parts[0]) >= 0 ? parts[0] : 'apps';
301
+ if (!parts.length || (parts[0] === 'apps' && parts[1] && !parts[2])) active = 'inbox';
257
302
  document.querySelectorAll('[data-nav]').forEach(function (a) {
258
- var active = parts[0] === 'team' || parts[0] === 'notifications' || parts[0] === 'chat' ? parts[0] : 'apps';
259
- a.setAttribute('aria-current', String(active === a.dataset.nav));
303
+ if (active === a.dataset.nav) a.setAttribute('aria-current', 'page');
304
+ else a.removeAttribute('aria-current');
260
305
  });
306
+ $('page-label').textContent = { inbox: 'Inbox', apps: 'Apps', connect: 'Connected repos', chat: 'Chat apps', team: 'Team', notifications: 'Notifications' }[active];
307
+ setNavigation(false, false);
261
308
  var view = $('view');
262
309
  view.textContent = '';
263
310
  view.appendChild(loading());
264
- view.classList.remove('wide');
311
+ view.classList.remove('wide', 'inbox-view', 'detail-open');
312
+ if (!parts.length || parts[0] === 'inbox') return reportsView(view, null);
265
313
  if (parts[0] === 'team') return teamView(view);
266
314
  if (parts[0] === 'notifications') return notificationsView(view);
267
315
  if (parts[0] === 'connect') return connectView(view, query);
@@ -283,7 +331,7 @@
283
331
  var hit = projects.filter(function (p) { return p.id === id; })[0];
284
332
  if (hit) return fn(hit);
285
333
  api('GET', '/projects/' + id).then(function (b) { fn(b.project); })
286
- .catch(function () { location.hash = '#/'; });
334
+ .catch(function () { location.hash = '#/apps'; });
287
335
  }
288
336
 
289
337
  // ---- apps ------------------------------------------------------------------------------
@@ -400,7 +448,7 @@
400
448
  return api('GET', '/projects').then(function (b) {
401
449
  projects = b.projects;
402
450
  var first = projects.filter(function (x) { return productOf(x) === productId; })[0];
403
- if (!first) { location.hash = '#/'; return; }
451
+ if (!first) { location.hash = '#/apps'; return; }
404
452
  drawNewApp(view, platform, null, first);
405
453
  });
406
454
  }
@@ -1203,7 +1251,7 @@
1203
1251
  rs.slice(0, 5).forEach(function (r) {
1204
1252
  feed.appendChild(el('li', { class: !first && !known[r.id] ? 'fresh' : '' }, [
1205
1253
  el('span', { class: 'pill ' + r.type, text: TYPE_LABEL[r.type] }),
1206
- showPlatform ? el('span', { class: 'pill platform-pill', text: platformOf(p.platform).label }) : null,
1254
+ el('span', { class: 'pill platform-pill', text: platformOf(p.platform).label }),
1207
1255
  el('span', { class: 'feed-text', text: r.text }),
1208
1256
  el('span', { class: 'mute small', text: [r.context.route, r.context.platform, new Date(r.created_at).toLocaleTimeString()].filter(Boolean).join(' · ') }),
1209
1257
  ]));
@@ -1262,167 +1310,195 @@
1262
1310
  * from. Install, delete and repos stay per platform, because keys and code differ.
1263
1311
  */
1264
1312
  function reportsView(view, p) {
1265
- var reports = [];
1266
- var sibs = [p];
1267
- var where = 'all';
1268
- var filters = el('nav', { class: 'filters', 'aria-label': 'Filter' });
1269
- var platformBar = el('nav', { class: 'filters platforms-filter', 'aria-label': 'Platform' });
1270
- var list = el('div', { class: 'reports' }, [loading()]);
1271
- var empty = el('p', { class: 'empty' });
1272
- var ctxs = {};
1273
- var head = el('div', { class: 'head' });
1274
- var platformsBox = el('div', { class: 'product-platforms' });
1275
- view.appendChild(el('a', { class: 'back', href: '#/', text: '← All apps' }));
1276
- view.appendChild(head);
1277
- view.appendChild(platformsBox);
1278
- view.appendChild(platformBar);
1279
- view.appendChild(filters);
1280
- view.appendChild(list);
1281
- view.appendChild(empty);
1282
-
1283
- function drawHead() {
1284
- head.textContent = '';
1285
- var many = sibs.length > 1;
1286
- head.appendChild(el('div', { class: 'title' }, [
1287
- many ? el('span', { class: 'picon', html: '<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="8" height="8" rx="2"/><rect x="13" y="3" width="8" height="8" rx="2"/><rect x="3" y="13" width="8" height="8" rx="2"/><path d="M17 13v8M13 17h8"/></svg>' }) : icon(platformOf(p.platform)),
1288
- el('div', {}, [el('h1', { text: productName(p) }),
1289
- el('span', { class: 'mute small', text: many ? sibs.map(function (x) { return platformOf(x.platform).label; }).join(' · ')
1290
- : (p.framework ? frameworkLabel(p.framework) + (p.framework_detected ? ' (detected)' : '') : platformOf(p.platform).label) })])]));
1291
- head.appendChild(el('div', { class: 'row tight' }, [
1292
- el('a', { class: 'btn ghost', href: '#/new?product=' + productOf(p), text: '+ Add a platform' }),
1293
- many || !designable(p) ? null : el('a', { class: 'btn ghost', href: '#/apps/' + p.id + '/design', text: 'Design' }),
1294
- many ? null : el('a', { class: 'btn', href: '#/apps/' + p.id + '/setup', text: 'Install' }),
1295
- many ? null : el('a', { class: 'btn ghost', href: '#/apps/' + p.id + '/delete', text: 'Delete…' }),
1296
- ]));
1297
- }
1298
-
1299
- /** Per platform: where agents fix it, and its own Install and Delete. */
1300
- function drawPlatforms() {
1301
- platformsBox.textContent = '';
1302
- var many = sibs.length > 1;
1303
- sibs.forEach(function (x) {
1304
- var repos = (ctxs[x.id] || {}).repos || [];
1305
- platformsBox.appendChild(el('p', { class: 'repos-line' }, [
1306
- many ? el('b', { text: platformOf(x.platform).label + ': ' }) : null,
1307
- document.createTextNode(repos.length ? 'Agents fix these in ' + repos.join(', ') + ' · ' : 'No repo connected for agents yet · '),
1308
- el('a', { href: '#/connect?app=' + x.id, text: 'Connect a repo' }),
1309
- many ? document.createTextNode(' · ') : null,
1310
- many ? el('a', { href: '#/apps/' + x.id + '/setup', text: 'Install' }) : null,
1311
- many && designable(x) ? document.createTextNode(' · ') : null,
1312
- many && designable(x) ? el('a', { href: '#/apps/' + x.id + '/design', text: 'Design' }) : null,
1313
- many ? document.createTextNode(' · ') : null,
1314
- many ? el('a', { href: '#/apps/' + x.id + '/delete', text: 'Delete…' }) : null,
1315
- ]));
1316
- });
1317
- }
1313
+ view.classList.add('inbox-view');
1314
+ var reports = [], ctxs = {}, selected = null, loaded = false, detailSignature = null, loadSerial = 0;
1315
+ var product = p ? productOf(p) : 'all', platform = 'all', search = '', type = 'all', source = 'all';
1316
+ var shell = el('div', { class: 'inbox-shell' });
1317
+ var list = el('div', { class: 'report-list', 'aria-label': 'Reports' });
1318
+ var detail = el('section', { class: 'report-detail', 'aria-label': 'Report details', tabindex: '-1' });
1319
+ var filters = el('nav', { class: 'status-tabs', 'aria-label': 'Filter' });
1320
+ var productSelect = el('select', { 'aria-label': 'Product', onchange: function () { product = this.value; selected = null; drawProducts(); render(); } });
1321
+ var platformSelect = el('select', { 'aria-label': 'Platform', onchange: function () { platform = this.value; selected = null; render(); } },
1322
+ [el('option', { value: 'all', text: 'All platforms' })].concat(PLATFORMS.filter(function (x) { return x.ready; }).map(function (x) { return el('option', { value: x.id, text: x.label }); })));
1323
+ var searchInput = el('input', { id: 'report-search', type: 'search', placeholder: 'Search reports', 'aria-label': 'Search reports', oninput: function () { search = this.value.toLowerCase().trim(); render(); } });
1324
+ var advanced = el('div', { class: 'inbox-advanced', hidden: true });
1325
+ var filterButton = el('button', { class: 'btn', type: 'button', text: 'Filters', 'aria-expanded': 'false', 'aria-controls': 'inbox-advanced', onclick: function () { advanced.hidden = !advanced.hidden; this.setAttribute('aria-expanded', String(!advanced.hidden)); } });
1326
+ advanced.id = 'inbox-advanced';
1327
+ advanced.appendChild(el('label', {}, ['Type ', el('select', { 'aria-label': 'Report type', onchange: function () { type = this.value; render(); } },
1328
+ [el('option', { value: 'all', text: 'All types' })].concat(Object.keys(TYPE_LABEL).map(function (t) { return el('option', { value: t, text: TYPE_LABEL[t] }); })))]));
1329
+ advanced.appendChild(el('label', {}, ['Source ', el('select', { 'aria-label': 'Report source', onchange: function () { source = this.value; render(); } },
1330
+ [['all', 'All sources'], ['sdk', 'In-app'], ['chat', 'Chat apps'], ['agent', 'Agents']].map(function (t) { return el('option', { value: t[0], text: t[1] }); }))]));
1331
+ var heading = el('h1', { text: p ? productName(p) : 'Inbox' });
1332
+ var controls = el('div', { class: 'inbox-controls' }, [productSelect, platformSelect, filterButton]);
1333
+ var productTools = el('details', { class: 'inbox-app-tools', hidden: !p }, [el('summary', { text: 'Manage app' })]);
1334
+ var listHead = el('div', { class: 'list-heading' }, [el('b', { text: 'Needs review' }), el('span', { text: 'Type, then most reported' })]);
1335
+ var master = el('section', { class: 'inbox-master', 'aria-label': 'Report inbox' }, [
1336
+ el('div', { class: 'inbox-heading' }, [heading, el('p', { class: 'mute', text: 'A hearing for every report.' })]),
1337
+ el('div', { class: 'inbox-search' }, [searchInput, el('kbd', { text: '⌘ K', 'aria-hidden': 'true' })]),
1338
+ controls, advanced, productTools, filters, listHead, list,
1339
+ ]);
1340
+ shell.appendChild(master); shell.appendChild(detail); view.appendChild(shell);
1341
+ detail.appendChild(loading());
1318
1342
 
1319
- function load() {
1320
- return api('GET', '/projects').then(function (b) {
1321
- projects = b.projects;
1322
- sibs = siblings(p);
1323
- drawHead();
1324
- return Promise.all(sibs.map(function (x) {
1325
- return Promise.all([api('GET', '/projects/' + x.id + '/reports'), api('GET', '/projects/' + x.id + '/repos')])
1326
- .then(function (r) { ctxs[x.id] = { briefs: r[0].briefs || {}, repos: r[1].repos, project: x, reports: r[0].reports }; });
1327
- }));
1328
- }).then(function () {
1329
- var everything = [].concat.apply([], sibs.map(function (x) { return ctxs[x.id].reports; }));
1330
- // Merged reports leave the list and show under the one they were merged into.
1331
- var dups = {};
1332
- everything.forEach(function (r) { if (r.duplicate_of) (dups[r.duplicate_of.report_id] = dups[r.duplicate_of.report_id] || []).push(r); });
1333
- var counts = {};
1334
- Object.keys(dups).forEach(function (k) { counts[k] = dups[k].length; });
1335
- sibs.forEach(function (x) { ctxs[x.id].dups = dups; ctxs[x.id].all = everything; ctxs[x.id].reload = load; ctxs[x.id].siblings = ctxs; });
1336
- reports = triageSort(everything.filter(function (r) { return !r.duplicate_of; }), counts);
1337
- drawPlatforms();
1338
- render();
1339
- }).catch(function (x) {
1340
- if (reports.length) return; // a background refresh failed: keep what is on screen
1341
- list.textContent = '';
1342
- list.appendChild(el('p', { class: 'err', role: 'alert', text: x.message }));
1343
- list.appendChild(el('button', { class: 'btn', text: 'Retry', onclick: function () { route(); } }));
1344
- });
1343
+ function relative(iso) {
1344
+ var m = Math.max(0, Math.floor((Date.now() - Date.parse(iso)) / 60000));
1345
+ return m < 1 ? 'Just now' : m < 60 ? m + 'm ago' : m < 1440 ? Math.floor(m / 60) + 'h ago' : new Date(iso).toLocaleDateString();
1345
1346
  }
1346
-
1347
- function render() {
1348
- var many = sibs.length > 1;
1349
- platformBar.textContent = '';
1350
- platformBar.hidden = !many;
1351
- if (many) {
1352
- [{ id: 'all', label: 'All platforms' }].concat(sibs.map(function (x) { return { id: x.id, label: platformOf(x.platform).label }; })).forEach(function (f) {
1353
- var n = f.id === 'all' ? reports.length : reports.filter(function (r) { return r.project_id === f.id; }).length;
1354
- platformBar.appendChild(el('button', { 'aria-pressed': String(where === f.id), onclick: function () { where = f.id; render(); } },
1355
- [f.label + ' ', el('span', { class: 'n', text: String(n) })]));
1356
- });
1347
+ function key(r) { return r.project_id + '/' + r.id; }
1348
+ function title(r) { return r.text.replace(/[#*_`>]/g, '').split(/\n/)[0].slice(0, 110) || TYPE_LABEL[r.type] + ' report'; }
1349
+ function inProduct(r) { return product === 'all' || productOf(ctxs[r.project_id].project) === product; }
1350
+ function baseReports() { return reports.filter(function (r) {
1351
+ return inProduct(r) && (platform === 'all' || ctxs[r.project_id].project.platform === platform)
1352
+ && (type === 'all' || r.type === type) && (source === 'all' || (r.source || 'sdk') === source)
1353
+ && (!search || [r.text, r.id, ctxs[r.project_id].project.name, r.details, r.from_repo, r.via].filter(Boolean).join(' ').toLowerCase().indexOf(search) >= 0);
1354
+ }); }
1355
+ function drawProducts() {
1356
+ productSelect.textContent = '';
1357
+ productSelect.appendChild(el('option', { value: 'all', text: 'All products' }));
1358
+ var seen = {};
1359
+ projects.forEach(function (x) { var id = productOf(x); if (seen[id]) return; seen[id] = true; productSelect.appendChild(el('option', { value: id, text: productName(x) })); });
1360
+ if (product !== 'all' && !seen[product]) product = 'all';
1361
+ productSelect.value = product;
1362
+ productTools.querySelectorAll('.product-platforms').forEach(function (n) { n.remove(); });
1363
+ var managed = projects.filter(function (x) { return productOf(x) === product; })[0];
1364
+ productTools.hidden = !managed;
1365
+ if (managed) {
1366
+ var box = el('div', { class: 'product-platforms' });
1367
+ siblings(managed).forEach(function (x) { box.appendChild(el('div', { class: 'app-tool-row' }, [
1368
+ el('b', { text: platformOf(x.platform).label }),
1369
+ el('span', { class: 'app-repo-status', text: ctxs[x.id].repos.length ? 'Agents fix these in ' + ctxs[x.id].repos.join(', ') : 'No repo connected for agents yet' }),
1370
+ el('a', { href: '#/apps/' + x.id + '/setup', text: 'Install' }),
1371
+ designable(x) ? el('a', { href: '#/apps/' + x.id + '/design', text: 'Design' }) : null,
1372
+ el('a', { href: '#/connect?app=' + x.id, text: 'Connect a repo' }),
1373
+ el('a', { href: '#/apps/' + x.id + '/delete', text: 'Delete…' }),
1374
+ ])); });
1375
+ box.appendChild(el('a', { href: '#/new?product=' + productOf(managed), text: '+ Add a platform' }));
1376
+ productTools.appendChild(box);
1357
1377
  }
1358
- var here = reports.filter(function (r) { return where === 'all' || r.project_id === where; });
1359
- drawFilters(here);
1360
- list.textContent = '';
1361
- var shown = here.filter(function (r) { return filter === 'all' || r.status === filter; });
1362
- empty.hidden = shown.length > 0;
1363
- empty.textContent = '';
1364
- if (!here.length) {
1365
- empty.appendChild(document.createTextNode('No reports yet. '));
1366
- empty.appendChild(el('a', { href: '#/apps/' + (where === 'all' ? p.id : where) + '/setup', text: 'Check the install' }));
1367
- } else empty.textContent = filter === 'open' ? 'Nothing waiting. Every report has had its hearing.' : 'Nothing here.';
1368
- shown.forEach(function (r) {
1369
- var c = ctxs[r.project_id];
1370
- list.appendChild(row(c.project, r, settled, c, many));
1371
- });
1372
1378
  }
1373
-
1374
- function drawFilters(here) {
1375
- here = here || reports.filter(function (r) { return where === 'all' || r.project_id === where; });
1379
+ function render(preserveDetail) {
1380
+ if (!shell.isConnected) return;
1381
+ var focused = document.activeElement;
1382
+ var focusedReport = list.contains(focused) && focused.dataset.report;
1383
+ var focusedStatus = filters.contains(focused) && focused.dataset.status;
1384
+ var currentProduct = projects.filter(function (x) { return productOf(x) === product; })[0];
1385
+ heading.textContent = currentProduct ? productName(currentProduct) : 'Inbox';
1386
+ var here = baseReports();
1376
1387
  filters.textContent = '';
1377
1388
  ['open', 'accepted', 'fixed', 'declined', 'withdrawn', 'all'].forEach(function (f) {
1378
1389
  var n = f === 'all' ? here.length : here.filter(function (r) { return r.status === f; }).length;
1379
- filters.appendChild(el('button', {
1380
- 'aria-pressed': String(filter === f),
1381
- onclick: function () { filter = f; render(); },
1382
- }, [(f === 'all' ? 'All' : STATUS_LABEL[f]) + ' ', el('span', { class: 'n', text: String(n) })]));
1390
+ filters.appendChild(el('button', { type: 'button', 'data-status': f, 'aria-pressed': String(filter === f), onclick: function () { filter = f; selected = null; render(); } },
1391
+ [(f === 'all' ? 'All' : STATUS_LABEL[f]) + ' ', el('span', { class: 'n', text: String(n) })]));
1392
+ });
1393
+ var open = reports.filter(function (r) { return r.status === 'open'; }).length;
1394
+ $('inbox-count').textContent = String(open); $('inbox-count').hidden = !open;
1395
+ var shown = here.filter(function (r) { return filter === 'all' || r.status === filter; });
1396
+ listHead.firstChild.textContent = filter === 'open' ? 'Needs review' : filter === 'all' ? 'All reports' : STATUS_LABEL[filter] + ' reports';
1397
+ if (!shown.some(function (r) { return key(r) === selected; })) selected = shown.length ? key(shown[0]) : null;
1398
+ list.textContent = '';
1399
+ if (!projects.length) {
1400
+ list.appendChild(el('div', { class: 'inbox-empty' }, [el('img', { src: '/mark.svg', alt: '', width: '48', height: '48' }), el('h2', { text: 'Add your first app' }), el('p', { text: 'Connect your app to give every report a hearing.' }), el('a', { class: 'btn primary', href: '#/new', text: 'Add an app' })]));
1401
+ } else if (!shown.length) list.appendChild(el('div', { class: 'inbox-empty' }, [el('h2', { text: search || type !== 'all' || source !== 'all' ? 'No matching reports' : filter === 'open' ? 'All caught up' : 'Nothing here yet' }), el('p', { text: search || type !== 'all' || source !== 'all' ? 'Try another search or adjust your filters.' : 'New reports will appear here. Every report gets a hearing.' })]));
1402
+ shown.forEach(function (r) {
1403
+ var c = ctxs[r.project_id], count = (c.dups[r.id] || []).length + 1;
1404
+ var button = el('button', { type: 'button', class: 'report-preview t-' + r.type, 'data-report': key(r), 'aria-current': key(r) === selected ? 'true' : 'false', onclick: function () {
1405
+ if (selected !== key(r)) { selected = key(r); render(); }
1406
+ view.classList.add('detail-open'); detail.focus();
1407
+ } }, [
1408
+ el('span', { class: 'type-symbol', 'aria-hidden': 'true', text: { broken: '!', confusing: '?', improvement: '↗', idea: '+' }[r.type] }),
1409
+ el('span', { class: 'preview-copy' }, [el('b', { text: title(r) }), el('span', { class: 'preview-app', text: productName(c.project) + ' · ' + platformOf(c.project.platform).label }),
1410
+ el('span', { class: 'preview-meta', text: (count > 1 ? count + ' reports · ' : '') + (r.source === 'agent' ? 'Agent' : r.source === 'chat' ? r.via || 'Chat app' : 'In-app') + ' · ' + relative(r.created_at) })]),
1411
+ el('span', { class: 'pill ' + r.type, text: TYPE_LABEL[r.type] }),
1412
+ ]);
1413
+ list.appendChild(button);
1414
+ });
1415
+ drawDetail(shown, preserveDetail);
1416
+ var candidates = focusedReport ? list.querySelectorAll('[data-report]') : focusedStatus ? filters.querySelectorAll('[data-status]') : [];
1417
+ Array.prototype.some.call(candidates, function (n) {
1418
+ if ((focusedReport && n.dataset.report === focusedReport) || (focusedStatus && n.dataset.status === focusedStatus)) { n.focus({ preventScroll: true }); return true; }
1419
+ return false;
1383
1420
  });
1384
1421
  }
1385
-
1386
- /**
1387
- * A report moved. The card says so where the click was, the counts move at once, and only
1388
- * then does it leave this filter, so nothing vanishes without a word.
1389
- */
1422
+ function drawDetail(shown, preserve) {
1423
+ var chosen = shown.filter(function (x) { return key(x) === selected; })[0];
1424
+ var signature = chosen ? JSON.stringify([chosen, ctxs[chosen.project_id].briefs[chosen.id], ctxs[chosen.project_id].dups[chosen.id], ctxs[chosen.project_id].repos]) : null;
1425
+ if (preserve && signature === detailSignature && detail.querySelector('.detail-card, .detail-placeholder')) return;
1426
+ detailSignature = signature;
1427
+ detail.textContent = '';
1428
+ detail.appendChild(el('button', { class: 'btn ghost detail-back', type: 'button', text: '← Back to reports', onclick: function () { view.classList.remove('detail-open'); var active = list.querySelector('[aria-current=true]'); if (active) active.focus(); } }));
1429
+ var r = shown.filter(function (x) { return key(x) === selected; })[0];
1430
+ if (!r) { view.classList.remove('detail-open'); detail.appendChild(el('div', { class: 'detail-placeholder' }, [el('img', { src: '/mark.svg', width: '52', height: '52', alt: '' }), el('h2', { text: 'Every report gets a hearing.' }), el('p', { text: 'Select a report to read its story and decide what comes next.' })])); return; }
1431
+ var c = ctxs[r.project_id];
1432
+ var card = row(c.project, r, settled, c, true);
1433
+ card.classList.add('detail-card');
1434
+ card.setAttribute('data-report', key(r));
1435
+ card.prepend(el('div', { class: 'detail-eyebrow', text: productName(c.project) + ' / ' + r.id }));
1436
+ card.querySelector('.meta').before(el('h2', { class: 'detail-title', text: title(r) }));
1437
+ var evidence = card.querySelector('.trail');
1438
+ if (evidence) evidence.open = true;
1439
+ var device = deviceView(r.context);
1440
+ if (device) { var actions = card.querySelector('.actions'); card.insertBefore(device, actions || null); }
1441
+ detail.appendChild(card);
1442
+ }
1390
1443
  function settled(r, card, done) {
1391
- if (!done) return load(); // someone else got there first: show what they did
1392
- drawFilters();
1393
- var to = r.status;
1394
- toast(DONE_TOAST[to], filter === to || filter === 'all' ? null : {
1395
- label: 'View ' + STATUS_LABEL[to].toLowerCase(), run: function () { filter = to; render(); window.scrollTo(0, 0); },
1396
- });
1444
+ if (!done) return load();
1445
+ // A preserved detail may hold the pre-refresh object; keep filter counts in sync.
1446
+ reports.forEach(function (current) { if (key(current) === key(r)) Object.assign(current, r); });
1447
+ toast(DONE_TOAST[r.status], { label: 'View ' + STATUS_LABEL[r.status].toLowerCase(), run: function () { filter = r.status; selected = key(r); load(); } });
1397
1448
  card.classList.add('settled');
1398
- setTimeout(function () {
1399
- if (!card.isConnected) return;
1400
- if (filter === 'all' || filter === to) return load(); // it stays in this list
1401
- card.style.height = card.offsetHeight + 'px';
1402
- card.getBoundingClientRect();
1403
- card.classList.add('leaving');
1404
- card.style.height = '0px';
1405
- setTimeout(load, 320);
1406
- }, 2200);
1449
+ list.querySelectorAll('[data-report]').forEach(function (n) { if (n.dataset.report === key(r)) n.classList.add('settled'); });
1450
+ setTimeout(function () { if (card.isConnected) load(); }, 1400);
1451
+ }
1452
+ function readingReport() {
1453
+ return (detail.contains(document.activeElement) && /^(INPUT|TEXTAREA|SELECT)$/.test(document.activeElement.tagName)) || detail.querySelector('.busy, .settled')
1454
+ || Array.prototype.some.call(detail.querySelectorAll('textarea, input'), function (n) { return n.value.trim(); });
1455
+ }
1456
+ function load(background) {
1457
+ var serial = ++loadSerial, nextProjects, nextContexts = {};
1458
+ return api('GET', '/projects').then(function (b) {
1459
+ if (!shell.isConnected) return;
1460
+ nextProjects = b.projects;
1461
+ return Promise.all(nextProjects.map(function (x) {
1462
+ return Promise.all([api('GET', '/projects/' + x.id + '/reports'), api('GET', '/projects/' + x.id + '/repos')]).then(function (r) {
1463
+ nextContexts[x.id] = { project: x, reports: r[0].reports, briefs: r[0].briefs || {}, repos: r[1].repos || [] };
1464
+ });
1465
+ }));
1466
+ }).then(function () {
1467
+ if (!shell.isConnected || serial !== loadSerial || (background && readingReport())) return;
1468
+ // Commit a complete snapshot together; failed refreshes leave the old one intact.
1469
+ // Retained details close over their context; update it in place after success.
1470
+ Object.keys(nextContexts).forEach(function (id) {
1471
+ if (ctxs[id]) nextContexts[id] = Object.assign(ctxs[id], nextContexts[id]);
1472
+ });
1473
+ projects = nextProjects; ctxs = nextContexts;
1474
+ var everything = [].concat.apply([], projects.map(function (x) { return ctxs[x.id].reports; }));
1475
+ var dups = {}, counts = {};
1476
+ everything.forEach(function (r) { if (r.duplicate_of) (dups[r.duplicate_of.report_id] = dups[r.duplicate_of.report_id] || []).push(r); });
1477
+ Object.keys(dups).forEach(function (id) { counts[id] = dups[id].length; });
1478
+ projects.forEach(function (x) { var c = ctxs[x.id]; c.dups = dups; c.all = everything.filter(function (r) { return productOf(ctxs[r.project_id].project) === productOf(x); }); c.siblings = ctxs; c.reload = load; });
1479
+ reports = triageSort(everything.filter(function (r) { return !r.duplicate_of; }), counts);
1480
+ loaded = true; drawProducts(); render(background === true);
1481
+ }).catch(function (x) {
1482
+ if (!shell.isConnected) return;
1483
+ if (loaded) { toast('Could not refresh reports. ' + x.message, null, true); return; }
1484
+ list.textContent = ''; detail.textContent = '';
1485
+ list.appendChild(el('div', { class: 'inbox-empty' }, [el('h2', { text: 'Could not load reports' }), el('p', { class: 'err', role: 'alert', text: x.message }), el('button', { class: 'btn', text: 'Retry', onclick: load })]));
1486
+ });
1407
1487
  }
1408
-
1409
1488
  load();
1410
- // Reports arrive while you read. Don't refresh under someone typing, or a card on its way out.
1411
- every(30000, function () { if (!list.querySelector('textarea, .report.settled, .report .busy')) load(); });
1412
- }
1413
-
1414
- function ctxLine(c) {
1415
- return [c.page_title, c.route, c.app_version && ('v' + c.app_version), c.platform, c.os, c.browser,
1416
- c.viewport]
1417
- .filter(Boolean).join(' · ');
1489
+ every(30000, function () {
1490
+ // Keep a person's form, selection and reading position steady while they work.
1491
+ if (readingReport()) return;
1492
+ load(true);
1493
+ });
1418
1494
  }
1419
1495
 
1420
- /** The device around the app: what layout, language and timing bugs depend on. */
1421
- function deviceLine(c) {
1422
- var s = c.session_s;
1423
- var inApp = s == null ? null : 'in the app ' + (s < 60 ? s + ' s' : s < 3600 ? Math.floor(s / 60) + ' min' : Math.floor(s / 3600) + ' h ' + Math.floor(s % 3600 / 60) + ' min');
1424
- return [c.device, c.screen, c.theme && c.theme + ' mode', c.locale, c.timezone, c.network, c.settings, inApp]
1425
- .filter(Boolean).join(' · ');
1496
+ function deviceView(c) {
1497
+ var fields = [['Platform', c.platform], ['App version', c.app_version], ['Browser', c.browser], ['OS', c.os], ['Page', c.route], ['Network', c.network]];
1498
+ var more = [['Page title', c.page_title], ['Device', c.device], ['Screen', c.screen], ['Viewport', c.viewport], ['Language', c.locale], ['Timezone', c.timezone], ['Theme', c.theme], ['Settings', c.settings], ['Session', c.session_s == null ? null : c.session_s + ' seconds']];
1499
+ function grid(values) { var dl = el('dl', { class: 'device-grid' }); values.forEach(function (f) { if (f[1]) { dl.appendChild(el('dt', { text: f[0] })); dl.appendChild(el('dd', { text: f[1] })); } }); return dl; }
1500
+ if (!fields.concat(more).some(function (f) { return f[1]; })) return null;
1501
+ return el('section', { class: 'device-section', 'aria-label': 'Device and app' }, [el('h3', { text: 'Device & app' }), grid(fields), more.some(function (f) { return f[1]; }) ? el('details', {}, [el('summary', { text: 'View all details' }), grid(more)]) : null]);
1426
1502
  }
1427
1503
 
1428
1504
  var TRAIL_LABEL = { page: 'Page', click: 'Click', request: 'Request', error: 'Error', warn: 'Warning', state: 'Device' };
@@ -1473,11 +1549,16 @@
1473
1549
  var typed = [rp.name, rp.email].filter(Boolean).join(' · ');
1474
1550
  if (!app && !typed && !rp.note) return null;
1475
1551
  var reply = c.user_email || rp.email;
1476
- return el('div', { class: 'ctx' }, [
1552
+ var label = c.user_label || c.user_id || rp.name || rp.email || '';
1553
+ var initials = label.split(/\s+/).slice(0, 2).map(function (part) { return part.charAt(0); }).join('').toUpperCase();
1554
+ return el('div', { class: 'ctx reporter-context' }, [
1555
+ label ? el('span', { class: 'avatar', 'aria-hidden': 'true', text: initials }) : null,
1556
+ el('div', {}, [
1477
1557
  app ? el('span', {}, [document.createTextNode('Signed in: ' + app + ' ')]) : null,
1478
1558
  !app && typed ? el('span', {}, [document.createTextNode('From: ' + typed + ' ')]) : null,
1479
1559
  reply ? mailto(reply) : null,
1480
1560
  rp.note ? el('div', { text: 'About their setup: ' + rp.note }) : null,
1561
+ ]),
1481
1562
  ]);
1482
1563
  }
1483
1564
 
@@ -1492,6 +1573,7 @@
1492
1573
  var brief = ctx.briefs[r.id];
1493
1574
  var err = el('span', { class: 'err', role: 'alert' });
1494
1575
  var actions = el('div', { class: 'actions' });
1576
+ var acceptNote = el('textarea', { class: 'accept-note', rows: '2', maxlength: '1000', placeholder: 'Clarify what should change…', 'aria-label': 'Add a note for the coding agent (optional)' });
1495
1577
  var card, sentTo = null;
1496
1578
  var act = function (action, body, b) {
1497
1579
  if (action === 'accept') sentTo = (body && body.repo) || ctx.repos[0] || null;
@@ -1538,8 +1620,12 @@
1538
1620
  // Several repos hold this app's code: say where the fix goes, defaulting to the first.
1539
1621
  var pick = ctx.repos.length > 1 ? el('select', { 'aria-label': 'Where the fix goes' },
1540
1622
  ctx.repos.map(function (x) { return el('option', { value: x, text: 'Fix in ' + x }); })) : null;
1623
+ actions.appendChild(el('label', { class: 'accept-note-label' }, ['Add a note for the coding agent (optional)', acceptNote]));
1541
1624
  actions.appendChild(el('button', { class: 'btn primary', type: 'button', text: 'Accept', onclick: function (e) {
1542
- act('accept', pick ? { repo: pick.value } : undefined, e.currentTarget);
1625
+ var body = {};
1626
+ if (pick) body.repo = pick.value;
1627
+ if (acceptNote.value.trim()) body.note = acceptNote.value.trim();
1628
+ act('accept', body, e.currentTarget);
1543
1629
  } }));
1544
1630
  if (pick) actions.appendChild(pick);
1545
1631
  actions.appendChild(el('button', { class: 'btn', type: 'button', text: 'Decline…', onclick: declineForm }));
@@ -1565,6 +1651,7 @@
1565
1651
  }));
1566
1652
  actions.appendChild(el('button', { class: 'btn', type: 'button', text: 'Mark fixed…', onclick: fixedForm }));
1567
1653
  }
1654
+ if (r.status === 'open') actions.appendChild(el('p', { class: 'accept-hint', text: 'Accepting makes this report available to a connected coding agent.' }));
1568
1655
  actions.appendChild(err);
1569
1656
  }
1570
1657
 
@@ -1615,7 +1702,7 @@
1615
1702
  el('span', { class: 'mute', text: ' · ' + TYPE_LABEL[d.type] + (showPlatform ? ' · ' + platformOf(dp.platform).label : '') + ' · ' + new Date(d.created_at).toLocaleDateString() }),
1616
1703
  d.status === 'open' ? el('button', { class: 'link', type: 'button', text: 'Unmerge', onclick: function () {
1617
1704
  api('POST', '/projects/' + d.project_id + '/reports/' + d.id + '/unmerge').then(function () { toast('Unmerged.'); ctx.reload(); })
1618
- .catch(function (x) { toast(x.message); });
1705
+ .catch(function (x) { toast(x.message, null, true); });
1619
1706
  } }) : null,
1620
1707
  ]);
1621
1708
  })),
@@ -1677,7 +1764,7 @@
1677
1764
  var save = el('button', { class: 'btn primary', type: 'button', text: 'Save', onclick: function () {
1678
1765
  api('POST', '/projects/' + r.project_id + '/reports/' + r.id + '/fix-ref', { version: v.value.trim() })
1679
1766
  .then(function (b) { f = b.report.fix_ref || f; draw(); toast('They’ll see “Fixed in ' + f.version + '”.'); })
1680
- .catch(function (x) { toast(x.message); });
1767
+ .catch(function (x) { toast(x.message, null, true); });
1681
1768
  } });
1682
1769
  submitOnCmdEnter(v, save);
1683
1770
  line.appendChild(v); line.appendChild(save);
@@ -1713,8 +1800,8 @@
1713
1800
  el('summary', { text: 'Attached document' + (r.document.title ? ': ' + r.document.title : '') + ' · ' + (r.document.markdown.length < 1000 ? r.document.markdown.length + ' characters' : Math.round(r.document.markdown.length / 1000) + 'k characters') }),
1714
1801
  markdown(r.document.markdown),
1715
1802
  ]) : null,
1716
- r.source === 'chat' || r.source === 'agent' ? null : el('div', { class: 'ctx', text: ctxLine(r.context) }),
1717
- r.source !== 'chat' && r.source !== 'agent' && deviceLine(r.context) ? el('div', { class: 'ctx', text: deviceLine(r.context) }) : null,
1803
+ null,
1804
+ null,
1718
1805
  r.context.page_url ? el('div', { class: 'ctx' }, [el('a', { href: r.context.page_url, target: '_blank', rel: 'noopener noreferrer', text: r.context.page_url })]) : null,
1719
1806
  reporterLine(r.context, r.reporter),
1720
1807
  dupBox,
@@ -1797,7 +1884,7 @@
1797
1884
  go.disabled = true;
1798
1885
  api('DELETE', '/projects/' + p.id, { confirm: confirm.value }).then(function () {
1799
1886
  projects = projects.filter(function (x) { return x.id !== p.id; });
1800
- location.hash = '#/';
1887
+ location.hash = '#/apps';
1801
1888
  }).catch(function (x) { err.textContent = x.message; go.disabled = false; });
1802
1889
  };
1803
1890
  view.appendChild(el('section', { class: 'card' }, owner ? [el('h2', { text: '2. Delete the app from Heresay' }), form]
@@ -2246,7 +2333,10 @@
2246
2333
  function link(href, label) {
2247
2334
  var ok = /^(https?:\/\/|mailto:)/i.test(href);
2248
2335
  if (!ok) return document.createTextNode(label === href ? href : label + ' (' + href + ')');
2249
- return inline(el('a', { href: href, target: '_blank', rel: 'noopener noreferrer nofollow' }), label);
2336
+ var a = el('a', { href: href, target: '_blank', rel: 'noopener noreferrer nofollow' });
2337
+ // A bare address is its own label: as text, or inline() finds it again and never stops.
2338
+ if (label === href) { a.textContent = href; return a; }
2339
+ return inline(a, label);
2250
2340
  }
2251
2341
 
2252
2342
  // ---- chat apps -------------------------------------------------------------------------
@@ -102,7 +102,7 @@
102
102
  <tr><td><code>data-preferences</code></td><td><code>show</code> · <code>hide</code></td></tr>
103
103
  <tr><td><code>data-trail</code></td><td>on · <code>off</code> · the parts to keep, like <code>pages errors requests</code>. What happened before a report: pages, clicks, failed requests, errors. The reporter sees it and can take it off. Never what anyone typed.</td></tr>
104
104
  <tr><td><code>data-heresay-private</code></td><td>on any element of your app: clicks on it are recorded without its text</td></tr>
105
- <tr><td><code>data-nudge</code></td><td>off · <code>on</code> · the signals to watch, like <code>clicks errors</code>. When something failed (a button pressed again and again with nothing happening, an error right after a click, requests failing), a small note by the button asks “Something not working?”. When someone seems unsure (<code>stalled</code>: typing that stopped; <code>circles</code>: the same few pages over and over; <code>refused</code>: a field refused 3 times), it asks “Stuck on something?” and opens as Confusing. Watched on the device, never sent. Once per tab; quiet for 7 days after “Not now”.</td></tr></table>
105
+ <tr><td><code>data-nudge</code></td><td>off · <code>on</code> · the signals to watch, like <code>clicks errors</code>. When something failed (a button pressed again and again with nothing happening, an error right after a click, requests failing), a small note by the button asks “Something not working?”. When someone seems unsure (<code>stalled</code>: typing that stopped; <code>circles</code>: the same few pages over and over; <code>refused</code>: a field refused 3 times), it asks “Stuck on something?” and opens as Confusing. Watched on the device, never sent. Once per tab.</td></tr></table>
106
106
  <p>Always there, whatever you choose: the Heresay mark on the button, the <b>Your reports</b> tab (people read why a report was declined), and <b>Powered by Heresay</b> in the panel and the introduction, so people can tell your app uses an outside tool. The widget lives in a shadow root, so your CSS can't restyle it.</p>
107
107
 
108
108
  <h2 id="api">JavaScript API</h2>
@@ -76,8 +76,8 @@ anyone typed. On by default; change it only when asked.
76
76
 
77
77
  When someone seems stuck, a small note by the button (or in its corner on macOS) asks "Something
78
78
  not working?" and opens the sheet as Broken, with the trail. Watched on the device, never sent. At
79
- most once per launch, and not for 7 days after "Not now". Off by default: it appears on the app's
80
- own screen, so add it only when asked.
79
+ most once per launch. Off by default: it appears on the app's own screen, so add it only when
80
+ asked.
81
81
 
82
82
  | Option | Values |
83
83
  | --- | --- |
@@ -92,9 +92,8 @@ app updated from 1.3 to 1.4". On by default; change it only when asked.
92
92
  **Offering help**
93
93
 
94
94
  When someone seems stuck, a small note by the button asks "Something not working?" and opens the
95
- form as Broken, with the trail. Watched on the device, never sent. At most once per tab, and not
96
- for 7 days after "Not now". Off by default: it appears on the app's own page, so add it only when
97
- asked.
95
+ form as Broken, with the trail. Watched on the device, never sent. At most once per tab. Off by default:
96
+ it appears on the app's own page, so add it only when asked.
98
97
 
99
98
  | Attribute | Values |
100
99
  | --- | --- |
@@ -487,7 +487,9 @@
487
487
  var TRAIL_MAX = 50, TRAIL_AGE = 5 * 60000;
488
488
  // Pages visited and when someone last typed, for data-nudge ("offering help"). Here because the
489
489
  // page watcher below records the first page before that part of the script runs.
490
- var visits = [], typedAt = 0;
490
+ // Also when they last clicked or pressed a key, and when the page last changed, to tell what
491
+ // they sent from what the app sent by itself.
492
+ var visits = [], typedAt = 0, actedAt = 0, pageAt = 0;
491
493
  // data-nudge, read here because the request watchers below serve both. See "offering help".
492
494
  var NUDGE_SIGNALS = ['clicks', 'errors', 'requests', 'stalled', 'circles', 'refused'];
493
495
  var NUDGE = (function () {
@@ -617,6 +619,7 @@
617
619
  var w = location.pathname + location.hash;
618
620
  if (w === lastWhere) return;
619
621
  lastWhere = w;
622
+ pageAt = Date.now();
620
623
  visited(w);
621
624
  if (first === true) { note('page', titled(w)); return; }
622
625
  // Single-page apps set the title just after the address: the entry goes in now, in order,
@@ -720,10 +723,10 @@
720
723
  var url = typeof input === 'string' ? input : input && (input.url || String(input));
721
724
  if (url && !ours(url)) {
722
725
  var method = String(init && init.method || input && input.method || 'GET').toUpperCase();
723
- var t0 = Date.now();
726
+ var t0 = Date.now(), mine = byHand();
724
727
  p.then(function (res) {
725
728
  if (!res.ok && res.type !== 'opaque') { note('request', method + ' ' + shortUrl(url) + ' → ' + res.status + took(t0)); requestFailed(res.status); }
726
- else { slow(method, url, res.status, t0); if (method !== 'GET' && method !== 'HEAD') sentSomething(); }
729
+ else { slow(method, url, res.status, t0); if (mine && method !== 'GET' && method !== 'HEAD') sentSomething(); }
727
730
  }, function (err) {
728
731
  if (err && err.name === 'AbortError') return;
729
732
  note('request', method + ' ' + shortUrl(url) + ' → failed (' + (navigator.onLine === false ? 'offline' : 'network error') + ')' + took(t0));
@@ -744,12 +747,12 @@
744
747
  var x = this, r = x.__heresay;
745
748
  try {
746
749
  if (r && !ours(r.u)) {
747
- var aborted = false, t0 = Date.now();
750
+ var aborted = false, t0 = Date.now(), mine = byHand();
748
751
  x.addEventListener('abort', function () { aborted = true; });
749
752
  x.addEventListener('loadend', function () {
750
753
  if (x.status >= 400) { note('request', r.m + ' ' + shortUrl(r.u) + ' → ' + x.status + took(t0)); requestFailed(x.status); }
751
754
  else if (x.status === 0 && !aborted) { note('request', r.m + ' ' + shortUrl(r.u) + ' → failed (network error)' + took(t0)); requestFailed(0); }
752
- else if (x.status) { slow(r.m, r.u, x.status, t0); if (r.m !== 'GET' && r.m !== 'HEAD') sentSomething(); }
755
+ else if (x.status) { slow(r.m, r.u, x.status, t0); if (mine && r.m !== 'GET' && r.m !== 'HEAD') sentSomething(); }
753
756
  });
754
757
  }
755
758
  } catch (e) { /* ignore */ }
@@ -854,7 +857,7 @@
854
857
  * refused the same field refused 3 times in 2 minutes (the browser's check, or the app
855
858
  * setting aria-invalid)
856
859
  *
857
- * At most once per tab, and not for 7 days after "Not now".
860
+ * At most once per tab. "Not now" only closes it.
858
861
  */
859
862
  var DEAD_WAIT = 1500, DEAD_SPAN = 10000, DEAD_COUNT = 3;
860
863
  var lastPress = 0;
@@ -930,11 +933,19 @@
930
933
  }
931
934
  function trouble(why) { if (NUDGE[why]) offerHelp(/^(stalled|circles|refused)$/.test(why) ? 'stuck' : 'broken'); }
932
935
 
933
- // Unsure, not blocked. Anything sent (a form, a request that changes something) means they
936
+ // Unsure, not blocked. Anything they sent (a form, a request that changes something) means they
934
937
  // got there, so it starts these over.
935
938
  var sentAt = 0;
936
939
  function sentSomething() { sentAt = Date.now(); visits = []; typedAt = 0; }
937
940
  document.addEventListener('submit', function (e) { if (!host.contains(e.target)) sentSomething(); }, true);
941
+ // A request is theirs if it started within 2 s of a click or key press, with no page change in
942
+ // between. Apps send requests by themselves too: polling, analytics, and loading the new page's
943
+ // data after a page change (Firestore, for one, POSTs to listen). Those must not start "circles"
944
+ // over, or it would never be reached.
945
+ function acted(e) { if (!host.contains(e.target)) actedAt = Date.now(); }
946
+ document.addEventListener('pointerdown', acted, true);
947
+ document.addEventListener('keydown', acted, true);
948
+ function byHand() { return Date.now() - actedAt < 2000 && pageAt <= actedAt; }
938
949
 
939
950
  // Going in circles: a few pages, over and over, inside a minute.
940
951
  function visited(where) {
@@ -1598,8 +1609,8 @@
1598
1609
 
1599
1610
  // Someone seems stuck (data-nudge), or the app says so (nudge()). A note by the button, which
1600
1611
  // takes no focus and goes by itself after 15 s unless it is being read. "Tell the team" opens
1601
- // the form as Broken, with the trail. At most once per tab; "Not now" quiets it for 7 days.
1602
- var NUDGE_NO = 'fbsdk.nudge.no.' + KEY, NUDGE_TAB = 'fbsdk.nudged.' + KEY, NUDGE_REST = 7 * 864e5;
1612
+ // the form as Broken, with the trail. At most once per tab; "Not now" only closes it.
1613
+ var NUDGE_TAB = 'fbsdk.nudged.' + KEY;
1603
1614
  var nudgeEl = null;
1604
1615
  /** True if this tab was already offered help; otherwise marks it. */
1605
1616
  function offeredInTab() {
@@ -1617,28 +1628,26 @@
1617
1628
  function offerHelp(kind) {
1618
1629
  var stuck = kind === 'stuck';
1619
1630
  if (dead || scrim || bubble || nudgeEl || !host.isConnected || hiddenHere() || document.visibilityState === 'hidden') return false;
1620
- if (Date.now() - (+load(NUDGE_NO) || 0) < NUDGE_REST) return false;
1621
1631
  if (offeredInTab()) return false;
1622
1632
  var timer = null;
1623
- var done = function (no) {
1633
+ var done = function () {
1624
1634
  clearTimeout(timer);
1625
- if (no) save(NUDGE_NO, String(Date.now()));
1626
1635
  if (nudgeEl) { nudgeEl.remove(); nudgeEl = null; }
1627
1636
  };
1628
- var later = function () { clearTimeout(timer); timer = setTimeout(function () { done(false); }, 15000); };
1637
+ var later = function () { clearTimeout(timer); timer = setTimeout(done, 15000); };
1629
1638
  var stay = function () { clearTimeout(timer); };
1630
1639
  nudgeEl = el('div', {
1631
1640
  class: 'intro nudge ' + PLACE + ' st-' + STYLE + (fabShowing() ? '' : ' free'),
1632
1641
  role: 'status', 'aria-label': S.nudgeAria,
1633
1642
  onpointerenter: stay, onpointerleave: later, onfocusin: stay, onfocusout: later,
1634
- onkeydown: function (e) { if (e.key === 'Escape') done(true); },
1643
+ onkeydown: function (e) { if (e.key === 'Escape') done(); },
1635
1644
  }, [
1636
1645
  el('b', { text: stuck ? S.nudgeStuckTitle : S.nudgeTitle }),
1637
1646
  el('p', { text: stuck ? S.nudgeStuckBody : S.nudgeBody }),
1638
1647
  el('div', { class: 'row' }, [
1639
- el('button', { class: 'link', type: 'button', text: S.nudgeNo, onclick: function () { done(true); } }),
1648
+ el('button', { class: 'link', type: 'button', text: S.nudgeNo, onclick: function () { done(); } }),
1640
1649
  el('button', { class: 'send', type: 'button', text: S.nudgeYes, onclick: function () {
1641
- done(false);
1650
+ done();
1642
1651
  var as = stuck ? 'confusing' : 'broken';
1643
1652
  if (!state.type && OFFERED.some(function (t) { return t.id === as; })) state.type = as;
1644
1653
  open('new');
@@ -0,0 +1,271 @@
1
+ /* Heresay workspace. Brand: Deep Peacock, Figtree, Bricolage Grotesque, JetBrains Mono. */
2
+ :root { --sidebar:224px; --soft:#f6f7f8; --mute:#626c7a; --line:#e5e8ec; }
3
+ body { font-size:14px; }
4
+ button, input, select, textarea { font-family:inherit; }
5
+ button, a, input, select, textarea, summary { -webkit-tap-highlight-color:transparent; }
6
+ button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline:2px solid var(--acc); outline-offset:3px; }
7
+ button:disabled { opacity:.55; cursor:not-allowed; }
8
+ input, textarea, select, .btn { border-radius:7px; }
9
+ input, textarea, select { border-color:#cfd5dc; }
10
+ input::placeholder, textarea::placeholder { color:#737e8c; opacity:1; }
11
+ textarea { resize:vertical; }
12
+ .btn { font-size:13px; min-height:36px; padding:7px 13px; }
13
+ .btn.primary { background:var(--acc); }
14
+ .btn.ghost:hover { background:var(--soft); }
15
+ h1 { font-size:30px; }
16
+ h3 { font-size:15px; margin:0 0 14px; font-weight:700; }
17
+ .card, .product-card, .app-card, .platform { border-radius:9px; box-shadow:none; }
18
+ .card { padding:24px; margin-top:24px; }
19
+ .card h2 { margin-bottom:14px; }
20
+ .head { margin-bottom:24px; }
21
+ .head .row { margin:0; }
22
+ .code pre { border-radius:8px; }
23
+ .skip-link { position:fixed; top:8px; left:240px; z-index:50; transform:translateY(-160%); background:var(--bg); border:2px solid var(--acc); padding:8px 16px; border-radius:6px; }
24
+ .skip-link:focus { transform:translateY(0); }
25
+ .sidebar { width:var(--sidebar); position:fixed; inset:0 auto 0 0; display:flex; flex-direction:column; z-index:12; background:#f7f8f9; border-right:1px solid var(--line); padding:28px 14px 14px; }
26
+ .brand { display:block; margin:0 12px 26px; }
27
+ .brand img { display:block; width:150px; height:auto; }
28
+ .workspace-label { display:flex; align-items:center; gap:9px; min-height:42px; margin:0 4px 25px; padding:8px 10px; border:1px solid var(--line); border-radius:7px; background:var(--bg); font-size:12px; }
29
+ .workspace-icon { display:grid; place-items:center; width:22px; height:22px; border-radius:5px; background:var(--mist); color:var(--deep); font-weight:700; }
30
+ .workspace-role { color:var(--mute); margin-left:auto; font-size:10px; }
31
+ .sidebar .tabs { display:flex; flex-direction:column; gap:5px; }
32
+ .sidebar .tabs a { display:flex; align-items:center; gap:12px; min-height:42px; color:#46505e; font-size:14px; font-weight:500; text-decoration:none; padding:10px 12px; border-radius:6px; position:relative; }
33
+ .sidebar .tabs a:hover { background:#edf0f2; color:var(--fg); }
34
+ .sidebar .tabs a[aria-current=page] { color:var(--deep); background:var(--mist); font-weight:700; }
35
+ .sidebar .tabs a[aria-current=page]::before { content:""; position:absolute; left:0; top:8px; bottom:8px; width:2px; background:var(--acc); border-radius:2px; }
36
+ .nav-icon { flex:none; width:19px; height:19px; display:inline-flex; }
37
+ .nav-icon svg { width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round; stroke-linejoin:round; }
38
+ .nav-count { margin-left:auto; min-width:23px; padding:0 5px; border-radius:4px; background:#d3eae6; text-align:center; font-size:12px; }
39
+ .nav-section { border-top:1px solid var(--line); margin:24px 8px 9px; padding:20px 6px 0; text-transform:uppercase; letter-spacing:.09em; color:var(--mute); font-size:10px; font-weight:600; }
40
+ .sidebar-bottom { margin-top:auto; padding-top:24px; }
41
+ .help-link { display:flex; align-items:center; gap:12px; padding:16px 10px; border-top:1px solid var(--line); color:#46505e; text-decoration:none; font-size:13px; }
42
+ .help-link > span:last-child { margin-left:auto; }
43
+ .account { display:flex; gap:10px; align-items:center; padding:14px 10px 0; }
44
+ .account .avatar { width:30px; height:30px; flex:none; background:var(--deep); color:white; font-size:11px; }
45
+ .account .who { display:block; overflow:hidden; text-overflow:ellipsis; color:var(--fg); font-size:12px; white-space:nowrap; }
46
+ .signout { margin:4px 0 0 49px; padding:2px 0; min-height:28px; font-size:11px; }
47
+ .workspace-top { position:sticky; top:0; z-index:8; margin-left:var(--sidebar); min-height:55px; padding:0 28px; display:flex; align-items:center; justify-content:space-between; gap:16px; background:var(--bg); border-bottom:1px solid var(--line); }
48
+ .breadcrumb { display:flex; gap:12px; align-items:center; font-size:12px; color:var(--mute); }
49
+ .breadcrumb > span:first-child { color:#acb3bc; }
50
+ #page-label { color:var(--fg); }
51
+ .top-caption { color:var(--mute); font-size:11px; }
52
+ #nav-toggle { display:none; }
53
+ #view { max-width:1120px; margin:0 0 0 var(--sidebar); padding:38px 42px 80px; min-height:calc(100dvh - 55px); }
54
+ #view.wide { max-width:none; }
55
+ #update { margin-left:var(--sidebar); border-bottom:1px solid var(--line); border-radius:0; }
56
+ #view:not(.inbox-view) > .head, #view:not(.inbox-view) > h1 { margin-top:0; }
57
+ .apps { gap:18px; margin-top:24px; }
58
+ .product-card { background:var(--bg); transition:border-color .15s; }
59
+ .product-card:hover { border-color:#b8c5c3; }
60
+ .picon { width:38px; height:38px; border-radius:8px; }
61
+ .platform { padding:24px; }
62
+ .hello { margin-top:12vh; }
63
+ .gate { border:1px solid var(--line); border-radius:12px; padding:36px; max-width:430px; box-shadow:0 10px 40px rgb(21 23 28 / .04); }
64
+ .gate h1 { font-size:27px; }
65
+ .gate .btn { min-height:42px; }
66
+ .members li { padding:16px 0; }
67
+ .design-side { top:78px; }
68
+
69
+ /* The report list and evidence pane fill the workspace; both scroll independently. */
70
+ #view.inbox-view { max-width:none; padding:0; height:calc(100dvh - 55px); min-height:560px; }
71
+ .inbox-shell { display:grid; grid-template-columns:minmax(340px, 39%) minmax(0, 1fr); height:100%; }
72
+ .inbox-master { min-width:0; overflow:auto; border-right:1px solid var(--line); overscroll-behavior:contain; }
73
+ .inbox-heading { padding:28px 24px 0; }
74
+ .inbox-heading h1 { font-size:29px; }
75
+ .inbox-heading p { font-size:14px; margin:5px 0 18px; }
76
+ .inbox-search { position:relative; margin:0 24px 14px; }
77
+ .inbox-search input { width:100%; height:37px; padding-right:55px; font-size:13px; background:var(--bg); }
78
+ .inbox-search kbd { position:absolute; right:10px; top:9px; font:11px var(--mono); color:var(--mute); border:1px solid var(--line); border-radius:3px; padding:0 4px; pointer-events:none; }
79
+ .inbox-controls { display:flex; gap:8px; padding:0 24px 18px; }
80
+ .inbox-controls select { font-size:12px; padding:7px 22px 7px 9px; min-width:0; max-width:42%; text-overflow:ellipsis; height:36px; }
81
+ .inbox-controls .btn { font-size:12px; }
82
+ .inbox-advanced { background:var(--soft); padding:12px 24px; display:flex; gap:12px; flex-wrap:wrap; border-block:1px solid var(--line); }
83
+ .inbox-advanced label { color:var(--mute); font-size:12px; display:flex; align-items:center; gap:8px; }
84
+ .inbox-advanced select { font-size:12px; padding:5px 8px; max-width:170px; }
85
+ .inbox-app-tools { margin:0 24px 18px; font-size:12px; }
86
+ .inbox-app-tools summary { color:var(--acc); cursor:pointer; }
87
+ .inbox-app-tools .product-platforms { margin:10px 0 0; }
88
+ .app-tool-row { display:flex; gap:10px; flex-wrap:wrap; padding:8px 0; }
89
+ .app-tool-row b { width:100%; }
90
+ .status-tabs { display:flex; gap:2px; padding:0 18px; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:thin; }
91
+ .status-tabs button { display:flex; align-items:center; gap:5px; padding:13px 8px; font:600 12px Figtree,system-ui,sans-serif; border:0; border-bottom:2px solid transparent; background:none; color:var(--mute); white-space:nowrap; cursor:pointer; }
92
+ .status-tabs button:hover { color:var(--fg); }
93
+ .status-tabs button[aria-pressed=true] { color:var(--deep); border-bottom-color:var(--acc); }
94
+ .status-tabs .n { font-size:10px; font-weight:500; border-radius:4px; padding:0 4px; background:var(--soft); min-width:17px; }
95
+ .status-tabs button[aria-pressed=true] .n { background:var(--mist); }
96
+ .list-heading { display:flex; align-items:baseline; justify-content:space-between; gap:12px; padding:18px 24px; font-size:12px; }
97
+ .list-heading b { font-size:13px; }
98
+ .list-heading > span { font-size:10px; color:var(--mute); }
99
+ .report-preview { --type:var(--mute); display:grid; grid-template-columns:23px minmax(0,1fr) auto; gap:12px; width:100%; text-align:left; border:0; border-bottom:1px solid var(--line); background:var(--bg); font:inherit; padding:20px 22px 20px 24px; cursor:pointer; position:relative; color:var(--fg); }
100
+ .report-preview:hover { background:#f7f9fa; }
101
+ .report-preview[aria-current=true] { background:#edf6f4; }
102
+ .report-preview[aria-current=true]::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--acc); }
103
+ .report-preview.t-broken { --type:var(--broken); }
104
+ .report-preview.t-confusing { --type:var(--confusing); }
105
+ .report-preview.t-improvement { --type:var(--improvement); }
106
+ .report-preview.t-idea { --type:var(--idea); }
107
+ .type-symbol { display:grid; place-items:center; border:1.5px solid var(--type); border-radius:50%; width:21px; height:21px; color:var(--type); font-size:14px; line-height:1; margin-top:2px; }
108
+ .preview-copy { min-width:0; }
109
+ .preview-copy b { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; font-weight:650; line-height:1.45; font-size:14px; overflow-wrap:anywhere; }
110
+ .preview-app { display:block; color:var(--mute); font-size:12px; margin-top:5px; }
111
+ .preview-meta { display:block; color:var(--mute); font-size:10px; margin-top:9px; }
112
+ .report-preview > .pill { font-weight:500; font-size:10px; padding:3px 6px; border-radius:4px; align-self:start; letter-spacing:0; }
113
+ .report-preview > .broken { background:#fbeceb; }
114
+ .report-preview > .confusing { background:#fbf1e3; }
115
+ .report-preview > .improvement { background:#eaf0fa; max-width:82px; text-align:center; }
116
+ .report-preview > .idea { background:#f1edf9; }
117
+ .report-preview.settled { opacity:.55; }
118
+ .inbox-empty { text-align:center; padding:56px 28px; color:var(--mute); }
119
+ .inbox-empty img { margin-bottom:16px; }
120
+ .inbox-empty h2 { color:var(--fg); }
121
+ .inbox-empty p { margin:8px 0 20px; }
122
+ .report-detail { min-width:0; overflow:auto; overscroll-behavior:contain; background:var(--bg); }
123
+ .report-detail:focus { outline:none; }
124
+ .detail-back { display:none; }
125
+ .detail-placeholder { text-align:center; padding:22vh 32px 40px; color:var(--mute); max-width:420px; margin:auto; }
126
+ .detail-placeholder img { opacity:.5; margin-bottom:18px; }
127
+ .detail-placeholder h2 { font-size:21px; color:var(--fg); }
128
+ .detail-placeholder p { margin-top:10px; }
129
+ .report.detail-card { padding:28px 30px 32px; border:0; border-radius:0; margin:0; box-shadow:none; overflow:visible; transition:background-color .2s; min-height:100%; }
130
+ .report.detail-card:hover { border:0; box-shadow:none; }
131
+ .detail-eyebrow { text-transform:uppercase; letter-spacing:.045em; color:var(--mute); font-size:10px; overflow-wrap:anywhere; padding-right:80px; margin-bottom:22px; }
132
+ .detail-card .meta { gap:8px; font-size:11px; margin-bottom:14px; }
133
+ .detail-card .meta > .status { position:absolute; right:30px; top:27px; padding:4px 10px; border-radius:5px; background:var(--mist); color:var(--deep); }
134
+ .detail-card .meta .pill { font-size:11px; font-weight:500; border:0; background:none; padding:0; }
135
+ .detail-card .meta time { color:var(--mute); }
136
+ .detail-card .detail-title { font-size:25px; line-height:1.25; margin:0 0 20px; overflow-wrap:anywhere; }
137
+ .detail-card > .text, .detail-card > .md { padding:16px; background:var(--soft); border-radius:7px; font-size:15px; line-height:1.7; margin:0 0 18px; }
138
+ .detail-card > .ctx { font-size:12px; margin:8px 0; overflow-wrap:anywhere; }
139
+ .detail-card > .ctx a { overflow-wrap:anywhere; }
140
+ .detail-card > .dups { padding:8px 0 18px; color:var(--deep); }
141
+ .detail-card > .dups ul { color:var(--fg); line-height:1.7; }
142
+ .detail-card .dups li { margin:12px 0; }
143
+ .detail-card .trail { margin:20px 0 0; border-top:1px solid var(--line); padding-top:20px; }
144
+ .detail-card .trail summary { font-size:13px; font-weight:600; color:var(--fg); }
145
+ .detail-card .trail ol { margin:18px 0 20px 7px; }
146
+ .detail-card .trail li { padding:6px 0; gap:12px; }
147
+ .detail-card .trail li::before { top:12px; border-color:#c7ced6; width:6px; height:6px; left:-18px; }
148
+ .detail-card .trail .kind { font-size:9px; width:49px; }
149
+ .detail-card .trail .ago { font-size:10px; width:38px; }
150
+ .detail-card .trail .what { font-size:12px; }
151
+ .device-section { border-top:1px solid var(--line); padding:20px 0; margin-top:20px; }
152
+ .device-section h3 { margin-bottom:12px; }
153
+ .device-grid { display:grid; grid-template-columns:90px minmax(0,1fr) 90px minmax(0,1fr); gap:9px 12px; font-size:12px; margin:0; }
154
+ .device-grid dt { color:var(--mute); }
155
+ .device-grid dd { margin:0; overflow-wrap:anywhere; }
156
+ .device-section details { margin-top:16px; }
157
+ .device-section summary { color:var(--deep); font-size:12px; font-weight:600; cursor:pointer; }
158
+ .device-section details .device-grid { margin-top:15px; }
159
+ .detail-card > .actions { border-top:1px solid var(--line); margin-top:20px; padding-top:20px; gap:10px; }
160
+ .accept-note-label { flex:1 1 100%; font-size:11px; color:var(--mute); margin-bottom:4px; }
161
+ .accept-note-label textarea { display:block; width:100%; min-height:58px; margin-top:6px; font-size:13px; }
162
+ .accept-hint { flex:1 1 100%; color:var(--mute); font-size:11px; margin:2px 0 0; }
163
+ .actions > .err:empty { display:none; }
164
+ .detail-card .actions textarea { min-height:80px; }
165
+ .detail-card .actions .accept-note { min-height:58px; }
166
+ .detail-card .actions select { max-width:100%; font-size:12px; }
167
+ .detail-card .fix-line { padding:14px 0; }
168
+ .detail-card .brief-line { padding:14px; background:var(--mist); border-radius:6px; margin:18px 0; }
169
+ .detail-card > .notes, .detail-card > .chat-details { padding:14px 0; border-top:1px solid var(--line); }
170
+ .detail-card > .reason { margin:18px 0; }
171
+ @media (min-width:1600px) { .inbox-shell { grid-template-columns:480px minmax(0,1fr); } .detail-card { max-width:1000px; margin-inline:auto !important; } }
172
+ @media (max-width:1200px) {
173
+ :root { --sidebar:198px; }
174
+ .sidebar { padding-inline:10px; }
175
+ .sidebar .tabs a { font-size:13px; gap:10px; }
176
+ .inbox-shell { grid-template-columns:340px minmax(0,1fr); }
177
+ .report-preview { gap:9px; padding-inline:18px; grid-template-columns:20px minmax(0,1fr); }
178
+ .report-preview > .pill { grid-column:2; grid-row:2; justify-self:start; margin-top:2px; }
179
+ .device-grid { grid-template-columns:85px minmax(0,1fr); }
180
+ .report.detail-card { padding-inline:24px; }
181
+ .detail-card .meta > .status { right:24px; }
182
+ .status-tabs { padding-inline:12px; }
183
+ .status-tabs button { padding-inline:7px; font-size:11px; }
184
+ .status-tabs .n { font-size:9px; }
185
+ #view:not(.inbox-view) { padding-inline:30px; }
186
+ .workspace-role { display:none; }
187
+ }
188
+ @media (max-width:960px) {
189
+ :root { --sidebar:180px; }
190
+ .brand img { width:135px; }
191
+ .sidebar .tabs a { font-size:12px; gap:9px; }
192
+ .inbox-shell { grid-template-columns:minmax(0,1fr); }
193
+ .report-detail { display:none; }
194
+ .inbox-master { border:0; }
195
+ .inbox-view.detail-open .inbox-master { display:none; }
196
+ .inbox-view.detail-open .report-detail { display:block; }
197
+ .detail-back { display:inline-flex; margin:12px 20px 0; }
198
+ .report-preview { grid-template-columns:23px minmax(0,1fr) auto; }
199
+ .report-preview > .pill { grid-column:auto; grid-row:auto; }
200
+ .device-grid { grid-template-columns:85px minmax(0,1fr) 85px minmax(0,1fr); }
201
+ .inbox-controls select { max-width:none; }
202
+ .top-caption { display:none; }
203
+ }
204
+ @media (max-width:640px) {
205
+ :root { --sidebar:0px; }
206
+ .sidebar { transform:translateX(-100%); width:240px; transition:transform .18s ease; box-shadow:8px 0 32px rgb(21 23 28 / .1); }
207
+ .nav-open .sidebar { transform:translateX(0); }
208
+ .nav-open::after { content:""; position:fixed; inset:55px 0 0 240px; background:rgb(21 23 28 / .18); z-index:10; }
209
+ .workspace-top { padding:0 16px; justify-content:flex-start; }
210
+ #nav-toggle { display:inline-flex; font-size:18px; padding:3px 8px; margin-left:-8px; }
211
+ .sidebar .tabs a { font-size:14px; }
212
+ .sidebar .who { display:block; }
213
+ .sidebar .brand img { width:150px; }
214
+ .skip-link { left:16px; }
215
+ #view:not(.inbox-view) { padding:26px 20px 60px; }
216
+ #view.inbox-view { min-height:0; }
217
+ .inbox-heading { padding:24px 20px 0; }
218
+ .inbox-search { margin-inline:20px; }
219
+ .inbox-controls { padding-inline:20px; flex-wrap:wrap; }
220
+ .inbox-controls select { flex:1; }
221
+ .list-heading { padding-inline:20px; }
222
+ .status-tabs button { font-size:12px; padding-inline:8px; }
223
+ .report-preview { padding:18px 20px; }
224
+ .report-preview > .pill { max-width:74px; }
225
+ .preview-copy b { font-size:14px; }
226
+ .device-grid { grid-template-columns:85px minmax(0,1fr); }
227
+ .report.detail-card { padding:20px; }
228
+ .detail-card .meta > .status { top:20px; right:20px; }
229
+ .detail-card .detail-title { font-size:24px; }
230
+ .detail-card .meta { padding-right:0; }
231
+ .detail-card .trail li { gap:7px; }
232
+ .detail-card .trail .kind { width:42px; }
233
+ .detail-card .trail .ago { width:32px; }
234
+ .head { flex-wrap:wrap; }
235
+ .head .row { flex-wrap:wrap; }
236
+ .platforms { gap:10px; }
237
+ .platform { padding:16px; }
238
+ .card { padding:20px; }
239
+ .gate { margin:8vh 16px; padding:28px 24px; }
240
+ #update { padding:12px 20px; }
241
+ }
242
+ @media (prefers-reduced-motion:reduce) { .sidebar, .product-card, .report.detail-card { transition:none; } }
243
+ .nav-close, .nav-scrim { display:none; }
244
+ @media (max-width:640px) {
245
+ .sidebar { padding-top:28px; overflow-y:auto; }
246
+ .nav-close { display:inline-flex; position:absolute; right:8px; top:18px; font-size:23px; padding:2px 8px; }
247
+ .sidebar .brand { margin-right:26px; }
248
+ .nav-open::after { display:none; }
249
+ .nav-open .nav-scrim { display:block; position:fixed; inset:0 0 0 240px; background:rgb(21 23 28 / .18); border:0; z-index:11; cursor:pointer; }
250
+ }
251
+ .app-repo-status { flex-basis:100%; color:var(--mute); overflow-wrap:anywhere; }
252
+ .preview-copy b { font-size:15px; }
253
+ .preview-app { font-size:13px; }
254
+ .preview-meta { font-size:11px; }
255
+ .detail-card .detail-title { font-size:26px; }
256
+ .detail-card > .text, .detail-card > .md { font-size:16px; }
257
+ .detail-card .meta { font-size:12px; }
258
+ .toast { width:max-content; }
259
+ .toast button { white-space:nowrap; flex-shrink:0; }
260
+ .members li > div { min-width:0; overflow-wrap:anywhere; }
261
+ @media (max-width:640px) {
262
+ .btn { min-height:42px; }
263
+ .signout { min-height:32px; }
264
+ .status-tabs button { min-height:44px; }
265
+ .preview-copy b { font-size:14px; }
266
+ .detail-card .detail-title { font-size:24px; }
267
+ }
268
+ .detail-card > .reporter-context { display:flex; align-items:center; gap:10px; margin:18px 0; }
269
+ .reporter-context .avatar { flex:none; width:32px; height:32px; background:#edf0f4; color:#46505e; font-size:11px; }
270
+ .reporter-context > div { min-width:0; overflow-wrap:anywhere; }
271
+ .reporter-context a { margin-left:6px; }