Ship floating launcher, automatic discovery and bounded media search improvements

This commit is contained in:
karl committed 2026-10-14 11:44:15 +02:00
1 parent 01279a6b25
commit 521966a2ac
43 files changed
+3165 -267

No files matched your search

+41 -2
View File
@@ -92,6 +92,28 @@ try {
.evaluate((image) => image.complete && image.naturalWidth > 0),
"Brand asset failed to load",
);
// Capture the actual ready/empty production layout before typing. This is
// browser-rendered UI, not native window chrome or synthesized app results.
await page.waitForFunction(() =>
document.documentElement.dataset.launcherLayout === "compact" &&
document.querySelector("#query")?.value === "",
);
const compactPath = resolve(out, "launcher-empty.png");
const compactBounds = await page.locator("#app").boundingBox();
assert(compactBounds && compactBounds.width <= 720 && compactBounds.height <= 112,
"Ready empty launcher must remain a compact bar");
await page.locator("#app").screenshot({ path: compactPath, animations: "disabled" });
evidence.push({
file: "launcher-empty.png",
sha256: createHash("sha256").update(await readFile(compactPath)).digest("hex"),
query: "",
mode: "empty-ready",
result_count: 0,
selected_filename: null,
theme: "light",
capture_bounds: compactBounds,
state_assertions: { semantic_ready: true, compact_empty_layout: true, native_pixels: false },
});
async function query(text, debug = false) {
const awaited = page.waitForResponse(
(response) => {
@@ -151,6 +173,10 @@ try {
() => !document.querySelector("#preview")?.hidden,
);
if (text === "cancel the supplier partnership") {
assert(
!body.results.some((result) => ["Mountain Lake.jpg", "Night Pier.jpg"].includes(result.filename)),
"Contract results must not contain the unrelated fixture photos",
);
assert.equal(
latestMeasured.first_filename,
"Supplier Agreement.pdf",
@@ -225,9 +251,12 @@ try {
literal_query_marks: true,
actual_page_explanation: true,
why_disclosure_collapsed_by_default: true,
unrelated_photos_removed: true,
};
}
if (text === "mountains reflected in calm water") {
assert(body.results.every((result) => result.match_kind === "semantic_image"),
"Visual search shortlist must not contain the unrelated fixture documents");
assert.equal(
latestMeasured.first_filename,
"Mountain Lake.jpg",
@@ -238,7 +267,7 @@ try {
0,
"Meaning-only photo result must not invent word-level alignment",
);
latestMeasured.ui_checks = { meaning_only_image_has_no_text_marks: true };
latestMeasured.ui_checks = { meaning_only_image_has_no_text_marks: true, unrelated_documents_removed: true };
}
await page.evaluate(
() =>
@@ -249,8 +278,12 @@ try {
}
async function screenshot(name, queryText) {
assert.deepEqual(failures, [], "Frontend page errors occurred");
const pane = await page.locator(".results-pane").boundingBox();
const preview = await page.locator("#preview").boundingBox();
assert(pane && preview && preview.x >= pane.x + pane.width - 1,
"Wide result and preview panes must remain side by side");
const path = resolve(out, `${name}.png`);
await page.screenshot({ path, animations: "disabled", fullPage: false });
await page.locator("#app").screenshot({ path, animations: "disabled" });
const selected = await page.locator("#preview-title").innerText();
assert.equal(
selected,
@@ -272,7 +305,9 @@ try {
matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",
),
summary: await page.locator("#result-summary").innerText(),
capture_bounds: await page.locator("#app").boundingBox(),
state_assertions: {
wide_split_preview: true,
semantic_ready: true,
hybrid_final: true,
image_visible: name === "media-search",
@@ -366,6 +401,10 @@ try {
{
kind: "browser-rendered-production-ui-real-cpu-engine",
source,
frontend_build: {
version: JSON.parse(await readFile(resolve(repository, "apps/desktop/package.json"), "utf8")).version,
index_sha256: createHash("sha256").update(await readFile(resolve(repository, "apps/desktop/dist/index.html"))).digest("hex"),
},
viewport: { width: 1440, height: 1000 },
runner: { playwright: "1.64.0", chromium: browser.version() },
backend: {