create-heresay 0.2.6 → 0.2.8

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.6",
3
+ "version": "0.2.8",
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.6
1
+ 0.2.8
@@ -283,6 +283,7 @@ export async function agent(p, req, deps, body, prompt, createProject, toReporte
283
283
  }
284
284
  const appView = (p) => ({
285
285
  id: p.id, name: p.name, platform: p.platform, framework: p.framework, sign_in: p.sign_in ?? null,
286
+ product_id: p.product_id ?? p.id,
286
287
  framework_detected: !!p.framework_detected, key: p.key, allowed_origins: p.allowed_origins,
287
288
  });
288
289
  //# sourceMappingURL=agent.js.map
@@ -403,9 +403,19 @@ async function createProject(me, req, deps) {
403
403
  }
404
404
  if (body.sign_in != null && !isSignIn(body.sign_in))
405
405
  return json(400, { error: 'sign_in must be yes, no or null' });
406
+ // Another platform of an existing product: it has to be one.
407
+ let product_id = null;
408
+ if (body.product_id != null) {
409
+ const want = str(body.product_id, 40);
410
+ const all = await deps.store.listProjects();
411
+ if (!want || !all.some((x) => (x.product_id ?? x.id) === want))
412
+ return json(400, { error: 'no such product to add a platform to' });
413
+ product_id = want;
414
+ }
406
415
  const project = {
407
416
  id: newId('p_', 9), name, platform, framework: framework ? framework.toLowerCase() : null,
408
417
  sign_in: isSignIn(body.sign_in) ? body.sign_in : null,
418
+ product_id,
409
419
  key: newId('pk_', 18), allowed_origins: [...new Set(origins)], created_by: me.email,
410
420
  created_at: new Date(deps.now()).toISOString(),
411
421
  };
@@ -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.6';
2
+ export const VERSION = '0.2.8';
3
3
  //# sourceMappingURL=version.js.map
@@ -65,6 +65,22 @@ input:focus, textarea:focus, select:focus { outline:2px solid var(--acc); outlin
65
65
  .app-card .mute { font-size:13px; }
66
66
  .app-card .count { grid-column:1 / -1; margin-top:10px; font-size:13px; color:var(--mute); }
67
67
  .app-card .count.on { color:var(--deep); font-weight:700; }
68
+ .product-card { display:flex; flex-direction:column; border:1px solid var(--line); border-radius:16px; overflow:hidden; }
69
+ .product-card .app-card { border:0; border-radius:0; }
70
+ .product-card .app-card:hover { background:var(--soft); }
71
+ .product-card.single .app-card { padding-bottom:10px; }
72
+ .product-head { display:flex; justify-content:space-between; align-items:baseline; gap:10px; padding:16px 18px 6px; }
73
+ .product-head b { font-size:17px; }
74
+ .platform-line { padding:12px 18px; border-top:1px solid var(--line) !important; grid-template-columns:auto 1fr auto; }
75
+ .platform-line .count { grid-column:auto; margin:0; }
76
+ .add-platform { font-size:13px; font-weight:600; text-decoration:none; }
77
+ .product-card.single .add-platform { padding:0 18px 14px; }
78
+ .add-platform:hover { text-decoration:underline; }
79
+ .platform.added { color:var(--mute); background:var(--soft); border-color:transparent; }
80
+ .pill.platform-pill { color:var(--mute); border:1px solid var(--line); border-radius:999px; padding:0 8px; font-weight:600; }
81
+ .product-platforms .repos-line { margin:0 0 6px; }
82
+ .product-platforms { margin:-10px 0 18px; }
83
+ .platforms-filter { margin-bottom:8px; }
68
84
  .picon { width:40px; height:40px; border-radius:12px; background:var(--mist); display:inline-flex; align-items:center; justify-content:center; flex:none; }
69
85
  .picon svg { width:22px; height:22px; fill:none; stroke:var(--deep); stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
70
86
 
@@ -193,6 +193,14 @@
193
193
  icon: '<path d="M14 3 5 12l3 3L20 3zM14 12l-5 5 5 5h6l-5-5 5-5z"/>' },
194
194
  ];
195
195
  var platformOf = function (id) { return PLATFORMS.filter(function (x) { return x.id === id; })[0] || PLATFORMS[0]; };
196
+ /** Apps that are platforms of one product share its id: the first app's. */
197
+ var productOf = function (p) { return p.product_id || p.id; };
198
+ var siblings = function (p) {
199
+ var mine = projects.filter(function (x) { return productOf(x) === productOf(p); });
200
+ if (!mine.some(function (x) { return x.id === p.id; })) mine.push(p);
201
+ return mine.sort(function (a, b) { return a.created_at.localeCompare(b.created_at); });
202
+ };
203
+ var productName = function (p) { return siblings(p)[0].name; };
196
204
  var icon = function (p) { return el('span', { class: 'picon', html: '<svg viewBox="0 0 24 24" aria-hidden="true">' + p.icon + '</svg>' }); };
197
205
 
198
206
  function appsView(view) {
@@ -211,21 +219,34 @@
211
219
  el('a', { class: 'btn primary', href: '#/new', text: 'Add an app' }),
212
220
  ]));
213
221
  var grid = el('div', { class: 'apps' });
