create-heresay 0.2.33 → 0.2.35

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.33",
3
+ "version": "0.2.35",
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.33
1
+ 0.2.35
@@ -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.33';
2
+ export const VERSION = '0.2.35';
3
3
  //# sourceMappingURL=version.js.map
@@ -8,6 +8,7 @@
8
8
  <link rel="apple-touch-icon" href="/apple-touch-icon.png">
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
+ <script src="/theme.js"></script>
11
12
  <link rel="stylesheet" href="/dashboard.css">
12
13
  <link rel="stylesheet" href="/workspace.css">
13
14
  </head>
@@ -57,6 +58,7 @@
57
58
  <a href="#/notifications" data-nav="notifications"><span class="nav-icon" data-icon="bell"></span>Notifications</a>
58
59
  </nav>
59
60
  <div class="sidebar-bottom">
61
+ <button id="theme-toggle" class="theme-toggle" type="button">Theme<span class="theme-name"></span></button>
60
62
  <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
63
  <div class="account"><span id="account-avatar" class="avatar" aria-hidden="true">H</span><span id="who" class="who"></span></div>
62
64
  <button id="signout" class="btn ghost signout">Sign out</button>
@@ -1,5 +1,9 @@
1
1
  :root { --bg:#fff; --soft:#f5f6f7; --fg:#15171c; --mute:#5b6472; --line:#e3e6ea; --acc:#0f766e; --deep:#0b5e57; --mist:#e6f4f2;
2
2
  --broken:#b3261e; --confusing:#8a5100; --improvement:#2d5da8; --idea:#6b4fa8;
3
+ --edge:#cfd4da; --chip:#eceef1; --faint:#8b93a1; --ink:#15171c;
4
+ --t-broken:#fbeceb; --t-confusing:#fbf1e3; --t-improvement:#eaf0fa; --t-idea:#f1edf9;
5
+ --chat-bg:#eef2ff; --chat-fg:#3730a3; --agent-bg:#fef3c7; --agent-fg:#92400e; --sug-bg:#fff7ed; --sug-fg:#7c2d12; --ver-bg:#dcfce7; --ver-fg:#166534;
6
+ color-scheme:light;
3
7
  --head:"Bricolage Grotesque", system-ui, sans-serif; --mono:"JetBrains Mono", ui-monospace, monospace; }
4
8
  * { box-sizing:border-box; }
5
9
  body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.55 Figtree,system-ui,-apple-system,"Segoe UI",sans-serif; }
