fix(map): stabilize layers menu and offline cache UX

This commit is contained in:
Codex
2026-08-09 20:27:06 +03:00
parent b70e165910
commit f645725e8c
8 changed files with 72 additions and 10 deletions
+7 -4
View File
@@ -49,15 +49,18 @@ test("floating surface remains bounded when its anchor is below the viewport", (
});
test("dropdown scroll keeps portal geometry stable and contained", async () => {
const styles = await readFile(
new URL("../packages/ui-core/styles.css", import.meta.url),
"utf8",
);
const [styles, dropdown] = await Promise.all([
readFile(new URL("../packages/ui-core/styles.css", import.meta.url), "utf8"),
readFile(new URL("../packages/ui-react/src/Dropdown.tsx", import.meta.url), "utf8"),
]);
const dropdownRule = styles.match(/\.nodedc-dropdown-surface \{(?<body>[\s\S]*?)\n\}/)?.groups?.body ?? "";
assert.match(dropdownRule, /box-sizing:\s*border-box;/);
assert.match(dropdownRule, /overflow:\s*auto;/);
assert.match(dropdownRule, /overscroll-behavior:\s*contain;/);
assert.match(dropdown, /new ResizeObserver\(schedulePositionUpdate\)/);
assert.match(dropdown, /resizeObserver\.observe\(surface\)/);
assert.match(dropdown, /window\.requestAnimationFrame\(updatePosition\)/);
});
test("workspace windows keep their glass rim without masked compositor overlays", async () => {
+2 -1
View File
@@ -35,6 +35,7 @@ test("existing layouts upgrade reference layers on read and renderer accepts the
assert.match(server, /referenceLayers: structuredClone\(canonicalMapReferenceLayers\)/);
assert.match(runtimeLayers, /binding\.slotId === "reference-points"/);
assert.match(runtime, /\/api\/map-gateway\/api\/map\/reference-sources\/v1\/profiles\//);
assert.match(runtime, /allowedAttributes = new Set\(\["name", "category", "network", "operator", "official_name", "local_name", "uic_ref", "wheelchair"\]\)/);
assert.match(runtime, /allowedAttributes = new Set\(\["name", "category", "network", "operator", "official_name", "local_name", "alternate_names", "uic_ref", "wheelchair"\]\)/);
assert.match(runtime, /alternate_names/);
assert.doesNotMatch(runtime, /credential|accessToken|providerEndpoint|rawPayload/);
});
+3 -1
View File
@@ -85,7 +85,7 @@ test("reference subjects remain searchable by profile labels without a provider
id: "map.reference.station.v1",
title: "Метро",
semanticTypes: ["map.station"],
label: { mode: "attributes", fields: ["name", "official_name"] },
label: { mode: "attributes", fields: ["name", "official_name", "alternate_names"] },
};
const index = buildMapSearchIndex({
runtimeBindings: [{
@@ -93,6 +93,7 @@ test("reference subjects remain searchable by profile labels without a provider
presentationProfileId: stationProfile.id,
facts: [point("osm.node.1", "map.station", {
name: "Петроградская",
alternate_names: ["Petrogradskaya station"],
provider_note: "not searchable",
})],
}],
@@ -100,6 +101,7 @@ test("reference subjects remain searchable by profile labels without a provider
});
assert.equal(searchMapSubjects(index, "петрог").at(0)?.title, "Петроградская");
assert.equal(searchMapSubjects(index, "Petrogradskaya").at(0)?.sourceId, "osm.node.1");
assert.equal(searchMapSubjects(index, "osm.node.1").at(0)?.groupTitle, "Метро");
assert.deepEqual(searchMapSubjects(index, "provider_note"), []);
});