214
- projects.forEach(function (p) {
215
- var count = el('span', { class: 'count', text: ' ' });
216
- var card = el('a', { class: 'app-card', href: '#/apps/' + p.id }, [
217
- icon(platformOf(p.platform)),
218
- el('div', {}, [el('b', { text: p.name }), el('span', { class: 'mute', text: platformOf(p.platform).label + (p.framework ? ' · ' + frameworkLabel(p.framework) : '') })]),
219
- count,
220
- ]);
221
- grid.appendChild(card);
222
- api('GET', '/projects/' + p.id + '/reports').then(function (r) {
223
- var open = r.reports.filter(function (x) { return x.status === 'open'; }).length;
224
- // No report yet means setup isn't proven: send them back to finish it.
225
- if (!r.reports.length && !p.sdk_seen && !p.code_found) { card.href = '#/apps/' + p.id + '/setup'; count.textContent = 'Setup not finished'; count.className = 'count todo'; return; }
226
- count.textContent = !r.reports.length ? 'No reports yet' : open ? open + ' open' : 'All answered';
227
- if (open) count.className = 'count on';
222
+ // One card per product; one line per platform in it, each with its own state.
223
+ var seen = {};
224
+ projects.forEach(function (first) {
225
+ if (seen[productOf(first)]) return;
226
+ seen[productOf(first)] = true;
227
+ var sibs = siblings(first);
228
+ var many = sibs.length > 1;
229
+ var rows = sibs.map(function (p) {
230
+ var count = el('span', { class: 'count', text: ' ' });
231
+ var line = el('a', { class: 'app-card' + (many ? ' platform-line' : ''), href: '#/apps/' + p.id }, [
232
+ icon(platformOf(p.platform)),
233
+ el('div', {}, [el('b', { text: many ? platformOf(p.platform).label : p.name }),
234
+ el('span', { class: 'mute', text: many ? (p.framework ? frameworkLabel(p.framework) : ' ') : platformOf(p.platform).label + (p.framework ? ' · ' + frameworkLabel(p.framework) : '') })]),
235
+ count,
236
+ ]);
237
+ api('GET', '/projects/' + p.id + '/reports').then(function (r) {
238
+ var open = r.reports.filter(function (x) { return x.status === 'open'; }).length;
239
+ // No report yet means setup isn't proven: send them back to finish it.
240
+ if (!r.reports.length && !p.sdk_seen && !p.code_found) { line.href = '#/apps/' + p.id + '/setup'; count.textContent = 'Setup not finished'; count.className = 'count todo'; return; }
241
+ count.textContent = !r.reports.length ? 'No reports yet' : open ? open + ' open' : 'All answered';
242
+ if (open) count.className = 'count on';
243
+ });
244
+ return line;
228
245
  });
246
+ var add = el('a', { class: 'add-platform', href: '#/new?product=' + productOf(first), text: '+ Add a platform' });
247
+ grid.appendChild(many
248
+ ? el('div', { class: 'product-card' }, [el('div', { class: 'product-head' }, [el('b', { text: first.name }), add])].concat(rows))
249
+ : el('div', { class: 'product-card single' }, [rows[0], add]));
229
250
  });
230
251
  view.appendChild(grid);
231
252
  });
@@ -238,14 +259,15 @@
238
259
  ['unknown', 'Not sure'], ['html', 'Plain HTML'], ['react', 'React'], ['next', 'Next.js'], ['vue', 'Vue'], ['nuxt', 'Nuxt'],
239
260
  ['svelte', 'SvelteKit'], ['angular', 'Angular'], ['other', 'Something else'],
240
261
  ];
241
- function frameworkLabel(id) { var f = FRAMEWORKS.filter(function (x) { return x[0] === id; })[0]; return f ? f[1] : id; }
262
+ var NATIVE_LABELS = { swiftui: 'SwiftUI', uikit: 'UIKit', appkit: 'AppKit' };
263
+ function frameworkLabel(id) { var f = FRAMEWORKS.filter(function (x) { return x[0] === id; })[0]; return f ? f[1] : NATIVE_LABELS[id] || id; }
242
264
 
243
265
  /**
244
266
  * The four steps. Earlier ones are links, so you can go back and change things; later ones
245
267
  * aren't, because each step needs the one before it. `tested` marks the last step done.
246
268
  */
247
- function stepper(active, p, tested) {
248
- var q = p ? '?app=' + p.id : '';
269
+ function stepper(active, p, tested, query) {
270
+ var q = p ? '?app=' + p.id : (query || '');
249
271
  var links = ['#/new' + q, p ? '#/new/' + p.platform + q : null, p ? '#/apps/' + p.id + '/setup' : null, null];
250
272
  var names = ['Platform', 'Details', 'Install', 'Test'];
251
273
  return el('ol', { class: 'steps' }, names.map(function (s, i) {
@@ -260,28 +282,43 @@
260
282
  /** Adding an app, or with ?app=<id>, going back to change one that already exists. */
261
283
  function newAppView(view, platform, query) {
262
284
  var editId = query && query.get('app');
263
- if (editId) return withProject(editId, function (p) { drawNewApp(view, platform, p); });
264
- drawNewApp(view, platform, null);
285
+ var productId = query && query.get('product');
286
+ if (editId) return withProject(editId, function (p) { drawNewApp(view, platform, p, null); });
287
+ if (productId) {
288
+ return api('GET', '/projects').then(function (b) {
289
+ projects = b.projects;
290
+ var first = projects.filter(function (x) { return productOf(x) === productId; })[0];
291
+ if (!first) { location.hash = '#/'; return; }
292
+ drawNewApp(view, platform, null, first);
293
+ });
294
+ }
295
+ drawNewApp(view, platform, null, null);
265
296
  }
266
297
 
267
- function drawNewApp(view, platform, editing) {
268
- var q = editing ? '?app=' + editing.id : '';
298
+ /** `sibling`: adding another platform to that app's product, not a new product. */
299
+ function drawNewApp(view, platform, editing, sibling) {
300
+ var q = editing ? '?app=' + editing.id : sibling ? '?product=' + productOf(sibling) : '';
301
+ var has = sibling ? siblings(sibling) : [];
269
302
  if (!platform) {
270
- view.appendChild(stepper(1, editing));
271
- view.appendChild(el('h1', { text: 'What are you adding Heresay to?' }));
303
+ view.appendChild(stepper(1, editing, false, q));
304
+ view.appendChild(el('h1', { text: sibling ? 'Add a platform to ' + productName(sibling) : 'What are you adding Heresay to?' }));
305
+ if (sibling) view.appendChild(el('p', { class: 'mute', text: 'Its reports join the same inbox. Each platform gets its own key and install steps.' }));
272
306
  var grid = el('div', { class: 'platforms' });
273
307
  PLATFORMS.forEach(function (p) {
274
- grid.appendChild(el(p.ready ? 'a' : 'div', {
275
- class: 'platform' + (p.ready ? '' : ' soon') + (editing && editing.platform === p.id ? ' current' : ''), href: p.ready ? '#/new/' + p.id + q : null,
276
- 'aria-disabled': p.ready ? null : 'true',
277
- }, [icon(p), el('b', { text: p.label }), el('span', { class: 'mute', text: p.note }), p.ready ? null : el('span', { class: 'tag', text: 'Soon' })]));
308
+ var there = has.filter(function (x) { return x.platform === p.id; })[0];
309
+ grid.appendChild(el(p.ready && !there ? 'a' : 'div', {
310
+ class: 'platform' + (p.ready ? '' : ' soon') + (there ? ' added' : '') + (editing && editing.platform === p.id ? ' current' : ''),
311
+ href: p.ready && !there ? '#/new/' + p.id + q : null,
312
+ 'aria-disabled': p.ready && !there ? null : 'true',
313
+ }, [icon(p), el('b', { text: p.label }), el('span', { class: 'mute', text: p.note }),
314
+ there ? el('span', { class: 'tag', text: 'Added' }) : p.ready ? null : el('span', { class: 'tag', text: 'Soon' })]));
278
315
  });
279
316
  view.appendChild(grid);
280
317
  view.appendChild(el('p', { class: 'mute small', text: 'Other platforms can already send reports through the API. See the docs, under Other platforms.' }));
281
318
  return;
282
319
  }
283
320
 
284
- view.appendChild(stepper(2, editing));
321
+ view.appendChild(stepper(2, editing, false, q));
285
322
  var native = !!platformOf(platform).apple;
286
323
  view.appendChild(el('h1', { text: 'About your ' + platformOf(platform).label + ' app' }));
287
324
  var err = el('p', { class: 'err', role: 'alert' });
@@ -297,7 +334,7 @@
297
334
  }));
298
335
  });
299
336
  // Signed-in apps pass who it is to Heresay, so the person reporting is never asked their name.
300
- var signIn = editing && editing.sign_in ? editing.sign_in : 'unknown';
337
+ var signIn = editing && editing.sign_in ? editing.sign_in : sibling && sibling.sign_in ? sibling.sign_in : 'unknown';
301
338
  var signChips = el('div', { class: 'chips', role: 'radiogroup', 'aria-label': 'Do people sign in?' });
302
339
  [['yes', 'Yes, they sign in'], ['no', 'No, anyone can use it'], ['unknown', 'Not sure']].forEach(function (c) {
303
340
  signChips.appendChild(el('button', {
@@ -331,6 +368,7 @@
331
368
  err.textContent = '';
332
369
  var origins = native ? [] : form.origins.value.split(/[\s,]+/).map(function (s) { return s.trim(); }).filter(Boolean);
333
370
  var body = { name: form.name.value, platform: platform, framework: native ? 'swiftui' : (fw === 'unknown' ? null : fw), allowed_origins: origins, sign_in: signIn === 'unknown' ? null : signIn };
371
+ if (sibling) body.product_id = productOf(sibling);
334
372
  // Editing keeps the key, so a line already pasted into the app keeps working.
335
373
  (editing ? api('PATCH', '/projects/' + editing.id, body) : api('POST', '/projects', body))
336
374
  .then(function (b) {
@@ -343,6 +381,10 @@
343
381
  if (editing) {
344
382
  form.name.value = editing.name;
345
383
  if (!native) form.origins.value = editing.allowed_origins.join('\n');
384
+ } else if (sibling) {
385
+ form.name.value = productName(sibling);
386
+ var web = has.filter(function (x) { return x.allowed_origins.length; })[0];
387
+ if (!native && web) form.origins.value = web.allowed_origins.join('\n');
346
388
  }
347
389
  form.name.focus();
348
390
  }
@@ -411,8 +453,20 @@
411
453
  el('p', { text: 'Then tell Heresay who is signed in, so nobody types their name to send a report:' }), codeBlock(code)])];
412
454
  }
413
455
 
456
+ /** People who never noticed the button can't use it: a one-time introduction, shown by Heresay. */
457
+ function introStep(p) {
458
+ var apple = platformOf(p.platform).apple;
459
+ return apple ? [
460
+ el('p', { html: '<b>Last, tell people it’s there.</b> ' + (p.platform === 'macos' ? 'Under Help, nobody finds it by chance. ' : '') + 'Once the main screen appears, after sign-in and onboarding, show the one-time introduction. It says where to find Heresay and offers to open it:' }),
461
+ codeBlock('MainView()\n .onAppear { Heresay.introduce() } // once per install; later calls do nothing'),
462
+ ] : [
463
+ el('p', { html: '<b>Last, tell people it’s there.</b> Add <code>data-intro="auto"</code> to the tag for a one-time bubble over the button. Apps with sign-in or onboarding: call this once the main screen appears instead:' }),
464
+ codeBlock('window.Heresay?.introduce(); // once per device; later calls do nothing'),
465
+ ];
466
+ }
467
+
414
468
  function byHand(p) {
415
- return byHandSteps(p).concat(identifyStep(p));
469
+ return byHandSteps(p).concat(identifyStep(p), introStep(p));
416
470
  }
417
471
 
418
472
  function byHandSteps(p) {
@@ -458,7 +512,9 @@
458
512
  '',
459
513
  ' npx -y heresay@latest connect --url ' + location.origin + ' --token ' + token + ' --yes',
460
514
  '',
461
- '2. Print the install steps for this app and follow them. They include the app\'s key and exactly where the code goes' + (apple ? ' (a Swift package and one line of setup).' : ', for any framework.'),
515
+ ' Then commit the files it added (.mcp.json, .claude/skills/heresay/, AGENTS.md, CLAUDE.md) in their own commit, so every checkout and worktree of this repo has the Heresay skill and MCP server. Commit nothing else with them.',
516
+ '',
517
+ '2. Print the install steps for this app and follow them. They include the app\'s key and exactly where the code goes' + (apple ? ' (a Swift package and one line of setup)' : ', for any framework') + '. Follow every required step, including telling the people who use the app that Heresay is there: call introduce() once the main screen appears, so it isn\'t hidden' + (apple ? ' under a menu' : ' in a corner') + '.',
462
518
  '',
463
519
  ' npx -y heresay@latest install ' + p.id,
464
520
  '',
@@ -466,7 +522,7 @@
466
522
  '',
467
523
  ' npx -y heresay@latest check ' + p.id,
468
524
  '',
469
- ' You are done when it prints "installed": true. If it doesn\'t, fix what it says and run it again.',
525
+ ' You are done when it prints "installed": true and an empty "todo" list. If not, do what it says and run it again. Commit the install as its own change.',
470
526
  '',
471
527
  'Change nothing else in the app.',
472
528
  ].join('\n');
@@ -614,6 +670,7 @@
614
670
  rs.slice(0, 5).forEach(function (r) {
615
671
  feed.appendChild(el('li', { class: !first && !known[r.id] ? 'fresh' : '' }, [
616
672
  el('span', { class: 'pill ' + r.type, text: TYPE_LABEL[r.type] }),
673
+ showPlatform ? el('span', { class: 'pill platform-pill', text: platformOf(p.platform).label }) : null,
617
674
  el('span', { class: 'feed-text', text: r.text }),
618
675
  el('span', { class: 'mute small', text: [r.context.route, r.context.platform, new Date(r.created_at).toLocaleTimeString()].filter(Boolean).join(' · ') }),
619
676
  ]));
@@ -630,59 +687,120 @@
630
687
 
631
688
  var filter = 'open';
632
689
 
690
+ /** Most urgent first, oldest first within a type, as the server sorts one app's reports. */
691
+ var TYPE_ORDER = { broken: 0, confusing: 1, improvement: 2, idea: 3 };
692
+ function triageSort(rs) {
693
+ return rs.slice().sort(function (a, b) {
694
+ return ((a.status === 'open' ? 0 : 1) - (b.status === 'open' ? 0 : 1))
695
+ || (TYPE_ORDER[a.type] - TYPE_ORDER[b.type])
696
+ || a.created_at.localeCompare(b.created_at);
697
+ });
698
+ }
699
+
700
+ /**
701
+ * One inbox for a product: every platform's reports together, each marked with where it came
702
+ * from. Install, delete and repos stay per platform, because keys and code differ.
703
+ */
633
704
  function reportsView(view, p) {
634
705
  var reports = [];
706
+ var sibs = [p];
707
+ var where = 'all';
635
708
  var filters = el('nav', { class: 'filters', 'aria-label': 'Filter' });
709
+ var platformBar = el('nav', { class: 'filters platforms-filter', 'aria-label': 'Platform' });
636
710
  var list = el('div', { class: 'reports' });
637
711
  var empty = el('p', { class: 'empty' });
638
- var ctx = { repos: [], briefs: {} };
639
- var repoLine = el('p', { class: 'repos-line' });
712
+ var ctxs = {};
713
+ var head = el('div', { class: 'head' });
714
+ var platformsBox = el('div', { class: 'product-platforms' });
640
715
  view.appendChild(el('a', { class: 'back', href: '#/', text: '← All apps' }));
641
- view.appendChild(el('div', { class: 'head' }, [
642
- el('div', { class: 'title' }, [icon(platformOf(p.platform)), el('div', {}, [el('h1', { text: p.name }),
643
- p.framework ? el('span', { class: 'mute small', text: frameworkLabel(p.framework) + (p.framework_detected ? ' (detected)' : '') }) : null])]),
644
- el('div', { class: 'row tight' }, [
645
- el('a', { class: 'btn', href: '#/apps/' + p.id + '/setup', text: 'Install' }),
646
- el('a', { class: 'btn ghost', href: '#/apps/' + p.id + '/delete', text: 'Delete…' }),
647
- ]),
648
- ]));
649
- view.appendChild(repoLine);
716
+ view.appendChild(head);
717
+ view.appendChild(platformsBox);
718
+ view.appendChild(platformBar);
650
719
  view.appendChild(filters);
651
720
  view.appendChild(list);
652
721
  view.appendChild(empty);
653
722
 
723
+ function drawHead() {
724
+ head.textContent = '';
725
+ var many = sibs.length > 1;
726
+ head.appendChild(el('div', { class: 'title' }, [
727
+ 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)),
728
+ el('div', {}, [el('h1', { text: productName(p) }),
729
+ el('span', { class: 'mute small', text: many ? sibs.map(function (x) { return platformOf(x.platform).label; }).join(' · ')
730
+ : (p.framework ? frameworkLabel(p.framework) + (p.framework_detected ? ' (detected)' : '') : platformOf(p.platform).label) })])]));
731
+ head.appendChild(el('div', { class: 'row tight' }, [
732
+ el('a', { class: 'btn ghost', href: '#/new?product=' + productOf(p), text: '+ Add a platform' }),
733
+ many ? null : el('a', { class: 'btn', href: '#/apps/' + p.id + '/setup', text: 'Install' }),
734
+ many ? null : el('a', { class: 'btn ghost', href: '#/apps/' + p.id + '/delete', text: 'Delete…' }),
735
+ ]));
736
+ }
737
+
738
+ /** Per platform: where agents fix it, and its own Install and Delete. */
739
+ function drawPlatforms() {
740
+ platformsBox.textContent = '';
741
+ var many = sibs.length > 1;
742
+ sibs.forEach(function (x) {
743
+ var repos = (ctxs[x.id] || {}).repos || [];
744
+ platformsBox.appendChild(el('p', { class: 'repos-line' }, [
745
+ many ? el('b', { text: platformOf(x.platform).label + ': ' }) : null,
746
+ document.createTextNode(repos.length ? 'Agents fix these in ' + repos.join(', ') + ' · ' : 'No repo connected for agents yet · '),
747
+ el('a', { href: '#/connect?app=' + x.id, text: 'Connect a repo' }),
748
+ many ? document.createTextNode(' · ') : null,
749
+ many ? el('a', { href: '#/apps/' + x.id + '/setup', text: 'Install' }) : null,
750
+ many ? document.createTextNode(' · ') : null,
751
+ many ? el('a', { href: '#/apps/' + x.id + '/delete', text: 'Delete…' }) : null,
752
+ ]));
753
+ });
754
+ }
755
+
654
756
  function load() {
655
- return Promise.all([
656
- api('GET', '/projects/' + p.id + '/reports'),
657
- api('GET', '/projects/' + p.id + '/repos'),
658
- ]).then(function (x) {
659
- reports = x[0].reports; ctx.briefs = x[0].briefs || {}; ctx.repos = x[1].repos;
660
- repoLine.textContent = '';
661
- repoLine.appendChild(document.createTextNode(ctx.repos.length
662
- ? 'Agents fix these in: ' + ctx.repos.join(', ') + ' · ' : 'No repo connected for agents yet · '));
663
- repoLine.appendChild(el('a', { href: '#/connect?app=' + p.id, text: 'Connect a repo' }));
757
+ return api('GET', '/projects').then(function (b) {
758
+ projects = b.projects;
759
+ sibs = siblings(p);
760
+ drawHead();
761
+ return Promise.all(sibs.map(function (x) {
762
+ return Promise.all([api('GET', '/projects/' + x.id + '/reports'), api('GET', '/projects/' + x.id + '/repos')])
763
+ .then(function (r) { ctxs[x.id] = { briefs: r[0].briefs || {}, repos: r[1].repos, project: x, reports: r[0].reports }; });
764
+ }));
765
+ }).then(function () {
766
+ reports = triageSort([].concat.apply([], sibs.map(function (x) { return ctxs[x.id].reports; })));
767
+ drawPlatforms();
664
768
  render();
665
769
  });
666
770
  }
667
771
 
668
772
  function render() {
773
+ var many = sibs.length > 1;
774
+ platformBar.textContent = '';
775
+ platformBar.hidden = !many;
776
+ if (many) {
777
+ [{ id: 'all', label: 'All platforms' }].concat(sibs.map(function (x) { return { id: x.id, label: platformOf(x.platform).label }; })).forEach(function (f) {
778
+ var n = f.id === 'all' ? reports.length : reports.filter(function (r) { return r.project_id === f.id; }).length;
779
+ platformBar.appendChild(el('button', { 'aria-pressed': String(where === f.id), onclick: function () { where = f.id; render(); } },
780
+ [f.label + ' ', el('span', { class: 'n', text: String(n) })]));
781
+ });
782
+ }
783
+ var here = reports.filter(function (r) { return where === 'all' || r.project_id === where; });
669
784
  filters.textContent = '';
670
785
  ['open', 'accepted', 'fixed', 'declined', 'all'].forEach(function (f) {
671
- var n = f === 'all' ? reports.length : reports.filter(function (r) { return r.status === f; }).length;
786
+ var n = f === 'all' ? here.length : here.filter(function (r) { return r.status === f; }).length;
672
787
  filters.appendChild(el('button', {
673
788
  'aria-pressed': String(filter === f),
674
789
  onclick: function () { filter = f; render(); },
675
790
  }, [(f === 'all' ? 'All' : STATUS_LABEL[f]) + ' ', el('span', { class: 'n', text: String(n) })]));
676
791
  });
677
792
  list.textContent = '';
678
- var shown = reports.filter(function (r) { return filter === 'all' || r.status === filter; });
793
+ var shown = here.filter(function (r) { return filter === 'all' || r.status === filter; });
679
794
  empty.hidden = shown.length > 0;
680
795
  empty.textContent = '';
681
- if (!reports.length) {
796
+ if (!here.length) {
682
797
  empty.appendChild(document.createTextNode('No reports yet. '));
683
- empty.appendChild(el('a', { href: '#/apps/' + p.id + '/setup', text: 'Check the install' }));
798
+ empty.appendChild(el('a', { href: '#/apps/' + (where === 'all' ? p.id : where) + '/setup', text: 'Check the install' }));
684
799
  } else empty.textContent = filter === 'open' ? 'Nothing waiting. Every report has had its hearing.' : 'Nothing here.';
685
- shown.forEach(function (r) { list.appendChild(row(p, r, load, ctx)); });
800
+ shown.forEach(function (r) {
801
+ var c = ctxs[r.project_id];
802
+ list.appendChild(row(c.project, r, load, c, many));
803
+ });
686
804
  }
687
805
 
688
806
  load();
@@ -716,7 +834,7 @@
716
834
  ]);
717
835
  }
718
836
 
719
- function row(p, r, reload, ctx) {
837
+ function row(p, r, reload, ctx, showPlatform) {
720
838
  var brief = ctx.briefs[r.id];
721
839
  var err = el('span', { class: 'err' });
722
840
  var actions = el('div', { class: 'actions' });
@@ -784,6 +902,7 @@
784
902
  return el('article', { class: 'report' }, [
785
903
  el('div', { class: 'meta' }, [
786
904
  el('span', { class: 'pill ' + r.type, text: TYPE_LABEL[r.type] }),
905
+ showPlatform ? el('span', { class: 'pill platform-pill', text: platformOf(p.platform).label }) : null,
787
906
  el('time', { datetime: r.created_at, text: new Date(r.created_at).toLocaleString() }),
788
907
  el('span', { class: 'status s-' + r.status, text: STATUS_LABEL[r.status] }),
789
908
  ]),
@@ -84,6 +84,7 @@
84
84
  <tr><td><code>Heresay.setVersion("1.4.0")</code></td><td>Set or change the app version.</td></tr>
85
85
  <tr><td><code>Heresay.setScreen("Checkout")</code></td><td>Name the current screen, for apps whose URL doesn't change between screens.</td></tr>
86
86
  <tr><td><code>Heresay.open()</code></td><td>Open the report form from your own button or menu item.</td></tr>
87
+ <tr><td><code>Heresay.introduce()</code></td><td>Once per device, a small bubble over the button says what it's for, so people know it exists. Call it when your main screen is up (after sign-in or onboarding), or add <code>data-intro="auto"</code> to the tag. Later calls do nothing.</td></tr>
87
88
  <tr><td><code>Heresay.openPreferences()</code></td><td>Open the Preferences tab: a note about their setup, sent with every report. People who aren't signed in can also add a name and an email for replies. It's all optional and saved on their device. Where the button sits is yours to choose, with <code>data-position</code>.</td></tr>
88
89
  <tr><td><code>Heresay.close()</code></td><td>Close the panel.</td></tr></table>
89
90
  <p>Each report also carries the page it came from: its title, its address without the query string, and the window size.</p>
@@ -156,7 +157,7 @@ connect-src ORIGIN;</code></pre>
156
157
  WindowGroup { ContentView().heresayReportButton() } <span class="k">// iOS: a Report button in the corner</span>
157
158
  }
158
159
  }</code></pre>
159
- <p>On macOS, use <code>ContentView().heresay()</code> and add <code>.commands { HeresayCommands() }</code> for <b>Help › Report a Problem…</b> (⌥⌘R). The same calls as the web SDK exist: <code>Heresay.identify(id:label:email:)</code>, <code>Heresay.presentPreferences()</code>, <code>Heresay.setScreen(_:)</code>, <code>Heresay.present()</code>, and <code>Heresay.send(_:text:)</code> for your own UI. The app version comes from the bundle. Native apps have no web origin to lock the key to; the rate limits still apply.</p>
160
+ <p>On macOS, use <code>ContentView().heresay()</code> and add <code>.commands { HeresayCommands() }</code> for <b>Help › Report a Problem…</b> (⌥⌘R). The same calls as the web SDK exist: <code>Heresay.identify(id:label:email:)</code>, <code>Heresay.presentPreferences()</code>, <code>Heresay.introduce()</code> (once per install, an alert saying where to find it; call it when the main screen appears), <code>Heresay.setScreen(_:)</code>, <code>Heresay.present()</code>, and <code>Heresay.send(_:text:)</code> for your own UI. The app version comes from the bundle. Native apps have no web origin to lock the key to; the rate limits still apply.</p>
160
161
 
161
162
  <h2 id="rest">Other platforms</h2>
162
163
  <p>Android, React Native and Flutter SDKs are on the way. Until then, any app can talk to the same API. Both calls take a JSON body.</p>
@@ -0,0 +1,24 @@
1
+ {
2
+ "about": "Features added to Heresay since apps were first installed. An agent in a connected repo checks these with whats_new, tells the person what's new, and asks before adding any. `detect` is what the code contains once a feature is in; `platforms` limits it to those apps; `sign_in` limits it to apps that answered that.",
3
+ "changes": [
4
+ {
5
+ "id": "introduce",
6
+ "since": "0.2.7",
7
+ "title": "Tell people Heresay is there",
8
+ "summary": "A one-time introduction, so the people using the app know they can report things. On macOS it names Help › Report a Problem… (⌥⌘R), on iOS the Report button, on the web a bubble over the button. Shown once per device.",
9
+ "platforms": ["web", "ios", "macos"],
10
+ "detect": ["introduce(", "data-intro"],
11
+ "how": { "web": "guide install-web, step 4", "ios": "guide install-apple, step 5", "macos": "guide install-apple, step 5" }
12
+ },
13
+ {
14
+ "id": "identify-email",
15
+ "since": "0.2.6",
16
+ "title": "Signed-in people are never asked who they are",
17
+ "summary": "When the app tells Heresay who is signed in (id, name, email), the report form stops asking for a name and email, and the team can reply to them.",
18
+ "platforms": ["web", "ios", "macos"],
19
+ "sign_in": "yes",
20
+ "detect": ["identify("],
21
+ "how": { "web": "guide install-web, step 3", "ios": "guide install-apple, step 4", "macos": "guide install-apple, step 4" }
22
+ }
23
+ ]
24
+ }
@@ -1,11 +1,12 @@
1
1
  {
2
- "skill_version": 1,
2
+ "skill_version": 3,
3
3
  "topics": {
4
4
  "start": "What Heresay is, the rules, and which topic to read next",
5
5
  "install-web": "Add the Heresay web SDK to an app, for any framework, and prove it works",
6
6
  "install-apple": "Add the Heresay Swift package to an iOS or macOS app",
7
7
  "fix-brief": "Fix an accepted report: find, claim, fix, hand off, mark fixed",
8
8
  "write-note": "Write the note the reporter reads when a report is fixed",
9
- "uninstall": "Remove Heresay from an app, and disconnect the repo"
9
+ "uninstall": "Remove Heresay from an app, and disconnect the repo",
10
+ "whats-new": "Heresay features this app doesn't use yet: tell the person, and ask before adding any"
10
11
  }
11
12
  }
@@ -51,7 +51,23 @@ Heresay.identify() // after sign-out
51
51
 
52
52
  Then nobody is asked their name to send a report, and the team can reply to them.
53
53
 
54
- ## 5. Optional
54
+ ## 5. Tell people it's there (required)
55
+
56
+ On macOS the report window lives under Help, and on iOS it's a small button; people who have never
57
+ seen it won't go looking. Call `Heresay.introduce()` once the person reaches the app's main
58
+ screen: after sign-in and after any onboarding, never over a login or first-run screen. It shows a
59
+ native alert, once per install, that says where to find it (Help › Report a Problem… (⌥⌘R) on
60
+ macOS, the Report button on iOS) and offers to open it. Later calls do nothing, so this is fine:
61
+
62
+ ```swift
63
+ MainView()
64
+ .onAppear { Heresay.introduce() }
65
+ ```
66
+
67
+ If the app already has a "What's new" or announcements screen, add a line there too. Don't
68
+ build a custom dialog for this; `introduce()` is the one.
69
+
70
+ ## 6. Optional
55
71
 
56
72
  - Screens: `Heresay.setScreen("Checkout")` in `.onAppear` of the main screens.
57
73
  - The app version is read from the bundle (`CFBundleShortVersionString` and build).
@@ -59,7 +75,7 @@ Then nobody is asked their name to send a report, and the team can reply to them
59
75
 
60
76
  Change nothing else in the app.
61
77
 
62
- ## 6. Prove it
78
+ ## 7. Prove it
63
79
 
64
80
  Call `check_install`: it finds the key in this repo's code by itself (`found_in_code`). Build and
65
81
  run on a simulator or device and `seen_running` shows the SDK loaded. To test the whole path,
@@ -42,7 +42,22 @@ Then the person is never asked their name to send a report, and the team can rep
42
42
  follows whoever is signed in on that device, so apps with many users and many logins need
43
43
  nothing else. Use the fields the app already has; leave out any it doesn't.
44
44
 
45
- ## 4. Optional, when the app has them
45
+ ## 4. Tell people it's there (required)
46
+
47
+ People who have never seen the Report button won't go looking for it. Heresay has a one-time
48
+ introduction: a small bubble over the button saying what it's for, shown once per device.
49
+
50
+ - Most apps: add `data-intro="auto"` to the tag. It appears a few seconds after the first page
51
+ load.
52
+ - Apps with sign-in, onboarding or a first-run tour: leave the attribute off and call
53
+ `window.Heresay?.introduce()` once the person reaches the main screen, so it never covers a
54
+ login form or competes with the tour. Calling it again later does nothing.
55
+ - If the app already has a "What's new" or announcements area, add a line there too, e.g.
56
+ "New: tell us what's broken or could be better with the Report button."
57
+
58
+ Don't build a custom dialog for this; `introduce()` is the one.
59
+
60
+ ## 5. Optional, when the app has them
46
61
 
47
62
  - A version: add `data-version="<version>"` to the tag (from package.json, a build env var, ...).
48
63
  - Screens that change without the URL changing: `window.Heresay?.setScreen("<name>")` on each change.
@@ -50,7 +65,7 @@ nothing else. Use the fields the app already has; leave out any it doesn't.
50
65
 
51
66
  Change nothing else in the app.
52
67
 
53
- ## 5. Prove it
68
+ ## 6. Prove it
54
69
 
55
70
  Call `check_install`. It finds the key in this repo's code by itself (`found_in_code`). Then run
56
71
  the app and open it in a browser: `seen_running` shows the SDK loaded there. To test the whole
@@ -14,12 +14,26 @@ sees the outcome in the app, including the note you write when you mark it fixed
14
14
  3. **Claim before you start** (`claim_brief`), so another agent doesn't do the same work.
15
15
  4. **The fix note is for the reporter**, not for developers. See `write-note`.
16
16
  5. **Wrong repo?** `handoff` it to the repo where the fix belongs, with what you learned.
17
+ 6. **Heresay's agent files are committed.** `.mcp.json`, `.claude/skills/heresay/`, `AGENTS.md`
18
+ and `CLAUDE.md` only reach new checkouts and worktrees if they're in git. Commit them on their
19
+ own; `check_install` lists them in `todo` until you do.
20
+ 7. **An install tells people it exists.** Call `introduce()` once the main screen appears, so
21
+ the people using the app learn there's a way to report things. On macOS it lives under Help,
22
+ where nobody looks unprompted. `check_install` lists anything still owed in `todo`; the
23
+ install isn't done until that list is empty.
24
+
25
+ ## Before any task: what's new
26
+
27
+ Call `whats_new`. If it lists Heresay features this app doesn't use yet, tell the person what
28
+ each does in a sentence and **ask before adding any**. See `whats-new`. Never add one without a
29
+ yes; on a no, `skip_update` so nobody asks again.
17
30
 
18
31
  ## Which topic next
19
32
 
20
33
  - Adding Heresay to an app: `install-web` for web apps, `install-apple` for iOS and macOS.
21
34
  - Fixing reports: `fix-brief`, then `write-note`.
22
35
  - Removing Heresay from an app: `uninstall`.
36
+ - New features for an app that already has Heresay: `whats-new`.
23
37
 
24
38
  ## Tools
25
39
 
@@ -0,0 +1,23 @@
1
+ # What's new in Heresay
2
+
3
+ Heresay gains features after an app is installed. When you work on anything Heresay in a
4
+ connected repo, check whether this app is missing any, and **ask the person before adding them**.
5
+
6
+ ## Every Heresay task starts with this
7
+
8
+ 1. Call `whats_new` (or run `npx heresay whats-new`). It compares this Heresay's feature list with
9
+ this repo's code and returns only the features this app doesn't have and nobody skipped.
10
+ 2. If it returns nothing, carry on with the task. Don't mention it.
11
+ 3. If it returns updates, tell the person in one short sentence each, in their words, not ours,
12
+ for example: "Heresay can now show people a one-time note that the Report button exists
13
+ (on the Mac it's otherwise hidden under Help). Want me to add it?" Then ask. One question for
14
+ all of them is fine.
15
+ 4. **Never add a feature without a yes.** A new feature changes what the app's users see.
16
+ - Yes: follow the `how` guide for it, then `check_install` for that app.
17
+ - No: call `skip_update` with its id (or `npx heresay whats-new --skip <id>`), so
18
+ nobody asks again. It is recorded in `.claude/skills/heresay/decisions.json`; commit that.
19
+ - Not now: leave it; it will come up next time.
20
+ 5. Then do the task you were asked to do.
21
+
22
+ If the tool isn't there (an older `heresay` package), read `/guides/changes.json` on this Heresay
23
+ and check the code for each entry's `detect` strings yourself.
@@ -3,164 +3,13 @@
3
3
  <head>
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <title>Heresay · Every report gets a hearing</title>
7
- <meta name="description" content="Add a Report button to any app with one line. Your users say what's wrong, you decide, and they hear back in the app.">
6
+ <title>Heresay</title>
7
+ <meta http-equiv="refresh" content="0; url=/app/">
8
8
  <link rel="icon" href="/favicon.svg" type="image/svg+xml">
9
- <link rel="apple-touch-icon" href="/apple-touch-icon.png">
10
- <meta property="og:title" content="Heresay · Every report gets a hearing">
11
- <meta property="og:description" content="A Report button for any app. Users say it, you decide, they hear back.">
12
- <link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
13
- <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">
14
- <link rel="stylesheet" href="/site.css">
9
+ <style>body{font:16px/1.6 system-ui,sans-serif;color:#15171c;max-width:32rem;margin:15vh auto;padding:0 24px;text-align:center}a{color:#0b5e57}small{display:block;margin-top:24px;color:#5b6472}</style>
15
10
  </head>
16
11
  <body>
17
-
18
- <div class="wrap">
19
- <nav class="nav" aria-label="Main">
20
- <a href="/" aria-label="Heresay home"><img src="/logo.svg" alt="Heresay" height="34"></a>
21
- <div class="links"><a href="#how">How it works</a><a href="/docs.html">Docs</a><a href="#faq">FAQ</a><a class="keep" href="/app/">Sign in</a></div>
22
- <a class="btn btn-p btn-sm" href="/docs.html#self-host">Set up</a>
23
- </nav>
24
-
25
- <header class="hero">
26
- <div>
27
- <h1>Every report gets <em>a hearing.</em></h1>
28
- <p class="lede">Heresay adds a Report button to any app. Your users say what's wrong. You decide. They hear back, right there in the app.</p>
29
- <div class="ctas"><a class="btn btn-p" href="/docs.html#self-host">Set up Heresay</a><a class="btn btn-s" href="#how">See how it works</a></div>
30
- <p class="fine">Free while in beta · No accounts for your users · Works with any website</p>
31
- <div class="snippet" data-origin>&lt;script <span class="nowrap">src="<b>ORIGIN</b>/sdk/v1.js"</span> <span class="nowrap">data-key="pk_…"</span> defer&gt;&lt;/script&gt;</div>
32
- </div>
33
- <div class="stage" role="img" aria-label="The Heresay Report form open inside an app">
34
- <div class="bar"></div><div class="bar b"></div><div class="bar c"></div>
35
- <div class="panel">
36
- <div class="tabs"><span class="on">Report</span><span>Your reports</span></div>
37
- <div class="types">
38
- <div class="type"><b>Broken</b><span>Something doesn't work</span></div>
39
- <div class="type on"><b>Confusing</b><span>I couldn't tell how</span></div>
40
- <div class="type"><b>Could be better</b><span>It works, but…</span></div>
41
- <div class="type"><b>Idea</b><span>Something new</span></div>
42
- </div>
43
- <div class="field">I can't find where to cancel my plan.</div>
44
- <div class="wrow"><small>Screen and version attached</small><span class="send">Send</span></div>
45
- </div>
46
- <div class="fab"><img src="/mark.svg" alt="" width="22" height="22">Report</div>
47
- </div>
48
- </header>
49
- </div>
50
-
51
- <section id="how">
52
- <div class="wrap">
53
- <div class="section-head"><h2>How it works</h2><p>Four steps, and nobody is left waiting.</p></div>
54
- <div class="steps">
55
- <div class="step"><div class="n">1</div><h3>They say it</h3><p>A user taps Report and picks what it is: broken, confusing, could be better, or an idea.</p></div>
56
- <div class="step"><div class="n">2</div><h3>You hear it</h3><p>It lands in your dashboard with the screen, app version, browser and device attached.</p></div>
57
- <div class="step"><div class="n">3</div><h3>You decide</h3><p>Accept it, or decline it with a reason. A no always comes with a why.</p></div>
58
- <div class="step"><div class="n">4</div><h3>They hear back</h3><p>The user sees your answer in the same app. When you fix it, they see that too.</p></div>
59
- </div>
60
- </div>
61
- </section>
62
-
63
- <section>
64
- <div class="wrap">
65
- <div class="section-head"><h2>Both sides of the conversation</h2><p>What your users see, and what you see.</p></div>
66
- <div class="sides">
67
- <div class="side them">
68
- <h3>In your app</h3>
69
- <p class="muted">Your users never make an account. They tap, type a sentence, and later see your reply.</p>
70
- <div class="row-card">
71
- <div class="k" style="color:#17704a">Accepted, being worked on</div>
72
- <p>The export button does nothing.</p>
73
- </div>
74
- <div class="row-card">
75
- <div class="k" style="color:#855309">Declined</div>
76
- <p>I can't find where to cancel my plan.</p>
77
- <div class="reply"><b>Why:</b> It's under Settings → Plan. We'll make it easier to find.</div>
78
- </div>
79
- </div>
80
- <div class="side you">
81
- <h3>In your dashboard</h3>
82
- <p class="muted">The most urgent first: broken, then confusing, then the rest. Nobody picks their own priority.</p>
83
- <div class="row-card">
84
- <div class="k">Confusing</div>
85
- <p>I can't find where to cancel my plan.</p>
86
- <div class="m">/settings/billing · v1.4.0 · Chrome · macOS</div>
87
- <div class="acts"><span class="go">Accept</span><span>Decline…</span></div>
88
- </div>
89
- <div class="row-card">
90
- <div class="k" style="color:#b42318">Broken</div>
91
- <p>The export button does nothing.</p>
92
- <div class="m">/export · v1.4.0 · Safari · iOS</div>
93
- <div class="acts"><span class="go">Copy prompt for agent</span><span>Mark fixed</span></div>
94
- </div>
95
- </div>
96
- </div>
97
- </div>
98
- </section>
99
-
100
- <section>
101
- <div class="wrap">
102
- <div class="section-head"><h2>Small, careful, yours</h2><p>Built to sit quietly inside someone else's app.</p></div>
103
- <div class="grid3">
104
- <div class="feature"><div class="t"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#0b5e57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h16M4 12h10M4 17h7"/></svg><h3>Context, attached</h3></div><p>Screen, app version, browser, OS, and who the user is if you tell us. No screenshots, no guessing.</p></div>
105
- <div class="feature"><div class="t"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#0b5e57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 14l-4-4 4-4"/><path d="M5 10h9a5 5 0 0 1 0 10h-2"/></svg><h3>The answer comes back</h3></div><p>Every report shows its status to the person who sent it. A decline always carries your reason.</p></div>
106
- <div class="feature"><div class="t"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#0b5e57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="4"/><path d="M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6"/></svg><h3>No accounts for users</h3></div><p>People report without signing up. You can pass their name or id from your app if you want it.</p></div>
107
- <div class="feature"><div class="t"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#0b5e57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="4"/><path d="M9 12l2 2 4-4"/></svg><h3>A person says yes first</h3></div><p>Only reports you accept become a prompt for your coding agent. Nobody can steer your agent with a report.</p></div>
108
- <div class="feature"><div class="t"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#0b5e57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z"/></svg><h3>Safe by default</h3></div><p>Your key only works on your site, and every device, network and app is rate-limited.</p></div>
109
- <div class="feature"><div class="t"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#0b5e57" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="8"/><path d="M12 4a8 8 0 0 1 0 16" fill="#0b5e57"/></svg><h3>Matches your app</h3></div><p>Neutral by design, with one line to use your own brand colour. Light and dark mode are automatic.</p></div>
110
- </div>
111
- </div>
112
- </section>
113
-
114
- <section>
115
- <div class="wrap">
116
- <div class="promise">
117
- <img src="/mark.svg" alt="" width="140" height="140">
118
- <div><h2>Nothing reaches your coding agent until you accept it.</h2><p>Reports come from the public, so their words are treated as a description, never as instructions. Accepted reports become a clean prompt you can hand to any coding agent.</p></div>
119
- </div>
120
- </div>
121
- </section>
122
-
123
- <section>
124
- <div class="wrap">
125
- <div class="section-head"><h2>Set up in three steps</h2><p>Your own Heresay, in your own Google account. Reports never sit on anyone else's servers.</p></div>
126
- <div class="setup">
127
- <div class="step"><div class="n">1</div><h3>Run one command</h3><p><code>npx create-heresay</code> creates a Firebase project for you and deploys the dashboard to it. About five minutes.</p></div>
128
- <div class="step"><div class="n">2</div><h3>Paste one line</h3><p>Put the script tag before <code>&lt;/body&gt;</code>. A Report button appears in the corner.</p></div>
129
- <div class="step"><div class="n">3</div><h3>Read your reports</h3><p>Open the dashboard. Accept, decline with a reason, and mark things fixed.</p></div>
130
- </div>
131
- <div class="ctas" style="margin-top:32px"><a class="btn btn-p" href="/docs.html#self-host">Set up Heresay</a><a class="btn btn-s" href="/app/">Sign in</a></div>
132
- </div>
133
- </section>
134
-
135
- <section id="faq">
136
- <div class="wrap">
137
- <div class="section-head"><h2>Questions</h2></div>
138
- <div class="faq">
139
- <details><summary>How much does it cost?</summary><p>Heresay itself is free. It runs in your own Firebase project, and Firebase's free tier covers a small app. Past that, you pay Google directly, usually cents.</p></details>
140
- <details><summary>Will it slow my app down?</summary><p>No. It's one small script with no dependencies, it loads after your page, and if our service is ever down your app carries on normally.</p></details>
141
- <details><summary>What do you collect?</summary><p>What the user types, the report type, and context: the page, your app version, browser and OS. No screenshots, no cookies. A random device id is kept in the browser so people can see their own reports.</p></details>
142
- <details><summary>Do my users need an account?</summary><p>No. If your app knows who they are, you can pass a name or id with one call.</p></details>
143
- <details><summary>Can it match my brand?</summary><p>Yes. Add <code>data-accent="#yourcolour"</code> to the script tag. The widget stays neutral otherwise, and follows light and dark mode.</p></details>
144
- <details><summary>How does it work with coding agents?</summary><p>When you accept a report, the dashboard gives you a ready-made prompt for your coding agent. Reports you haven't accepted never become prompts.</p></details>
145
- <details><summary>Which platforms are supported?</summary><p>Any website today, whatever it's built with. An iOS SDK is next.</p></details>
146
- <details><summary>Can someone spam my reports?</summary><p>Your key only works on the site you register, and reports are rate-limited per device, per network and per app.</p></details>
147
- </div>
148
- </div>
149
- </section>
150
-
151
- <section class="close">
152
- <div class="wrap">
153
- <img src="/mark.svg" alt="" width="84" height="84" style="margin:0 auto">
154
- <h2>One line. Every report gets a hearing.</h2>
155
- <div class="ctas"><a class="btn btn-p" href="/docs.html#self-host">Set up Heresay</a></div>
156
- </div>
157
- </section>
158
-
159
- <footer class="site"><div class="wrap"><span>© 2026 Heresay</span><span><a href="/docs.html">Docs</a> · <a href="/app/">Sign in</a></span></div></footer>
160
-
161
- <script>
162
- // Show the real address this site is served from in the code samples.
163
- document.querySelectorAll('[data-origin]').forEach(function (el) { el.innerHTML = el.innerHTML.replace(/ORIGIN/g, location.origin); });
164
- </script>
12
+ <p><a href="/app/">Open the Heresay dashboard</a></p>
13
+ <small><a href="https://sibhimanyu.github.io/heresay/">What is Heresay?</a></small>
165
14
  </body>
166
15
  </html>
@@ -4,12 +4,14 @@
4
4
  * <script src="https://<sdk-host>/sdk.js" data-key="pk_..." defer></script>
5
5
  *
6
6
  * Optional attributes: data-version, data-user-id, data-user-label, data-position ("left"),
7
+ * data-intro ("auto": introduce the button a few seconds after the first page load),
7
8
  * data-accent ("#0f766e"; a hex colour, to match the host app. Defaults to Heresay peacock).
8
9
  * Optional calls, any time after the script runs:
9
10
  * Feedback.identify({ id, label, email }) who is signed in; then nobody is asked their name
10
11
  * Feedback.setVersion("1.4.0")
11
12
  * Feedback.setScreen("Checkout") for apps whose URL does not change per screen
12
13
  * Feedback.open()
14
+ * Feedback.introduce() once per device: a bubble saying the Report button is there
13
15
  * Feedback.openPreferences() a note about their setup, and a name and email if not signed in
14
16
  *
15
17
  * No account, no cookies. The reporter is a random per-device id kept in localStorage, and
@@ -224,6 +226,17 @@
224
226
  'padding:9px 14px;border-radius:999px;border:1px solid var(--fb-line);background:var(--fb-bg);color:var(--fb-fg);',
225
227
  'box-shadow:0 4px 14px rgba(0,0,0,.18);cursor:pointer;font-weight:600}',
226
228
  '.fab.left{right:auto;left:20px}',
229
+ '.intro{position:fixed;bottom:72px;right:20px;z-index:2147483000;width:min(300px,calc(100vw - 40px));padding:14px 16px;',
230
+ 'background:var(--fb-bg);border:1px solid var(--fb-line);border-radius:14px;box-shadow:0 12px 32px rgba(0,0,0,.22);animation:fb-in .25s ease-out}',
231
+ '.intro.left{right:auto;left:20px}',
232
+ '.intro:after{content:"";position:absolute;bottom:-7px;right:36px;width:12px;height:12px;background:var(--fb-bg);',
233
+ 'border-right:1px solid var(--fb-line);border-bottom:1px solid var(--fb-line);transform:rotate(45deg)}',
234
+ '.intro.left:after{right:auto;left:36px}',
235
+ '.intro b{display:block;margin-bottom:4px;font-weight:700}',
236
+ '.intro p{margin:0 0 12px;color:var(--fb-mute);font-size:13px}',
237
+ '.intro .row{margin-top:0;justify-content:flex-end}',
238
+ '@keyframes fb-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}',
239
+ '@media (prefers-reduced-motion:reduce){.intro{animation:none}}',
227
240
  '.mark{display:inline-flex;color:var(--fb-mark)}.mark svg{display:block}',
228
241
  '.dot{width:8px;height:8px;border-radius:50%;background:var(--fb-acc)}',
229
242
  '.scrim{position:fixed;inset:0;z-index:2147483001;background:rgba(0,0,0,.35);display:flex;align-items:flex-end;justify-content:flex-end;padding:16px}',
@@ -329,6 +342,7 @@
329
342
 
330
343
  function open(which) {
331
344
  if (scrim || dead) return;
345
+ if (bubble) { bubble.remove(); bubble = null; }
332
346
  lastFocus = document.activeElement;
333
347
  view = which || (unseen() ? 'mine' : 'new');
334
348
  scrim = el('div', { class: 'scrim' + (LEFT ? ' left' : ''), onclick: function (e) { if (e.target === scrim) close(); } });
@@ -509,10 +523,34 @@
509
523
  });
510
524
  }
511
525
 
526
+ // ---- introduction ----------------------------------------------------------------------
527
+
528
+ // People can't use a button they never noticed. Once per device and app, a bubble says what it
529
+ // is for. The host app picks the moment (introduce()), or data-intro="auto" does it on load.
530
+ var INTRO_KEY = 'fbsdk.introduced.' + KEY;
531
+ var bubble = null;
532
+ function introduce() {
533
+ if (dead || bubble || scrim || load(INTRO_KEY)) return false;
534
+ save(INTRO_KEY, new Date().toISOString());
535
+ var done = function () { if (bubble) { bubble.remove(); bubble = null; } };
536
+ bubble = el('div', { class: 'intro' + (LEFT ? ' left' : ''), role: 'dialog', 'aria-label': 'About the Report button' }, [
537
+ el('b', { text: 'Something not right? Tell the team.' }),
538
+ el('p', { text: 'Use Report to say what is broken, confusing or could be better. A person reads every report, and you will see what happens to yours right here.' }),
539
+ el('div', { class: 'row' }, [
540
+ el('button', { class: 'link', type: 'button', text: 'Got it', onclick: done }),
541
+ el('button', { class: 'send', type: 'button', text: 'Try it', onclick: function () { done(); open('new'); } }),
542
+ ]),
543
+ ]);
544
+ bubble.addEventListener('keydown', function (e) { if (e.key === 'Escape') done(); });
545
+ root.appendChild(bubble);
546
+ return true;
547
+ }
548
+
512
549
  function mount() {
513
550
  if (dead) return;
514
551
  if (!host.isConnected) document.body.appendChild(host);
515
552
  refresh();
553
+ if (script.getAttribute('data-intro') === 'auto') setTimeout(introduce, 3000);
516
554
  }
517
555
  if (document.body) mount(); else document.addEventListener('DOMContentLoaded', mount);
518
556
 
@@ -529,6 +567,8 @@
529
567
  setScreen: function (s) { state.screen = s != null ? String(s) : null; },
530
568
  open: function () { open('new'); },
531
569
  openPreferences: function () { open('prefs'); },
570
+ /** Show the one-time introduction now. False if it was already shown on this device. */
571
+ introduce: function () { return introduce(); },
532
572
  close: close,
533
573
  };
534
574
  })();