@stefan.inc/feedback-engine 1.2.0 → 1.2.2

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/README.md CHANGED
@@ -8,7 +8,7 @@ Alt+Meta+click anything in the browser, click any component on the frozen screen
8
8
 
9
9
  | The editor in the browser | The `feedback.png` it exports |
10
10
  | :---: | :---: |
11
- | <img src="https://raw.githubusercontent.com/smirea/feedback-engine/master/docs/web-editor.png" alt="The Feedback editor in Google Chrome over the React example: the page's screenshot on the left with four notes numbered 1 to 4 and an @5 tag on the New List button, and the panel on the right with the Groceries row, a ListRow, selected and its note, Show a progress bar here." width="320"> | <img src="https://raw.githubusercontent.com/smirea/feedback-engine/master/docs/web-export.png" alt="The feedback.png exported from the browser: the page with four numbered boxes and the New List button tagged @5. Each box links to a card with its note, the component or element, and its file:line, and the app's details sit at the top right. The note on Settings reads Move this next to @5_Button." width="520"> |
11
+ | <img src="https://raw.githubusercontent.com/smirea/feedback-engine/master/docs/web-editor.png" alt="The Feedback editor in Google Chrome over the React example: the page's screenshot on the left with four notes numbered 1 to 4 and an @5 tag on the New List button, and the panel on the right with the Groceries row, a ListRow, selected and its note, Show a progress bar here." width="320"> | <img src="https://raw.githubusercontent.com/smirea/feedback-engine/master/docs/web-export.png" alt="The feedback.png exported from the browser: the page with four numbered boxes and the New List button tagged @5. One column on the left holds the app's details as Name: value lines, a References line naming @5 with its file:line, and a card per note, each joined to its box by a curve that crosses no other box. Each card has its note, the component or element, and its file:line. The note on Settings reads Move this next to @5_Button. A faint GitHub mark and the repository's URL sit at the bottom left." width="520"> |
12
12
 
13
13
  Four notes on the React example in Google Chrome. The last one points at a second element. Type `@`, click the element, and the note reads `Move this next to @5_Button`. The export draws that element's box and highlights the token in the same color, so an agent knows which button you meant. Each card names its component or element and the `file:line` it comes from, such as `src/components/ListRow.tsx:4`.
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stefan.inc/feedback-engine",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "In-app feedback for Svelte and React: point at a component, write what should change, and export its name, file:line, and data for an agent.",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -8,13 +8,20 @@ export const cards = {
8
8
  badge: 20,
9
9
  padding: 10,
10
10
  rightColumnPenalty: 80,
11
+ crossingPenalty: 500,
12
+ watermark: 16,
11
13
  };
12
14
 
13
15
  export type Card = { isLeft: boolean; origin: Point };
14
- export type Layout = { shot: Frame; cards: Card[]; environment: Point; size: Size };
16
+ /** `watermark` is the top-left of a column-wide strip `cards.watermark` tall, aligned to its left or right edge. */
17
+ export type Layout = { shot: Frame; cards: Card[]; environment: Point; watermark: Card; size: Size };
18
+ export type Curve = { start: Point; control1: Point; control2: Point; end: Point };
15
19
 
