@polishd/next 0.2.3-dev.4 → 0.2.3-dev.6
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/CHANGELOG.md +63 -0
- package/README.md +12 -5
- package/bin/init.mjs +4 -1
- package/dist/ai/actions.d.ts +7 -1
- package/dist/ai/actions.d.ts.map +1 -1
- package/dist/ai/actions.js +10 -1
- package/dist/ai/actions.js.map +1 -1
- package/dist/ai/design.d.ts +5 -1
- package/dist/ai/design.d.ts.map +1 -1
- package/dist/ai/design.js +21 -4
- package/dist/ai/design.js.map +1 -1
- package/dist/ai/issues.d.ts +22 -11
- package/dist/ai/issues.d.ts.map +1 -1
- package/dist/ai/issues.js +102 -43
- package/dist/ai/issues.js.map +1 -1
- package/dist/ai/types.d.ts +3 -0
- package/dist/ai/types.d.ts.map +1 -1
- package/dist/dashboard/design-review-card.d.ts +3 -1
- package/dist/dashboard/design-review-card.d.ts.map +1 -1
- package/dist/dashboard/design-review-card.js +14 -6
- package/dist/dashboard/design-review-card.js.map +1 -1
- package/dist/dashboard/design.d.ts.map +1 -1
- package/dist/dashboard/design.js +75 -17
- package/dist/dashboard/design.js.map +1 -1
- package/dist/dashboard/file-bug-button.d.ts +14 -0
- package/dist/dashboard/file-bug-button.d.ts.map +1 -0
- package/dist/dashboard/file-bug-button.js +37 -0
- package/dist/dashboard/file-bug-button.js.map +1 -0
- package/dist/dashboard/snapshot-actions.d.ts +15 -5
- package/dist/dashboard/snapshot-actions.d.ts.map +1 -1
- package/dist/dashboard/snapshot-actions.js +69 -24
- package/dist/dashboard/snapshot-actions.js.map +1 -1
- package/dist/dashboard/snapshots.d.ts.map +1 -1
- package/dist/dashboard/snapshots.js +58 -8
- package/dist/dashboard/snapshots.js.map +1 -1
- package/dist/dashboard/summary.d.ts.map +1 -1
- package/dist/dashboard/summary.js +8 -36
- package/dist/dashboard/summary.js.map +1 -1
- package/dist/dashboard/ui.d.ts +1 -0
- package/dist/dashboard/ui.d.ts.map +1 -1
- package/dist/dashboard/ui.js +1 -0
- package/dist/dashboard/ui.js.map +1 -1
- package/dist/dashboard/value-preview.d.ts +47 -0
- package/dist/dashboard/value-preview.d.ts.map +1 -0
- package/dist/dashboard/value-preview.js +138 -0
- package/dist/dashboard/value-preview.js.map +1 -0
- package/dist/dashboard.css +170 -50
- package/dist/server/snapshots.d.ts +69 -10
- package/dist/server/snapshots.d.ts.map +1 -1
- package/dist/server/snapshots.js +407 -158
- package/dist/server/snapshots.js.map +1 -1
- package/dist/server/value-previews.d.ts +47 -0
- package/dist/server/value-previews.d.ts.map +1 -0
- package/dist/server/value-previews.js +313 -0
- package/dist/server/value-previews.js.map +1 -0
- package/dist/shared/design-values.d.ts +71 -0
- package/dist/shared/design-values.d.ts.map +1 -0
- package/dist/shared/design-values.js +98 -0
- package/dist/shared/design-values.js.map +1 -0
- package/docs/SETUP.md +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Hover a one-off to see where it renders
|
|
6
|
+
|
|
7
|
+
The Design tab flags one-off type styles, colors and corner radii, and
|
|
8
|
+
off-grid paddings — but a flag only says *what* drifted, never *where*, and
|
|
9
|
+
"a 17px / 500 somewhere on /pricing" left the hunt to you. Hovering (or
|
|
10
|
+
focusing, or tapping) a flagged value now opens a card with a **picture of
|
|
11
|
+
the element that carries it**: ringed in the badge's amber, the rest of the
|
|
12
|
+
page dimmed, cropped wide enough to show the component it sits in — plus the
|
|
13
|
+
page, device and theme it was shot on.
|
|
14
|
+
|
|
15
|
+
- The pictures are taken by **Capture snapshot**. After each route's full
|
|
16
|
+
shots, the same browser reloads the route, finds every flagged value's
|
|
17
|
+
element with the client scanner's own rules, scrolls it into view and
|
|
18
|
+
screenshots a crop around it. Matching is by value, not by a recorded
|
|
19
|
+
selector, so the picture always shows the value really rendering at that
|
|
20
|
+
size and theme. Usually that's one extra page load per route with flagged
|
|
21
|
+
values, capped at 15 seconds per route.
|
|
22
|
+
- A value the capture looked for and never saw on screen — one that only
|
|
23
|
+
renders after a click, or at a width snapshots don't shoot — says so on its
|
|
24
|
+
card instead of showing a wrong crop. Values with no picture yet still list
|
|
25
|
+
the pages they were measured on.
|
|
26
|
+
- Pictures are stored with the snapshot's shots (on disk, or in Vercel Blob
|
|
27
|
+
when it's connected) and pruned with them. Polishd's own beacons from the
|
|
28
|
+
extra page load are answered locally, so it never lands in the analytics as
|
|
29
|
+
a visit. Snapshots captured before this release have no pictures; capture
|
|
30
|
+
again to get them.
|
|
31
|
+
|
|
5
32
|
### Issues open in a drawer, rendered as the markdown they are
|
|
6
33
|
|
|
7
34
|
An issue body on the Issues tab used to be a raw `<pre>` dump behind a
|
|
@@ -42,6 +69,42 @@ spacing rhythm, and layout-stability guidance for design bugs.
|
|
|
42
69
|
regenerating is one click. Nothing is offered without a model key, and an
|
|
43
70
|
issue polishd didn't file is refused — there's no evidence to ground.
|
|
44
71
|
|
|
72
|
+
### Design-review issues can be filed as bugs
|
|
73
|
+
|
|
74
|
+
The aesthetic review's "Breaking the system" list used to be read-only; the
|
|
75
|
+
same one-click **File bug** button the summary's losses have now sits on each
|
|
76
|
+
design issue when GitHub is connected. It runs the same verify-then-file
|
|
77
|
+
pipeline — the model checks the flagged design token (a hex color, a px value,
|
|
78
|
+
a page path) against the repository's source, files a GitHub issue with the
|
|
79
|
+
technical analysis and the review's own suggested fix when it holds up, and
|
|
80
|
+
answers "not a bug" with the reasoning when the code shows the value is
|
|
81
|
+
deliberate. Filed issues show up in the Issues tab like any other, dedupe on
|
|
82
|
+
their evidence citation, and render as their issue link when the tab reloads.
|
|
83
|
+
|
|
84
|
+
### Snapshot capture survives serverless time limits
|
|
85
|
+
|
|
86
|
+
Capturing a site snapshot on Vercel could fail with no error box at all — the
|
|
87
|
+
whole Design tab crashed into Next's error boundary. The cause: the capture ran
|
|
88
|
+
as **one long server action**, and a serverless host that hits its function
|
|
89
|
+
time limit kills the function mid-shoot, so the action rejects with no result
|
|
90
|
+
and the client had no catch for it. A connected Blob store couldn't help; the
|
|
91
|
+
request itself was the problem.
|
|
92
|
+
|
|
93
|
+
- **Capture is now chunked into one short server call per page**: begin → one
|
|
94
|
+
call per route (both devices, both themes) → finish. No single request has
|
|
95
|
+
to outlive a function time limit, so upgrading the package is the whole fix
|
|
96
|
+
— no host configuration required. In-flight state is parked in the store
|
|
97
|
+
between calls; the client contributes nothing but ids, and a new capture
|
|
98
|
+
sweeps an unfinished predecessor, images included.
|
|
99
|
+
- **Failures degrade to messages everywhere.** Every action call is caught on
|
|
100
|
+
the client (a page whose call fails is reported and skipped, not fatal),
|
|
101
|
+
and every server path returns a diagnosis instead of throwing — including
|
|
102
|
+
the previously uncaught `playwright-core` load.
|
|
103
|
+
- The capture button shows **per-page progress** ("Shooting page 3 of 7…").
|
|
104
|
+
- `polishd init` now writes `export const maxDuration = 300` into the
|
|
105
|
+
dashboard page it generates, and the docs recommend it — headroom for heavy
|
|
106
|
+
pages on hosts with strict limits, no longer a requirement.
|
|
107
|
+
|
|
45
108
|
### The dashboard streams instead of loading all at once
|
|
46
109
|
|
|
47
110
|
Every tab used to wait for its slowest query before sending a single byte —
|
package/README.md
CHANGED
|
@@ -460,17 +460,24 @@ snapshots are kept), and each snapshot is stamped with the design-metrics
|
|
|
460
460
|
fingerprint at capture time — so a snapshot taken before a round of design
|
|
461
461
|
fixes can be held against one taken after.
|
|
462
462
|
|
|
463
|
+
Each capture also pictures the flagged values in place: for every one-off type
|
|
464
|
+
style, color and radius, and the most-used off-grid paddings, it finds the
|
|
465
|
+
element carrying the value on its page and saves a ringed crop of it. Hover a
|
|
466
|
+
flagged value on the Design tab to see that picture and the page it's on.
|
|
467
|
+
|
|
463
468
|
**In production on Vercel**, capture works too — connect a
|
|
464
469
|
[Blob store](https://vercel.com/docs/vercel-blob) to the project and that's
|
|
465
470
|
the whole setup: the `BLOB_READ_WRITE_TOKEN` it injects switches image storage
|
|
466
471
|
from disk to Blob, and the browser comes from `@sparticuz/chromium` (a
|
|
467
472
|
Chromium built for serverless sandboxes, installed automatically as an
|
|
468
473
|
optional dependency). The snapshot index rides in the same database the rest
|
|
469
|
-
of Polishd already requires in production, so no other wiring changes.
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
+
of Polishd already requires in production, so no other wiring changes. Capture
|
|
475
|
+
runs as one short server call per page, so it fits inside serverless function
|
|
476
|
+
time limits; if a single heavy page still brushes against a strict limit,
|
|
477
|
+
`export const maxDuration = 300` in the dashboard's `page.tsx` adds headroom
|
|
478
|
+
(`polishd init` writes it for you). On hosts with neither a writable
|
|
479
|
+
filesystem nor a Blob token, the button explains what's missing rather than
|
|
480
|
+
failing silently.
|
|
474
481
|
|
|
475
482
|
## Component-level tracking
|
|
476
483
|
|
package/bin/init.mjs
CHANGED
|
@@ -140,7 +140,10 @@ export function runInit(argv, cwd) {
|
|
|
140
140
|
`import { createPolishdPage } from "@polishd/next/dashboard";\n\n` +
|
|
141
141
|
`// Next requires these to be declared inline in the page module.\n` +
|
|
142
142
|
`export const runtime = "nodejs";\n` +
|
|
143
|
-
`export const dynamic = "force-dynamic";\n
|
|
143
|
+
`export const dynamic = "force-dynamic";\n` +
|
|
144
|
+
`// Server actions inherit this page's time limit; 300s gives\n` +
|
|
145
|
+
`// site-snapshot capture headroom on hosts with strict function limits.\n` +
|
|
146
|
+
`export const maxDuration = 300;\n\n` +
|
|
144
147
|
`// In production the dashboard refuses to render until you either set\n` +
|
|
145
148
|
`// POLISHD_DASHBOARD_TOKEN, pass your own \`authenticate\`, or opt out\n` +
|
|
146
149
|
`// explicitly with POLISHD_DASHBOARD_PUBLIC=true. It can change your AI\n` +
|
package/dist/ai/actions.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ListModelsInput, type SaveAISettingsInput } from "./settings";
|
|
2
|
-
import type { PolishdAISettingsPublic, PolishdLossItem, CreateIssueResult, GenerateDesignReviewResult, GenerateProfileResult, GenerateSummaryResult, IgnoreLossResult, ListModelsResult, SuggestFixResult, UnignoreLossResult, VerifyGithubResult } from "./types";
|
|
2
|
+
import type { PolishdAISettingsPublic, PolishdDesignIssue, PolishdLossItem, CreateIssueResult, GenerateDesignReviewResult, GenerateProfileResult, GenerateSummaryResult, IgnoreLossResult, ListModelsResult, SuggestFixResult, UnignoreLossResult, VerifyGithubResult } from "./types";
|
|
3
3
|
/** Generate or refresh the narrative. `force` re-asks the model even if data is unchanged. */
|
|
4
4
|
export declare function generateSummaryAction(force?: boolean): Promise<GenerateSummaryResult>;
|
|
5
5
|
/**
|
|
@@ -31,6 +31,12 @@ export declare function verifyGithubAction(): Promise<VerifyGithubResult>;
|
|
|
31
31
|
* disproved report returns `not-a-bug` with the reasoning instead of filing.
|
|
32
32
|
*/
|
|
33
33
|
export declare function createIssueFromLossAction(loss: Pick<PolishdLossItem, "issue" | "evidence" | "location">): Promise<CreateIssueResult>;
|
|
34
|
+
/**
|
|
35
|
+
* The same verify-then-file pipeline for one of the design review's issues —
|
|
36
|
+
* the evidence is a measured design token (hex, px value, page path) instead
|
|
37
|
+
* of an analytics identifier.
|
|
38
|
+
*/
|
|
39
|
+
export declare function createIssueFromDesignIssueAction(issue: Pick<PolishdDesignIssue, "issue" | "evidence" | "suggestion">): Promise<CreateIssueResult>;
|
|
34
40
|
/**
|
|
35
41
|
* Classify one filed issue (interaction vs design) and propose a fix grounded
|
|
36
42
|
* in the repository's source and in published practice, with the file-by-file
|
package/dist/ai/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/ai/actions.ts"],"names":[],"mappings":"AAuBA,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,0BAA0B,EA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,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,EACnB,KAAK,UAAQ,GACZ,OAAO,CAAC,gBAAgB,CAAC,CAG3B;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,UAAU,CAAC,EACjD,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAED,kEAAkE;AAClE,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAKtF"}
|
package/dist/ai/actions.js
CHANGED
|
@@ -17,7 +17,7 @@ import { generateDesignReview } from "./design";
|
|
|
17
17
|
import { suggestIssueFix } from "./fix";
|
|
18
18
|
import { verifyGithubConnection } from "./github";
|
|
19
19
|
import { ignoreLoss, unignoreLoss } from "./ignored";
|
|
20
|
-
import { createIssueFromLoss } from "./issues";
|
|
20
|
+
import { createIssueFromDesignIssue, createIssueFromLoss } from "./issues";
|
|
21
21
|
import { generateProjectProfile } from "./profile";
|
|
22
22
|
import { loadPolishdDashboardData } from "../server/queries";
|
|
23
23
|
import { listModelsForProvider, saveAISettings, } from "./settings";
|
|
@@ -75,6 +75,15 @@ export async function createIssueFromLossAction(loss) {
|
|
|
75
75
|
await requirePolishdAuth();
|
|
76
76
|
return createIssueFromLoss(loss);
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* The same verify-then-file pipeline for one of the design review's issues —
|
|
80
|
+
* the evidence is a measured design token (hex, px value, page path) instead
|
|
81
|
+
* of an analytics identifier.
|
|
82
|
+
*/
|
|
83
|
+
export async function createIssueFromDesignIssueAction(issue) {
|
|
84
|
+
await requirePolishdAuth();
|
|
85
|
+
return createIssueFromDesignIssue(issue);
|
|
86
|
+
}
|
|
78
87
|
/**
|
|
79
88
|
* Classify one filed issue (interaction vs design) and propose a fix grounded
|
|
80
89
|
* in the repository's source and in published practice, with the file-by-file
|
package/dist/ai/actions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/ai/actions.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/ai/actions.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,qBAAqB,EACrB,cAAc,GAGf,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAgB5C,8FAA8F;AAC9F,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,KAAK,GAAG,KAAK;IACvD,MAAM,kBAAk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,CAAC,KAAK,UAAU,qBAAqB,CACzC,WAAmB,EACnB,KAAK,GAAG,KAAK;IAEb,MAAM,kBAAkB,EAAE,CAAC;IAC3B,OAAO,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,IAAiD,EACjD,MAAe;IAEf,MAAM,kBAAkB,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,OAAO;QACZ,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;QACvB,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,mEAAmE,EAAE,CAAC;AAClG,CAAC;AAED,kEAAkE;AAClE,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,QAAgB;IACvD,MAAM,kBAAkB,EAAE,CAAC;IAC3B,OAAO,CAAC,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC;QACnC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE;QACd,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,mEAAmE,EAAE,CAAC;AAClG,CAAC"}
|
package/dist/ai/design.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { type PolishdDesignData } from "../server/design";
|
|
2
2
|
import type { GenerateDesignReviewResult, PolishdDesignReview } from "./types";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The last generated review, or null. Read-only — never calls a model. Issues
|
|
5
|
+
* whose evidence already has a GitHub issue in the log come back with the link
|
|
6
|
+
* attached, so the tab renders it instead of a "file bug" button.
|
|
7
|
+
*/
|
|
4
8
|
export declare function loadDesignReview(): Promise<PolishdDesignReview | null>;
|
|
5
9
|
/**
|
|
6
10
|
* Render the aggregated design data as a terse, model-readable brief.
|
package/dist/ai/design.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../src/ai/design.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"design.d.ts","sourceRoot":"","sources":["../../src/ai/design.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAKzE,OAAO,KAAK,EACV,0BAA0B,EAE1B,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAIjB;;;;GAIG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAa5E;AAsBD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAmEnF;AAgED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC7B,OAAO,CAAC,0BAA0B,CAAC,CAuErC;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,SAAS,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC;IAClF,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC,CASD"}
|
package/dist/ai/design.js
CHANGED
|
@@ -16,20 +16,30 @@
|
|
|
16
16
|
import { getMeta, setMeta } from "../server/store";
|
|
17
17
|
import { getDesignData } from "../server/design";
|
|
18
18
|
import { fingerprintDigest } from "./digest";
|
|
19
|
+
import { attachGithubIssuesToDesignIssues } from "./issues";
|
|
19
20
|
import { callModel } from "./providers";
|
|
20
21
|
import { resolveSettings } from "./settings";
|
|
21
22
|
const DESIGN_REVIEW_KEY = "ai_design_review";
|
|
22
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The last generated review, or null. Read-only — never calls a model. Issues
|
|
25
|
+
* whose evidence already has a GitHub issue in the log come back with the link
|
|
26
|
+
* attached, so the tab renders it instead of a "file bug" button.
|
|
27
|
+
*/
|
|
23
28
|
export async function loadDesignReview() {
|
|
24
29
|
const raw = await getMeta(DESIGN_REVIEW_KEY);
|
|
25
30
|
if (!raw)
|
|
26
31
|
return null;
|
|
32
|
+
let review;
|
|
27
33
|
try {
|
|
28
|
-
|
|
34
|
+
review = JSON.parse(raw);
|
|
29
35
|
}
|
|
30
36
|
catch {
|
|
31
37
|
return null;
|
|
32
38
|
}
|
|
39
|
+
if (review.issues?.length) {
|
|
40
|
+
review.issues = await attachGithubIssuesToDesignIssues(review.issues);
|
|
41
|
+
}
|
|
42
|
+
return review;
|
|
33
43
|
}
|
|
34
44
|
const SYSTEM_PROMPT = "You are a senior brand and product designer reviewing a shipped website. " +
|
|
35
45
|
"You receive design tokens reverse-engineered from the rendered pages — the " +
|
|
@@ -214,18 +224,25 @@ export async function generateDesignReview(opts = {}) {
|
|
|
214
224
|
};
|
|
215
225
|
}
|
|
216
226
|
const parsed = parseStructured(reply.text);
|
|
227
|
+
const issues = verifyIssues(parsed.issues, digest);
|
|
217
228
|
const review = {
|
|
218
229
|
text: parsed.assessment,
|
|
219
230
|
strengths: parsed.strengths,
|
|
220
|
-
issues
|
|
231
|
+
issues,
|
|
221
232
|
provider: settings.provider,
|
|
222
233
|
model: settings.model,
|
|
223
234
|
generatedAt: Date.now(),
|
|
224
235
|
fingerprint,
|
|
225
236
|
usage: reply.usage,
|
|
226
237
|
};
|
|
238
|
+
// Persisted without issue links — those live in the issue log and are
|
|
239
|
+
// attached on every read, so the cached review can't hold a stale link.
|
|
227
240
|
await setMeta(DESIGN_REVIEW_KEY, JSON.stringify(review));
|
|
228
|
-
return {
|
|
241
|
+
return {
|
|
242
|
+
ok: true,
|
|
243
|
+
review: { ...review, issues: await attachGithubIssuesToDesignIssues(issues) },
|
|
244
|
+
regenerated: true,
|
|
245
|
+
};
|
|
229
246
|
}
|
|
230
247
|
/**
|
|
231
248
|
* For the Design tab's first render: the cached review plus whether the live
|
package/dist/ai/design.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design.js","sourceRoot":"","sources":["../../src/ai/design.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAA0B,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAO7C,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAE7C
|
|
1
|
+
{"version":3,"file":"design.js","sourceRoot":"","sources":["../../src/ai/design.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAA0B,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAO7C,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC7C,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,IAAI,MAA2B,CAAC;IAChC,IAAI,CAAC;Q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AAE;KACzD,CAAC,CAAC;IACH,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC5E,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,eAAe,EAAE,CAAC;IAC7C,MAAM,WAAW,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACjF,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;AAClF,CAAC"}
|
package/dist/ai/issues.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type { PolishdFiledIssue, PolishdLossItem, CreateIssueResult } from "./types";
|
|
2
|
-
/** The slice of a loss the pipeline needs. */
|
|
1
|
+
import type { PolishdDesignIssue, PolishdFiledIssue, PolishdLossItem, CreateIssueResult } from "./types";
|
|
2
|
+
/** The slice of a summary loss the pipeline needs. */
|
|
3
3
|
type Loss = Pick<PolishdLossItem, "issue" | "evidence" | "location">;
|
|
4
|
+
/** The slice of a design-review issue the pipeline needs. */
|
|
5
|
+
type DesignIssue = Pick<PolishdDesignIssue, "issue" | "evidence" | "suggestion">;
|
|
4
6
|
/**
|
|
5
|
-
* The local record behind one filed issue number — the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* The local record behind one filed issue number — the citation and claim
|
|
8
|
+
* GitHub was never told. The fix pipeline (`fix.ts`) uses it to search the
|
|
9
|
+
* source for the right element, and its absence is how a number that isn't
|
|
10
|
+
* ours gets refused.
|
|
9
11
|
*/
|
|
10
12
|
export declare function findFiledIssue(number: number): Promise<{
|
|
11
13
|
evidence: string;
|
|
@@ -13,13 +15,22 @@ export declare function findFiledIssue(number: number): Promise<{
|
|
|
13
15
|
} | null>;
|
|
14
16
|
/** Terms specific enough to search code for (same spirit as citationTokens). */
|
|
15
17
|
export declare function evidenceSearchTerms(evidence: string): string[];
|
|
18
|
+
/** File a bug from one summary loss. */
|
|
19
|
+
export declare function createIssueFromLoss(loss: Loss): Promise<CreateIssueResult>;
|
|
16
20
|
/**
|
|
17
|
-
* File a bug from one
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
* File a bug from one design-review issue — the same verify-then-file pipeline
|
|
22
|
+
* with the design framing: the evidence is a measured design token rather than
|
|
23
|
+
* an analytics identifier, so verification searches the source for wherever
|
|
24
|
+
* that value is produced.
|
|
21
25
|
*/
|
|
22
|
-
export declare function
|
|
26
|
+
export declare function createIssueFromDesignIssue(issue: DesignIssue): Promise<CreateIssueResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Attach already-filed GitHub issues to a design review's issues, keyed by the
|
|
29
|
+
* evidence citation — read-only decoration for the Design tab, so a problem
|
|
30
|
+
* that's already in the tracker renders as its issue link instead of a "file
|
|
31
|
+
* bug" button. Never files anything.
|
|
32
|
+
*/
|
|
33
|
+
export declare function attachGithubIssuesToDesignIssues(issues: PolishdDesignIssue[]): Promise<PolishdDesignIssue[]>;
|
|
23
34
|
/**
|
|
24
35
|
* Decorate a fresh summary's losses with their GitHub issues: attach the link
|
|
25
36
|
* for anything already filed and — when the owner enabled auto-filing — run
|
package/dist/ai/issues.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../src/ai/issues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../src/ai/issues.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,sDAAsD;AACtD,KAAK,IAAI,GAAG,IAAI,CAAC,eAAe,EAAE,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC,CAAC;AAErE,6DAA6D;AAC7D,KAAK,WAAW,GAAG,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,UAAU,GAAG,YAAY,CAAC,CAAC;AAsGjF;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAOtD;AAoBD,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAY9D;AA8OD,wCAAwC;AACxC,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAEhF;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,WAAW,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAE5B;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,kBAAkB,EAAE,GAC3B,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAS/B;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAoB9F;AAoBD;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA8BpE"}
|