@@ -37,9 +41,9 @@ code { font:13px var(--mono); background:var(--mist); color:var(--deep); padding
37
41
  .head .title { display:flex; align-items:center; gap:12px; }
38
42
 
39
43
  /* controls */
40
- input, textarea, select { font:inherit; color:inherit; background:var(--bg); border:1px solid #cfd4da; border-radius:10px; padding:9px 12px; }
44
+ input, textarea, select { font:inherit; color:inherit; background:var(--bg); border:1px solid var(--edge); border-radius:10px; padding:9px 12px; }
41
45
  input:focus, textarea:focus, select:focus { outline:2px solid var(--acc); outline-offset:-1px; border-color:transparent; }
42
- .btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; font:inherit; font-weight:600; border:1px solid #cfd4da; background:var(--bg); color:var(--fg); border-radius:10px; padding:8px 14px; cursor:pointer; text-decoration:none; }
46
+ .btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; font:inherit; font-weight:600; border:1px solid var(--edge); background:var(--bg); color:var(--fg); border-radius:10px; padding:8px 14px; cursor:pointer; text-decoration:none; }
43
47
  .btn:hover { border-color:var(--mute); }
44
48
  .btn.primary { background:var(--acc); border-color:var(--acc); color:#fff; }
45
49
  .btn.primary:hover { background:var(--deep); }
@@ -99,8 +103,8 @@ input:focus, textarea:focus, select:focus { outline:2px solid var(--acc); outlin
99
103
  .platform .mute { font-size:13px; }
100
104
  a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
101
105
  .platform.soon { color:var(--mute); background:var(--soft); border-color:transparent; }
102
- .platform.soon .picon { background:#eceef1; }
103
- .platform.soon .picon svg { stroke:#8b93a1; }
106
+ .platform.soon .picon { background:var(--chip); }
107
+ .platform.soon .picon svg { stroke:var(--faint); }
104
108
  .tag { position:absolute; top:14px; right:14px; font-size:11px; font-weight:700; color:var(--mute); border:1px solid var(--line); background:var(--bg); border-radius:999px; padding:1px 8px; }
105
109
  .form { max-width:560px; margin-top:22px; }
106
110
  .form label, .form .field { display:block; margin-top:18px; font-weight:600; }
@@ -113,13 +117,13 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
113
117
  .where-item { margin-top:14px; }
114
118
  .where-item p { margin:2px 0 0; font-size:14px; color:var(--mute); }
115
119
  .chips { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
116
- .chips button { font:inherit; font-weight:500; border:1px solid #cfd4da; background:var(--bg); color:var(--fg); border-radius:999px; padding:5px 13px; cursor:pointer; }
120
+ .chips button { font:inherit; font-weight:500; border:1px solid var(--edge); background:var(--bg); color:var(--fg); border-radius:999px; padding:5px 13px; cursor:pointer; }
117
121
  .chips button[aria-checked=true] { background:var(--mist); border-color:var(--acc); color:var(--deep); font-weight:600; }
118
122
  .seg { display:inline-flex; background:var(--soft); border-radius:12px; padding:4px; margin-bottom:12px; }
119
123
  .seg button { font:inherit; font-weight:600; border:0; background:none; color:var(--mute); padding:7px 14px; border-radius:9px; cursor:pointer; }
120
124
  .seg button[aria-selected=true] { background:var(--bg); color:var(--fg); box-shadow:0 1px 2px rgb(21 23 28 / .12); }
121
125
  .code { position:relative; }
122
- .code pre { background:var(--fg); color:#e8ecf1; border-radius:12px; padding:16px 18px; padding-right:90px; font:13px/1.65 var(--mono); overflow:auto; white-space:pre-wrap; word-break:break-word; margin:8px 0 0; }
126
+ .code pre { background:var(--ink); color:#e8ecf1; border-radius:12px; padding:16px 18px; padding-right:90px; font:13px/1.65 var(--mono); overflow:auto; white-space:pre-wrap; word-break:break-word; margin:8px 0 0; }
123
127
  .code .btn { position:absolute; top:10px; right:10px; padding:4px 10px; font-size:13px; background:#2a2e36; color:#fff; border-color:#3a3f48; }
124
128
  .soon-note { margin-top:18px; padding:12px 14px; background:var(--soft); border-radius:12px; font-size:14px; color:var(--mute); }
125
129
  .soon-note b { color:var(--fg); }
@@ -156,7 +160,7 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
156
160
  .report { --strip:var(--line); box-shadow:inset 3px 0 0 var(--strip); }
157
161
  .report.t-broken { --strip:var(--broken); } .report.t-confusing { --strip:var(--confusing); }
158
162
  .report.t-improvement { --strip:var(--improvement); } .report.t-idea { --strip:var(--idea); }
159
- .report:hover { border-color:#cfd4da; box-shadow:inset 3px 0 0 var(--strip), 0 1px 3px rgb(21 23 28 / .06); }
163
+ .report:hover { border-color:var(--edge); box-shadow:inset 3px 0 0 var(--strip), 0 1px 3px rgb(21 23 28 / .06); }
160
164
  .report.working { background:var(--soft); }
161
165
  .report.settled { border-color:var(--acc); background:var(--mist); box-shadow:inset 3px 0 0 var(--strip), 0 0 0 3px var(--mist); }
162
166
  .report.leaving { opacity:0; margin-bottom:0; padding-top:0; padding-bottom:0; border-width:0; }
@@ -165,8 +169,8 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
165
169
  .report .pill:first-child { padding:1px 9px; border-radius:999px; background:var(--soft); }
166
170
  .pill.broken { color:var(--broken); } .pill.confusing { color:var(--confusing); }
167
171
  .pill.improvement { color:var(--improvement); } .pill.idea { color:var(--idea); }
168
- .report .pill.broken { background:#fbeceb; } .report .pill.confusing { background:#fbf1e3; }
169
- .report .pill.improvement { background:#eaf0fa; } .report .pill.idea { background:#f1edf9; }
172
+ .report .pill.broken { background:var(--t-broken); } .report .pill.confusing { background:var(--t-confusing); }
173
+ .report .pill.improvement { background:var(--t-improvement); } .report .pill.idea { background:var(--t-idea); }
170
174
  .status { margin-left:auto; font-weight:600; font-size:12px; padding:1px 9px; border-radius:999px; background:var(--soft); transition:background-color .3s, color .3s; }
171
175
  .s-open { color:var(--fg); }
172
176
  .s-accepted { color:var(--deep); }
@@ -191,7 +195,7 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
191
195
 
192
196
  /* toast */
193
197
  .toast { position:fixed; left:50%; bottom:24px; z-index:10; display:flex; align-items:center; gap:12px; max-width:calc(100vw - 32px);
194
- padding:10px 12px 10px 14px; border-radius:12px; background:var(--fg); color:#fff; font-size:14px; font-weight:500;
198
+ padding:10px 12px 10px 14px; border-radius:12px; background:var(--ink); color:#fff; font-size:14px; font-weight:500;
195
199
  box-shadow:0 10px 30px rgb(21 23 28 / .25); transform:translate(-50%, 16px); opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; }
196
200
  .toast.on { opacity:1; transform:translate(-50%, 0); pointer-events:auto; }
197
201
  .toast button { font:inherit; font-weight:700; color:#7dd3c8; background:none; border:0; padding:4px 6px; border-radius:6px; cursor:pointer; }
@@ -243,7 +247,7 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
243
247
  .trail .k-page::before, .trail .k-sent::before { border-color:var(--acc); }
244
248
  .trail .k-sent::before { background:var(--acc); }
245
249
  .trail .k-page .kind, .trail .k-sent .kind { color:var(--deep); }
246
- .trail .k-error::before, .trail .k-request::before { border-color:var(--broken); background:#fbeceb; }
250
+ .trail .k-error::before, .trail .k-request::before { border-color:var(--broken); background:var(--t-broken); }
247
251
  .trail .k-error .kind, .trail .k-request .kind, .trail .k-error .what > span, .trail .k-request .what > span { color:var(--broken); }
248
252
  .trail .k-warn::before { border-color:var(--confusing); }
249
253
  .trail .k-warn .kind { color:var(--confusing); }
@@ -322,7 +326,7 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
322
326
  .design-side { position:sticky; top:76px; display:flex; flex-direction:column; gap:10px; }
323
327
  .design-toolbar { margin-top:0; justify-content:space-between; }
324
328
  .design-toolbar .seg { margin:0; }
325
- .design-frame { width:100%; height:calc(100vh - 260px); min-height:480px; max-height:720px; border:1px solid var(--line); border-radius:14px; background:#fff; }
329
+ .design-frame { width:100%; height:calc(100vh - 260px); min-height:480px; max-height:720px; border:1px solid var(--line); border-radius:14px; background:#fff; color-scheme:light; }
326
330
  .design-side .row { margin-top:0; }
327
331
  .design-side .code pre { max-height:220px; }
328
332
  @media (max-width:960px) { .design { grid-template-columns:1fr; } .design-side { position:static; } }
@@ -437,7 +441,7 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
437
441
  }
438
442
 
439
443
  /* chat apps */
440
- .pill.chat-pill { background:#eef2ff; color:#3730a3; }
444
+ .pill.chat-pill { background:var(--chat-bg); color:var(--chat-fg); }
441
445
  .chat-details { margin-top:8px; font-size:14px; }
442
446
  .chat-details summary { cursor:pointer; color:var(--mute); font-size:13px; }
443
447
  .chat-details > .md { margin:6px 0 0; padding:10px 14px; border-radius:10px; background:var(--soft, #f5f6f7); }
@@ -469,7 +473,7 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
469
473
  .authorize .can { margin:6px 0 12px; padding-left:20px; line-height:1.6; }
470
474
 
471
475
  /* findings from agents */
472
- .pill.agent-pill { background:#fef3c7; color:#92400e; }
476
+ .pill.agent-pill { background:var(--agent-bg); color:var(--agent-fg); }
473
477
  .report .files { margin:4px 0 0; padding:0; list-style:none; display:flex; flex-wrap:wrap; gap:6px; font-size:12.5px; }
474
478
  .report .files a, .report .files code { font:12.5px var(--mono, ui-monospace, monospace); padding:2px 6px; border-radius:6px; background:rgba(127,127,127,.12); color:inherit; }
475
479
 
@@ -483,7 +487,7 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
483
487
  .report .dups ul { margin:6px 0 0; padding-left:18px; }
484
488
  .report .dups li { margin:3px 0; }
485
489
  .report .dups li .link { margin-left:6px; }
486
- .report .suggest { margin-top:8px; padding:8px 10px; border-radius:8px; background:#fff7ed; color:#7c2d12; font-size:13px; }
490
+ .report .suggest { margin-top:8px; padding:8px 10px; border-radius:8px; background:var(--sug-bg); color:var(--sug-fg); font-size:13px; }
487
491
  .report .dups .link, .report .suggest .link { border:0; background:none; padding:0; font:inherit; color:var(--deep, #0b5e57); text-decoration:underline; cursor:pointer; }
488
492
 
489
493
  /* fixes: PR, commit, version */
@@ -491,7 +495,7 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
491
495
  .report .fix-line code { font:12px var(--mono, ui-monospace, monospace); padding:1px 6px; border-radius:5px; background:rgba(127,127,127,.12); }
492
496
  .report .fix-line input { max-width:140px; }
493
497
  .report .fix-line .link { border:0; background:none; padding:0; font:inherit; color:var(--deep, #0b5e57); text-decoration:underline; cursor:pointer; }
494
- .pill.version-pill { background:#dcfce7; color:#166534; }
498
+ .pill.version-pill { background:var(--ver-bg); color:var(--ver-fg); }
495
499
  .fix-ref input { flex:1; min-width:160px; }
496
500
 
497
501
  .status.s-withdrawn { background:rgba(127,127,127,.14); color:var(--mute); }
@@ -127,14 +127,15 @@
127
127
 
128
128
  /** One message at a time, bottom of the screen, with an optional action. Read out by screen readers. */
129
129
  var toastBox = null, toastTimer = null;
130
- function toast(text, action) {
130
+ /** `failed`: something didn't work, so no tick. */
131
+ function toast(text, action, failed) {
131
132
  if (!toastBox) {
132
133
  toastBox = el('div', { class: 'toast', role: 'status', 'aria-live': 'polite' });
133
134
  document.body.appendChild(toastBox);
134
135
  }
135
136
  clearTimeout(toastTimer);
136
137
  toastBox.textContent = '';
137
- toastBox.appendChild(el('span', { class: 'toast-tick', 'aria-hidden': 'true' }));
138
+ if (!failed) toastBox.appendChild(el('span', { class: 'toast-tick', 'aria-hidden': 'true' }));
138
139
  toastBox.appendChild(el('span', { text: text }));
139
140
  if (action) toastBox.appendChild(el('button', { type: 'button', text: action.label, onclick: function () { hideToast(); action.run(); } }));
140
141
  toastBox.classList.add('on');
@@ -1479,7 +1480,7 @@
1479
1480
  loaded = true; drawProducts(); render(background === true);
1480
1481
  }).catch(function (x) {
1481
1482
  if (!shell.isConnected) return;
1482
- if (loaded) { toast('Could not refresh reports. ' + x.message); return; }
1483
+ if (loaded) { toast('Could not refresh reports. ' + x.message, null, true); return; }
1483
1484
  list.textContent = ''; detail.textContent = '';
1484
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 })]));
1485
1486
  });
@@ -1701,7 +1702,7 @@
1701
1702
  el('span', { class: 'mute', text: ' · ' + TYPE_LABEL[d.type] + (showPlatform ? ' · ' + platformOf(dp.platform).label : '') + ' · ' + new Date(d.created_at).toLocaleDateString() }),
1702
1703
  d.status === 'open' ? el('button', { class: 'link', type: 'button', text: 'Unmerge', onclick: function () {
1703
1704
  api('POST', '/projects/' + d.project_id + '/reports/' + d.id + '/unmerge').then(function () { toast('Unmerged.'); ctx.reload(); })
1704
- .catch(function (x) { toast(x.message); });
1705
+ .catch(function (x) { toast(x.message, null, true); });
1705
1706
  } }) : null,
1706
1707
  ]);
1707
1708
  })),
@@ -1763,7 +1764,7 @@
1763
1764
  var save = el('button', { class: 'btn primary', type: 'button', text: 'Save', onclick: function () {
1764
1765
  api('POST', '/projects/' + r.project_id + '/reports/' + r.id + '/fix-ref', { version: v.value.trim() })
1765
1766
  .then(function (b) { f = b.report.fix_ref || f; draw(); toast('They’ll see “Fixed in ' + f.version + '”.'); })
1766
- .catch(function (x) { toast(x.message); });
1767
+ .catch(function (x) { toast(x.message, null, true); });
1767
1768
  } });
1768
1769
  submitOnCmdEnter(v, save);
1769
1770
  line.appendChild(v); line.appendChild(save);
@@ -2309,19 +2310,19 @@
2309
2310
  }
2310
2311
 
2311
2312
  /** Inline Markdown into `node`, as text nodes and elements. Returns `node`. */
2312
- function inline(node, s) {
2313
+ function inline(node, s, insideLink) {
2313
2314
  var re = /(`+)([\s\S]*?)\1|\*\*([^*]+?)\*\*|__([^_]+?)__|~~([^~]+?)~~|\*([^*\s][^*]*?)\*|(^|[^\w])_([^_\s][^_]*?)_(?=[^\w]|$)|\[([^\]]+)\]\(([^)\s]+)\)|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])/g;
2314
2315
  var at = 0, m;
2315
2316
  while ((m = re.exec(s))) {
2316
2317
  var start = m.index + (m[7] !== undefined ? m[7].length : 0);
2317
2318
  if (start > at) node.appendChild(document.createTextNode(s.slice(at, start)));
2318
2319
  if (m[1]) node.appendChild(el('code', { text: m[2] }));
2319
- else if (m[3] || m[4]) node.appendChild(inline(el('strong'), m[3] || m[4]));
2320
- else if (m[5]) node.appendChild(inline(el('del'), m[5]));
2321
- else if (m[6]) node.appendChild(inline(el('em'), m[6]));
2322
- else if (m[8]) node.appendChild(inline(el('em'), m[8]));
2323
- else if (m[9]) node.appendChild(link(m[10], m[9]));
2324
- else if (m[11]) node.appendChild(link(m[11], m[11]));
2320
+ else if (m[3] || m[4]) node.appendChild(inline(el('strong'), m[3] || m[4], insideLink));
2321
+ else if (m[5]) node.appendChild(inline(el('del'), m[5], insideLink));
2322
+ else if (m[6]) node.appendChild(inline(el('em'), m[6], insideLink));
2323
+ else if (m[8]) node.appendChild(inline(el('em'), m[8], insideLink));
2324
+ else if (m[9]) node.appendChild(insideLink ? document.createTextNode(m[9]) : link(m[10], m[9]));
2325
+ else if (m[11]) node.appendChild(insideLink ? document.createTextNode(m[11]) : link(m[11], m[11]));
2325
2326
  at = re.lastIndex;
2326
2327
  }
2327
2328
  if (at < s.length) node.appendChild(document.createTextNode(s.slice(at)));
@@ -2332,7 +2333,8 @@
2332
2333
  function link(href, label) {
2333
2334
  var ok = /^(https?:\/\/|mailto:)/i.test(href);
2334
2335
  if (!ok) return document.createTextNode(label === href ? href : label + ' (' + href + ')');
2335
- return inline(el('a', { href: href, target: '_blank', rel: 'noopener noreferrer nofollow' }), label);
2336
+ // Link labels may contain formatting, but must never create another link.
2337
+ return inline(el('a', { href: href, target: '_blank', rel: 'noopener noreferrer nofollow' }), label, true);
2336
2338
  }
2337
2339
 
2338
2340
  // ---- 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,18 @@
1
+ /* Theme: follows the device by default; the sidebar button cycles Auto, Light, Dark. */
2
+ (function () {
3
+ var root = document.documentElement, KEY = 'heresay-theme', order = ['auto', 'light', 'dark'];
4
+ function get() { try { return localStorage.getItem(KEY) || 'auto'; } catch (e) { return 'auto'; } }
5
+ function apply(t) { if (t === 'auto') root.removeAttribute('data-theme'); else root.setAttribute('data-theme', t); }
6
+ apply(get());
7
+ document.addEventListener('DOMContentLoaded', function () {
8
+ var b = document.getElementById('theme-toggle');
9
+ if (!b) return;
10
+ function label() { var t = get(); b.querySelector('.theme-name').textContent = t === 'auto' ? 'Auto' : t === 'dark' ? 'Dark' : 'Light'; b.title = 'Theme: ' + t + ' (click to change)'; }
11
+ b.addEventListener('click', function () {
12
+ var t = order[(order.indexOf(get()) + 1) % order.length];
13
+ try { localStorage.setItem(KEY, t); } catch (e) {}
14
+ apply(t); label();
15
+ });
16
+ label();
17
+ });
18
+ })();
@@ -1,13 +1,13 @@
1
1
  /* Heresay workspace. Brand: Deep Peacock, Figtree, Bricolage Grotesque, JetBrains Mono. */
2
- :root { --sidebar:224px; --soft:#f6f7f8; --mute:#626c7a; --line:#e5e8ec; }
2
+ :root { --sidebar:224px; --soft:#f6f7f8; --mute:#626c7a; --line:#e5e8ec; --side:#f7f8f9; --navfg:#46505e; --hover:#edf0f2; --navcount:#d3eae6; --crumb:#acb3bc; --cardhover:#b8c5c3; --rowhover:#f7f9fa; --rowsel:#edf6f4; --dot:#c7ced6; --avatar:#edf0f4; --edge:#cfd5dc; --ph:#737e8c; }
3
3
  body { font-size:14px; }
4
4
  button, input, select, textarea { font-family:inherit; }
5
5
  button, a, input, select, textarea, summary { -webkit-tap-highlight-color:transparent; }
6
6
  button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline:2px solid var(--acc); outline-offset:3px; }
7
7
  button:disabled { opacity:.55; cursor:not-allowed; }
8
8
  input, textarea, select, .btn { border-radius:7px; }
9
- input, textarea, select { border-color:#cfd5dc; }
10
- input::placeholder, textarea::placeholder { color:#737e8c; opacity:1; }
9
+ input, textarea, select { border-color:var(--edge); }
10
+ input::placeholder, textarea::placeholder { color:var(--ph); opacity:1; }
11
11
  textarea { resize:vertical; }
12
12
  .btn { font-size:13px; min-height:36px; padding:7px 13px; }
13
13
  .btn.primary { background:var(--acc); }
@@ -22,31 +22,34 @@ h3 { font-size:15px; margin:0 0 14px; font-weight:700; }
22
22
  .code pre { border-radius:8px; }
23
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
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; }
25
+ .sidebar { width:var(--sidebar); position:fixed; inset:0 auto 0 0; display:flex; flex-direction:column; z-index:12; background:var(--side); border-right:1px solid var(--line); padding:28px 14px 14px; }
26
26
  .brand { display:block; margin:0 12px 26px; }
27
27
  .brand img { display:block; width:150px; height:auto; }
28
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
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
30
  .workspace-role { color:var(--mute); margin-left:auto; font-size:10px; }
31
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); }
32
+ .sidebar .tabs a { display:flex; align-items:center; gap:12px; min-height:42px; color:var(--navfg); font-size:14px; font-weight:500; text-decoration:none; padding:10px 12px; border-radius:6px; position:relative; }
33
+ .sidebar .tabs a:hover { background:var(--hover); color:var(--fg); }
34
34
  .sidebar .tabs a[aria-current=page] { color:var(--deep); background:var(--mist); font-weight:700; }
35
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
36
  .nav-icon { flex:none; width:19px; height:19px; display:inline-flex; }
37
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; }
38
+ .nav-count { margin-left:auto; min-width:23px; padding:0 5px; border-radius:4px; background:var(--navcount); text-align:center; font-size:12px; }
39
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
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; }
41
+ .theme-toggle { display:flex; align-items:center; justify-content:space-between; width:100%; padding:12px 10px; border:0; border-top:1px solid var(--line); border-radius:0; background:none; color:var(--navfg); font-size:13px; cursor:pointer; }
42
+ .theme-toggle .theme-name { color:var(--mute); }
43
+ .theme-toggle:hover { color:var(--fg); }
44
+ .help-link { display:flex; align-items:center; gap:12px; padding:16px 10px; border-top:1px solid var(--line); color:var(--navfg); text-decoration:none; font-size:13px; }
42
45
  .help-link > span:last-child { margin-left:auto; }
43
46
  .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; }
47
+ .account .avatar { width:30px; height:30px; flex:none; background:var(--deep); color:var(--bg); font-size:11px; }
45
48
  .account .who { display:block; overflow:hidden; text-overflow:ellipsis; color:var(--fg); font-size:12px; white-space:nowrap; }
46
49
  .signout { margin:4px 0 0 49px; padding:2px 0; min-height:28px; font-size:11px; }
47
50
  .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
51
  .breadcrumb { display:flex; gap:12px; align-items:center; font-size:12px; color:var(--mute); }
49
- .breadcrumb > span:first-child { color:#acb3bc; }
52
+ .breadcrumb > span:first-child { color:var(--crumb); }
50
53
  #page-label { color:var(--fg); }
51
54
  .top-caption { color:var(--mute); font-size:11px; }
52
55
  #nav-toggle { display:none; }
@@ -56,7 +59,7 @@ h3 { font-size:15px; margin:0 0 14px; font-weight:700; }
56
59
  #view:not(.inbox-view) > .head, #view:not(.inbox-view) > h1 { margin-top:0; }
57
60
  .apps { gap:18px; margin-top:24px; }
58
61
  .product-card { background:var(--bg); transition:border-color .15s; }
59
- .product-card:hover { border-color:#b8c5c3; }
62
+ .product-card:hover { border-color:var(--cardhover); }
60
63
  .picon { width:38px; height:38px; border-radius:8px; }
61
64
  .platform { padding:24px; }
62
65
  .hello { margin-top:12vh; }
@@ -97,8 +100,8 @@ h3 { font-size:15px; margin:0 0 14px; font-weight:700; }
97
100
  .list-heading b { font-size:13px; }
98
101
  .list-heading > span { font-size:10px; color:var(--mute); }
99
102
  .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; }
103
+ .report-preview:hover { background:var(--rowhover); }
104
+ .report-preview[aria-current=true] { background:var(--rowsel); }
102
105
  .report-preview[aria-current=true]::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--acc); }
103
106
  .report-preview.t-broken { --type:var(--broken); }
104
107
  .report-preview.t-confusing { --type:var(--confusing); }
@@ -110,10 +113,10 @@ h3 { font-size:15px; margin:0 0 14px; font-weight:700; }
110
113
  .preview-app { display:block; color:var(--mute); font-size:12px; margin-top:5px; }
111
114
  .preview-meta { display:block; color:var(--mute); font-size:10px; margin-top:9px; }
112
115
  .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; }
116
+ .report-preview > .broken { background:var(--t-broken); }
117
+ .report-preview > .confusing { background:var(--t-confusing); }
118
+ .report-preview > .improvement { background:var(--t-improvement); max-width:82px; text-align:center; }
119
+ .report-preview > .idea { background:var(--t-idea); }
117
120
  .report-preview.settled { opacity:.55; }
118
121
  .inbox-empty { text-align:center; padding:56px 28px; color:var(--mute); }
119
122
  .inbox-empty img { margin-bottom:16px; }
@@ -144,7 +147,7 @@ h3 { font-size:15px; margin:0 0 14px; font-weight:700; }
144
147
  .detail-card .trail summary { font-size:13px; font-weight:600; color:var(--fg); }
145
148
  .detail-card .trail ol { margin:18px 0 20px 7px; }
146
149
  .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; }
150
+ .detail-card .trail li::before { top:12px; border-color:var(--dot); width:6px; height:6px; left:-18px; }
148
151
  .detail-card .trail .kind { font-size:9px; width:49px; }
149
152
  .detail-card .trail .ago { font-size:10px; width:38px; }
150
153
  .detail-card .trail .what { font-size:12px; }
@@ -266,6 +269,27 @@ h3 { font-size:15px; margin:0 0 14px; font-weight:700; }
266
269
  .detail-card .detail-title { font-size:24px; }
267
270
  }
268
271
  .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; }
272
+ .reporter-context .avatar { flex:none; width:32px; height:32px; background:var(--avatar); color:var(--navfg); font-size:11px; }
270
273
  .reporter-context > div { min-width:0; overflow-wrap:anywhere; }
271
274
  .reporter-context a { margin-left:6px; }
275
+
276
+ /* dark mode: follows the system, or data-theme on <html> */
277
+ @media (prefers-color-scheme:dark) {
278
+ :root:not([data-theme=light]) { color-scheme:dark;
279
+ --bg:#14171b; --soft:#1b1f24; --fg:#e8ebef; --mute:#9aa4b2; --line:#2a3037; --acc:#2dd4bf; --deep:#5eead4; --mist:#173532;
280
+ --broken:#f4877f; --confusing:#e2a24a; --improvement:#7fa6e6; --idea:#b59bea;
281
+ --edge:#3a424b; --chip:#242a31; --faint:#6f7a88; --ink:#0c0e11;
282
+ --t-broken:#3a1f1e; --t-confusing:#382915; --t-improvement:#1c2a42; --t-idea:#2b2340;
283
+ --chat-bg:#232850; --chat-fg:#c7d0ff; --agent-bg:#3d3010; --agent-fg:#fcd98a; --sug-bg:#33241a; --sug-fg:#fdba8c; --ver-bg:#14351f; --ver-fg:#86e0a4;
284
+ --side:#101316; --navfg:#aeb7c3; --hover:#1d2227; --navcount:#1f4a45; --crumb:#6f7a88; --cardhover:#3f5a57; --rowhover:#191d22; --rowsel:#173532; --dot:#3a424b; --avatar:#262c33; --ph:#7d8896; }
285
+ .btn.primary, .btn.danger, .steps .now span, .stepnum, .status.s-fixed { color:#06201c; }
286
+ .btn.danger { color:#1a0705; }
287
+ }
288
+ :root[data-theme=dark] { color-scheme:dark;
289
+ --bg:#14171b; --soft:#1b1f24; --fg:#e8ebef; --mute:#9aa4b2; --line:#2a3037; --acc:#2dd4bf; --deep:#5eead4; --mist:#173532;
290
+ --broken:#f4877f; --confusing:#e2a24a; --improvement:#7fa6e6; --idea:#b59bea;
291
+ --edge:#3a424b; --chip:#242a31; --faint:#6f7a88; --ink:#0c0e11;
292
+ --t-broken:#3a1f1e; --t-confusing:#382915; --t-improvement:#1c2a42; --t-idea:#2b2340;
293
+ --chat-bg:#232850; --chat-fg:#c7d0ff; --agent-bg:#3d3010; --agent-fg:#fcd98a; --sug-bg:#33241a; --sug-fg:#fdba8c; --ver-bg:#14351f; --ver-fg:#86e0a4;
294
+ --side:#101316; --navfg:#aeb7c3; --hover:#1d2227; --navcount:#1f4a45; --crumb:#6f7a88; --cardhover:#3f5a57; --rowhover:#191d22; --rowsel:#173532; --dot:#3a424b; --avatar:#262c33; --ph:#7d8896; }}
295
+ :root[data-theme=dark] .btn.primary, :root[data-theme=dark] .btn.danger, :root[data-theme=dark] .steps .now span, :root[data-theme=dark] .stepnum, :root[data-theme=dark] .status.s-fixed { color:#06201c; }
package/src/cli.mjs CHANGED
@@ -17,7 +17,7 @@ import * as state from './state.mjs';
17
17
  import * as steps from './steps.mjs';
18
18
 
19
19
  const peacock = (s) => `\x1b[38;2;15;118;110m${s}\x1b[39m`;
20
- const url = (id) => `https://${id}.web.app`;
20
+ const url = (id) => `https://${process.env.HERESAY_SITE || id}.web.app`;
21
21
 
22
22
  // ---- arguments --------------------------------------------------------------------------
23
23
 
package/src/steps.mjs CHANGED
@@ -127,6 +127,9 @@ export async function database(ctx, say) {
127
127
  return ctx.region;
128
128
  }
129
129
 
130
+ /** The hosting site id: the project id unless HERESAY_SITE names another site in the project. */
131
+ export const siteOf = (ctx) => process.env.HERESAY_SITE || ctx.id;
132
+
130
133
  // ---- the release, laid out for `firebase deploy` ----------------------------------------
131
134
 
132
135
  /** Copy the bundled release into ~/.heresay/instances/<id>/ and write its config. */
@@ -143,6 +146,7 @@ export function prepareRelease(ctx) {
143
146
  const cfg = JSON.parse(readFileSync(join(RELEASE, 'firebase.json'), 'utf8'));
144
147
  delete cfg.emulators;
145
148
  for (const fn of cfg.functions) delete fn.predeploy;
149
+ if (siteOf(ctx) !== ctx.id) cfg.hosting.site = siteOf(ctx);
146
150
  for (const r of cfg.hosting.rewrites) if (r.function) r.function.region = ctx.region;
147
151
  writeFileSync(join(dir, 'firebase.json'), JSON.stringify(cfg, null, 2) + '\n');
148
152
  writeFileSync(join(dir, '.firebaserc'), JSON.stringify({ projects: { default: ctx.id } }, null, 2) + '\n');
@@ -189,7 +193,7 @@ export async function signIn(ctx, say) {
189
193
  // Google requires the signed-in account (or a group it manages) here.
190
194
  customerSupportEmail: ctx.account ?? ctx.owner,
191
195
  // The firebaseapp.com handler is added by Google itself; listing it again is an error.
192
- oauthRedirectUris: [`https://${ctx.id}.web.app/__/auth/handler`],
196
+ oauthRedirectUris: [`https://${siteOf(ctx)}.web.app/__/auth/handler`],
193
197
  },
194
198
  },
195
199
  },
@@ -280,7 +284,7 @@ export async function deploy(ctx, say) {
280
284
  // ---- 8. verify --------------------------------------------------------------------------
281
285
 
282
286
  export async function verify(ctx, say) {
283
- const base = `https://${ctx.id}.web.app`;
287
+ const base = `https://${siteOf(ctx)}.web.app`;
284
288
  say('Calling the API');
285
289
  const until = Date.now() + 3 * 60_000;
286
290
  for (;;) {