16
- /** From the card's badge to the nearest side of the target, at the badge's height when the target spans it. */
17
- export function line(card: Card, target: Frame): { start: Point; end: Point } {
20
+ /**
21
+ * An S curve from the card's badge to the nearest side of the target, at the badge's height when the target spans it.
22
+ * It leaves the card and meets the target level.
23
+ */
24
+ export function connector(card: Card, target: Frame): Curve {
18
25
  const start = {
19
26
  x: card.isLeft ? card.origin.x + cards.column : card.origin.x,
20
27
  y: card.origin.y + cards.padding + cards.badge / 2,
@@ -23,47 +30,123 @@ export function line(card: Card, target: Frame): { start: Point; end: Point } {
23
30
  x: card.isLeft ? target.x : target.x + target.width,
24
31
  y: Math.min(Math.max(start.y, target.y + 2), target.y + target.height - 2),
25
32
  };
26
- return { start, end };
33
+ const bend = (end.x - start.x) / 2;
34
+ return { start, control1: { x: start.x + bend, y: start.y }, control2: { x: end.x - bend, y: end.y }, end };
27
35
  }
28
36
 
29
- const length = (card: Card, target: Frame) => {
30
- const { start, end } = line(card, target);
31
- return Math.hypot(end.x - start.x, end.y - start.y);
32
- };
37
+ const samples = 16;
33
38
 
34
- /**
35
- * Where the image export puts each item's card. A card sits in the left column, as level with its target as the cards
36
- * above it allow. It moves to the right column when that makes its line to the target at least `rightColumnPenalty`
37
- * points shorter, as for a button at the right edge. The environment always sits at the top of the right column, and
38
- * right-column cards start below it. A tall capture is cut half the height that was on screen below the lowest box or
39
- * card, and never shorter than that height, and `shot` is the part that is drawn. `targets` and
40
- * `references` are frames in the capture. The layout's frames are in the image.
41
- */
42
- export function place(
39
+ function polyline({ start, control1, control2, end }: Curve): Point[] {
40
+ return Array.from({ length: samples + 1 }, (_, step) => {
41
+ const t = step / samples;
42
+ const u = 1 - t;
43
+ const at = (a: number, b: number, c: number, d: number) =>
44
+ u * u * u * a + 3 * u * u * t * b + 3 * u * t * t * c + t * t * t * d;
45
+ return { x: at(start.x, control1.x, control2.x, end.x), y: at(start.y, control1.y, control2.y, end.y) };
46
+ });
47
+ }
48
+
49
+ function segmentCrossesBox(a: Point, b: Point, box: Frame) {
50
+ let low = 0;
51
+ let high = 1;
52
+ const dx = b.x - a.x;
53
+ const dy = b.y - a.y;
54
+ const edges: [number, number][] = [
55
+ [-dx, a.x - box.x],
56
+ [dx, box.x + box.width - a.x],
57
+ [-dy, a.y - box.y],
58
+ [dy, box.y + box.height - a.y],
59
+ ];
60
+ for (const [direction, distance] of edges) {
61
+ if (direction === 0) {
62
+ if (distance < 0) return false;
63
+ continue;
64
+ }
65
+ const t = distance / direction;
66
+ if (direction < 0) low = Math.max(low, t);
67
+ else high = Math.min(high, t);
68
+ if (low > high) return false;
69
+ }
70
+ return true;
71
+ }
72
+
73
+ const turn = (a: Point, b: Point, c: Point) => Math.sign((b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x));
74
+ const segmentsCross = (a: Point, b: Point, c: Point, d: Point) =>
75
+ turn(a, b, c) * turn(a, b, d) < 0 && turn(c, d, a) * turn(c, d, b) < 0;
76
+
77
+ const contains = (box: Frame, point: Point) =>
78
+ point.x >= box.x && point.x <= box.x + box.width && point.y >= box.y && point.y <= box.y + box.height;
79
+
80
+ /** Boxes the path passes through, other than its target and the boxes around it, plus the earlier paths it crosses. */
81
+ function crossings(path: Point[], target: Frame, boxes: Frame[], earlier: Point[][]) {
82
+ const end = path.at(-1)!;
83
+ const pairs = path.slice(1).map((point, index) => [path[index]!, point] as const);
84
+ const box = boxes.filter(
85
+ box =>
86
+ !contains(box, end) &&
87
+ !(box.x === target.x && box.y === target.y && box.width === target.width && box.height === target.height) &&
88
+ pairs.some(([a, b]) => segmentCrossesBox(a, b, box)),
89
+ ).length;
90
+ const paths = earlier.filter(other =>
91
+ other.slice(1).some((d, index) => pairs.some(([a, b]) => segmentsCross(a, b, other[index]!, d))),
92
+ ).length;
93
+ return box + paths;
94
+ }
95
+
96
+ type Columns = 'both' | 'left' | 'right';
97
+ /** `fit` is the height without the watermark, so the watermark never costs the image its single column. */
98
+ type Arrangement = Layout & { cost: number; crossings: number; fit: number };
99
+
100
+ function arrange(
101
+ columns: Columns,
43
102
  targets: Frame[],
44
103
  heights: number[],
45
104
  screen: Size,
46
105
  environmentHeight: number,
47
106
  viewport: number,
48
- references: Frame[] = [],
49
- ): Layout {
50
- const { margin, column, gutter, spacing, rightColumnPenalty } = cards;
51
- const shot = { x: margin + column + gutter, y: margin, width: screen.width, height: screen.height };
107
+ references: Frame[],
108
+ ): Arrangement {
109
+ const { margin, column, gutter, spacing, rightColumnPenalty, crossingPenalty, watermark } = cards;
110
+ const shot = {
111
+ x: columns === 'right' ? margin : margin + column + gutter,
112
+ y: margin,
113
+ width: screen.width,
114
+ height: screen.height,
115
+ };
52
116
  const rightX = shot.x + shot.width + gutter;
53
- const moved = targets.map(target => ({ ...target, x: target.x + shot.x, y: target.y + shot.y }));
117
+ const inShot = (frame: Frame) => ({ ...frame, x: frame.x + shot.x, y: frame.y + shot.y });
118
+ const moved = targets.map(inShot);
119
+ const boxes = [...moved, ...references.map(inShot)];
54
120
  const midY = (index: number) => moved[index]!.y + moved[index]!.height / 2;
55
121
  const placed: Card[] = moved.map(() => ({ isLeft: true, origin: { x: 0, y: 0 } }));
56
- let nextLeft = margin;
57
- let nextRight = margin + environmentHeight + spacing * 2;
122
+ const paths: Point[][] = [];
123
+ const underEnvironment = margin + environmentHeight + spacing * 2;
124
+ let nextLeft = columns === 'left' ? underEnvironment : margin;
125
+ let nextRight = underEnvironment;
126
+ let cost = 0;
127
+ let crossed = 0;
58
128
  const order = moved.map((_, index) => index).toSorted((a, b) => midY(a) - midY(b) || a - b);
59
129
  for (const index of order) {
130
+ const target = moved[index]!;
60
131
  const desired = Math.max(midY(index) - heights[index]! / 2, margin);
61
- const left: Card = { isLeft: true, origin: { x: margin, y: Math.max(desired, nextLeft) } };
62
- const right: Card = { isLeft: false, origin: { x: rightX, y: Math.max(desired, nextRight) } };
63
- const card = length(left, moved[index]!) - length(right, moved[index]!) >= rightColumnPenalty ? right : left;
64
- placed[index] = card;
65
- if (card.isLeft) nextLeft = card.origin.y + heights[index]! + spacing;
66
- else nextRight = card.origin.y + heights[index]! + spacing;
132
+ const options: Card[] = [];
133
+ if (columns !== 'right') options.push({ isLeft: true, origin: { x: margin, y: Math.max(desired, nextLeft) } });
134
+ if (columns !== 'left') options.push({ isLeft: false, origin: { x: rightX, y: Math.max(desired, nextRight) } });
135
+ const scored = options.map(card => {
136
+ const curve = connector(card, target);
137
+ const path = polyline(curve);
138
+ const count = crossings(path, target, boxes, paths);
139
+ const length = Math.hypot(curve.end.x - curve.start.x, curve.end.y - curve.start.y);
140
+ const penalty = columns === 'both' && !card.isLeft ? rightColumnPenalty : 0;
141
+ return { card, path, count, cost: length + penalty + count * crossingPenalty };
142
+ });
143
+ const best = scored.reduce((chosen, option) => (option.cost <= chosen.cost ? option : chosen));
144
+ placed[index] = best.card;
145
+ paths.push(best.path);
146
+ cost += best.cost;
147
+ crossed += best.count;
148
+ if (best.card.isLeft) nextLeft = best.card.origin.y + heights[index]! + spacing;
149
+ else nextRight = best.card.origin.y + heights[index]! + spacing;
67
150
  }
68
151
 
69
152
  const lowest = Math.max(
@@ -72,11 +155,52 @@ export function place(
72
155
  ...placed.map((card, index) => card.origin.y + heights[index]! - shot.y),
73
156
  );
74
157
  shot.height = Math.min(screen.height, Math.max(viewport, lowest + viewport / 2));
75
- const height = Math.max(shot.y + shot.height, nextLeft - spacing, nextRight - spacing) + margin;
158
+ const last = columns === 'right' ? nextRight : nextLeft;
159
+ const fit = Math.max(shot.y + shot.height, nextLeft - spacing, nextRight - spacing) + margin;
160
+ const height = Math.max(fit, last + watermark + margin);
76
161
  return {
77
162
  shot,
78
163
  cards: placed,
79
- environment: { x: rightX, y: margin },
80
- size: { width: rightX + column + margin, height },
164
+ environment: { x: columns === 'left' ? margin : rightX, y: margin },
165
+ watermark: {
166
+ isLeft: columns !== 'right',
167
+ origin: { x: columns === 'right' ? rightX : margin, y: height - margin - watermark },
168
+ },
169
+ size: { width: columns === 'left' ? shot.x + shot.width + margin : rightX + column + margin, height },
170
+ cost,
171
+ crossings: crossed,
172
+ fit,
81
173
  };
82
174
  }
175
+
176
+ /**
177
+ * Where the image export puts each item's card. Cards go in the column whose path to the target costs least: its
178
+ * length, `rightColumnPenalty` points for the right column, and `crossingPenalty` for each other box or earlier path
179
+ * it crosses, as level with the target as the cards above allow. The environment sits at the top of the right column,
180
+ * and right-column cards start below it. When one column holds the environment and every card with no crossing and no
181
+ * taller image, not counting the watermark, the image drops the other column and keeps only a margin on that side, and of the two sides it takes
182
+ * the one whose paths are shorter in total. The watermark sits at the bottom of the left column, or of the right one
183
+ * when that is the only column, below the column's last card. A tall capture is cut half the
184
+ * height that was on screen below the lowest box or card, and never shorter than that height, and `shot` is the part
185
+ * that is drawn. `targets` and `references` are frames in the capture. The layout's frames are in the image.
186
+ */
187
+ export function place(
188
+ targets: Frame[],
189
+ heights: number[],
190
+ screen: Size,
191
+ environmentHeight: number,
192
+ viewport: number,
193
+ references: Frame[] = [],
194
+ ): Layout {
195
+ const build = (columns: Columns) =>
196
+ arrange(columns, targets, heights, screen, environmentHeight, viewport, references);
197
+ const both = build('both');
198
+ const single = [build('left'), build('right')]
199
+ .filter(option => option.crossings === 0 && option.fit <= both.fit)
200
+ .reduce<Arrangement | undefined>(
201
+ (chosen, option) => (chosen && chosen.cost <= option.cost ? chosen : option),
202
+ undefined,
203
+ );
204
+ const { shot, cards: placed, environment, watermark, size } = single ?? both;
205
+ return { shot, cards: placed, environment, watermark, size };
206
+ }
package/src/dom/image.ts CHANGED
@@ -1,16 +1,18 @@
1
1
  import {
2
2
  cards as metrics,
3
- line,
3
+ connector,
4
4
  nearestSource,
5
5
  paletteColor,
6
6
  place,
7
7
  tag,
8
8
  title,
9
9
  type Annotations,
10
+ type Card,
10
11
  type Frame,
11
12
  type Point,
12
13
  } from '../core/index.ts';
13
14
  import type { Screen } from './capture.ts';
15
+ import { githubPath } from './webhook.ts';
14
16
 
15
17
  /** Keeps a tall full-length capture shareable. */
16
18
  const pixelBudget = 40_000_000;
@@ -18,6 +20,7 @@ const secondary = '#6b6b6b';
18
20
  const primary = '#141414';
19
21
  const sans = 'system-ui, -apple-system, "Segoe UI", sans-serif';
20
22
  const mono = 'ui-monospace, "SF Mono", Menlo, Consolas, monospace';
23
+ const repository = 'github.com/smirea/feedback-engine';
21
24
 
22
25
  type Run = { text: string; font: string; color: string; background?: string; spacing?: number };
23
26
  type Piece = Run & { x: number; width: number };
@@ -25,10 +28,18 @@ type Line = { pieces: Piece[]; height: number; gap: number };
25
28
 
26
29
  const fontSize = (font: string) => Number(/(\d+(?:\.\d+)?)px/.exec(font)![1]);
27
30
 
28
- /** Breaks runs of styled text into lines no wider than `width`. A paragraph ends at each newline, with `gap` points after it. */
29
- function layout(context: CanvasRenderingContext2D, paragraphs: { runs: Run[]; gap?: number }[], width: number): Line[] {
31
+ /**
32
+ * Breaks runs of styled text into lines no wider than `width`. A paragraph ends at each newline, with `gap` points after
33
+ * it, and `before` points more before it.
34
+ */
35
+ function layout(
36
+ context: CanvasRenderingContext2D,
37
+ paragraphs: { runs: Run[]; gap?: number; before?: number }[],
38
+ width: number,
39
+ ): Line[] {
30
40
  const lines: Line[] = [];
31
41
  for (const paragraph of paragraphs) {
42
+ if (paragraph.before && lines.length) lines.at(-1)!.gap += paragraph.before;
32
43
  let current: Line = { pieces: [], height: 0, gap: 0 };
33
44
  let x = 0;
34
45
  const wrap = () => {
@@ -163,6 +174,22 @@ function referenceTag(context: CanvasRenderingContext2D, text: string, color: st
163
174
  label(context, text, center);
164
175
  }
165
176
 
177
+ /** GitHub's mark and the repository, faint, against the strip's left or right edge. */
178
+ function watermark(context: CanvasRenderingContext2D, { isLeft, origin }: Card) {
179
+ const side = metrics.watermark;
180
+ context.font = `11px ${sans}`;
181
+ const width = side + 6 + context.measureText(repository).width;
182
+ const x = isLeft ? origin.x : origin.x + metrics.column - width;
183
+ context.fillStyle = withAlpha(secondary, 0.5);
184
+ context.save();
185
+ context.translate(x, origin.y);
186
+ const mark = new Path2D(githubPath);
187
+ context.fill(mark);
188
+ context.restore();
189
+ context.textBaseline = 'middle';
190
+ context.fillText(repository, x + side + 6, origin.y + side / 2);
191
+ }
192
+
166
193
  /**
167
194
  * The image export: the screenshot with numbered boxes, each item's text and code location in a card beside it, a
168
195
  * tagged box for each referenced node, and the capture's environment, so the one file is enough on its own.
@@ -174,18 +201,46 @@ export function annotatedImage({ capture, image, scale }: Screen, annotations: A
174
201
  const context = canvas.getContext('2d')!;
175
202
 
176
203
  const app = capture.environment.find(entry => entry.name === 'App')?.value ?? 'App';
204
+ const flagged = new Set(annotations.items.map(item => item.target));
205
+ const unflagged = annotations.used.filter(reference => !flagged.has(reference.target));
177
206
  const environment = layout(
178
207
  context,
179
208
  [
180
- { runs: [{ text: `Feedback: ${app}`, font: `700 16px ${sans}`, color: primary }], gap: 6 },
181
- ...capture.environment.flatMap(entry =>
182
- entry.name === 'App'
183
- ? []
184
- : [
185
- { runs: [{ text: entry.name.toUpperCase(), font: `600 10px ${sans}`, color: secondary, spacing: 0.5 }] },
186
- { runs: [{ text: entry.value, font: `12.5px ${sans}`, color: primary }], gap: 6 },
187
- ],
188
- ),
209
+ { runs: [{ text: `Feedback: ${app}`, font: `700 16px ${sans}`, color: primary }], gap: 8 },
210
+ ...capture.environment
211
+ .filter(entry => entry.name !== 'App')
212
+ .map(entry => ({
213
+ runs: [
214
+ { text: `${entry.name}: `, font: `600 12.5px ${sans}`, color: secondary },
215
+ { text: entry.value, font: `12.5px ${sans}`, color: primary },
216
+ ],
217
+ gap: 4,
218
+ })),
219
+ ...(unflagged.length
220
+ ? [
221
+ {
222
+ runs: [{ text: 'REFERENCES', font: `700 11px ${sans}`, color: secondary, spacing: 0.6 }],
223
+ before: 6,
224
+ gap: 4,
225
+ },
226
+ ]
227
+ : []),
228
+ ...unflagged.map(reference => {
229
+ const source = nearestSource(capture, reference.target);
230
+ return {
231
+ runs: [
232
+ {
233
+ text: ` ${tag(reference)} `,
234
+ font: `700 11px ${sans}`,
235
+ color: 'white',
236
+ background: paletteColor(annotations.colorIndex(reference.target)),
237
+ },
238
+ ...(source ? [{ text: ` ${source}`, font: `11px ${mono}`, color: primary }] : []),
239
+ { text: ` ${title(capture.nodes[reference.target]!)}`, font: `12.5px ${sans}`, color: primary },
240
+ ],
241
+ gap: 4,
242
+ };
243
+ }),
189
244
  ],
190
245
  column,
191
246
  );
@@ -263,10 +318,10 @@ export function annotatedImage({ capture, image, scale }: Screen, annotations: A
263
318
  for (const [index, item] of items.entries()) {
264
319
  const target = inShot(item.frame);
265
320
  dashedBox(context, target, item.color);
266
- const { start, end } = line(placed.cards[index]!, target);
321
+ const { start, control1, control2, end } = connector(placed.cards[index]!, target);
267
322
  context.beginPath();
268
323
  context.moveTo(start.x, start.y);
269
- context.lineTo(end.x, end.y);
324
+ context.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, end.x, end.y);
270
325
  context.lineWidth = 1.25;
271
326
  context.strokeStyle = withAlpha(item.color, 0.6);
272
327
  context.stroke();
@@ -280,7 +335,6 @@ export function annotatedImage({ capture, image, scale }: Screen, annotations: A
280
335
  });
281
336
  }
282
337
 
283
- const flagged = new Set(annotations.items.map(item => item.target));
284
338
  for (const reference of annotations.used) {
285
339
  const color = paletteColor(annotations.colorIndex(reference.target));
286
340
  const target = inShot(capture.nodes[reference.target]!.frame);
@@ -312,5 +366,6 @@ export function annotatedImage({ capture, image, scale }: Screen, annotations: A
312
366
  }
313
367
 
314
368
  drawText(context, environment, placed.environment);
369
+ watermark(context, placed.watermark);
315
370
  return canvas;
316
371
  }
@@ -31,11 +31,15 @@ export type WebhookPost = {
31
31
  };
32
32
 
33
33
  /**
34
- * GitHub's mark in white, for a webhook that files issues. The iOS package draws the same path
35
- * (`GitHubIcon.swift`), which has only absolute `M`, `L`, `C`, and `Z` commands so that a few lines can read it.
34
+ * GitHub's mark, 16 points square. The iOS package draws the same path (`GitHubIcon.swift`), which has only absolute
35
+ * `M`, `L`, `C`, and `Z` commands so that a few lines can read it.
36
36
  */
37
+ export const githubPath =
38
+ 'M6.766 11.328C4.703 11.078 3.25 9.594 3.25 7.672C3.25 6.891 3.531 6.047 4 5.484C3.797 4.969 3.828 3.875 4.063 3.422C4.688 3.344 5.531 3.672 6.031 4.125C6.625 3.938 7.25 3.844 8.016 3.844C8.781 3.844 9.406 3.938 9.969 4.109C10.453 3.672 11.313 3.344 11.938 3.422C12.156 3.844 12.188 4.937 11.984 5.469C12.484 6.062 12.75 6.859 12.75 7.672C12.75 9.594 11.297 11.047 9.203 11.312C9.734 11.656 10.093 12.406 10.093 13.266L10.093 14.891C10.093 15.359 10.484 15.625 10.953 15.438C13.781 14.359 16 11.53 16 8.03C16 3.61 12.406 0 7.984 0C3.563 0 0 3.61 0 8.031C-0.009 11.347 2.058 14.314 5.172 15.453C5.594 15.609 6 15.328 6 14.906L6 13.656C5.781 13.75 5.5 13.812 5.25 13.812C4.219 13.812 3.61 13.25 3.172 12.203C3 11.781 2.812 11.531 2.453 11.484C2.266 11.469 2.203 11.391 2.203 11.297C2.203 11.109 2.516 10.969 2.828 10.969C3.281 10.969 3.672 11.25 4.078 11.829C4.391 12.281 4.718 12.484 5.109 12.484C5.5 12.484 5.75 12.344 6.109 11.984C6.375 11.719 6.579 11.484 6.766 11.328Z';
39
+
40
+ /** GitHub's mark in white, for a webhook that files issues. */
37
41
  export const githubIcon = `data:image/svg+xml,${encodeURIComponent(
38
- '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="white"><path d="M6.766 11.328C4.703 11.078 3.25 9.594 3.25 7.672C3.25 6.891 3.531 6.047 4 5.484C3.797 4.969 3.828 3.875 4.063 3.422C4.688 3.344 5.531 3.672 6.031 4.125C6.625 3.938 7.25 3.844 8.016 3.844C8.781 3.844 9.406 3.938 9.969 4.109C10.453 3.672 11.313 3.344 11.938 3.422C12.156 3.844 12.188 4.937 11.984 5.469C12.484 6.062 12.75 6.859 12.75 7.672C12.75 9.594 11.297 11.047 9.203 11.312C9.734 11.656 10.093 12.406 10.093 13.266L10.093 14.891C10.093 15.359 10.484 15.625 10.953 15.438C13.781 14.359 16 11.53 16 8.03C16 3.61 12.406 0 7.984 0C3.563 0 0 3.61 0 8.031C-0.009 11.347 2.058 14.314 5.172 15.453C5.594 15.609 6 15.328 6 14.906L6 13.656C5.781 13.75 5.5 13.812 5.25 13.812C4.219 13.812 3.61 13.25 3.172 12.203C3 11.781 2.812 11.531 2.453 11.484C2.266 11.469 2.203 11.391 2.203 11.297C2.203 11.109 2.516 10.969 2.828 10.969C3.281 10.969 3.672 11.25 4.078 11.829C4.391 12.281 4.718 12.484 5.109 12.484C5.5 12.484 5.75 12.344 6.109 11.984C6.375 11.719 6.579 11.484 6.766 11.328Z"/></svg>',
42
+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="white"><path d="${githubPath}"/></svg>`,
39
43
  )}`;
40
44
 
41
45
  /** `crypto.randomUUID` exists only in a secure context, and a phone often opens a dev server over plain HTTP. */