feat(update): integrate managed installs and recoverable in-app updates (#6168)
Add owner-aware Stable and Preview updates with explicit consent, verified release plans, protected process handoff and bounded service recovery. Keep configuration and conversations separate from program rollback. Include the compact About controls, Windows long-path support, native package recovery checks and optional macOS Dock lifecycle integration. Preserve documented guidance for installations owned by other managers. This code integration does not publish packages, enable signing or advance the public update channel. Co-authored-by: chengyongru <61816729+chengyongru@users.noreply.github.com>
This commit is contained in:
1 parent
76da55994b
commit
fbb61a373f
216 files changed
+27948
-1084
No files matched your search
@@ -0,0 +1,45 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("About current-version feedback keeps its initial row height with wider system fonts", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
await page.addInitScript(() => localStorage.setItem("nanobot.locale", "en"));
|
||||
const positions: number[] = [];
|
||||
for (const state of ["loaded", "loading"]) {
|
||||
await page.goto(`/browser/fixture.html?case=skeleton-additions&surface=settings&state=${state}§ion=about`);
|
||||
await page.addStyleTag({ content: "body { font-family: monospace; }" });
|
||||
if (state === "loaded") await expect(page.getByText("You're up to date", { exact: true })).toBeVisible();
|
||||
const row = page.locator("[data-settings-section] .settings-list-row").first();
|
||||
await expect(row).toBeVisible();
|
||||
positions.push((await row.boundingBox())!.y);
|
||||
expect(await page.evaluate(() => document.documentElement.scrollWidth > innerWidth)).toBe(false);
|
||||
}
|
||||
expect(Math.abs(positions[0] - positions[1])).toBeLessThan(0.5);
|
||||
});
|
||||
|
||||
for (const state of ["loaded", "loading"]) {
|
||||
test(`About ${state} reserves the wordmark before its image loads`, async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1440, height: 1000 });
|
||||
await page.emulateMedia({ reducedMotion: "reduce" });
|
||||
let release!: () => void;
|
||||
const pendingImage = new Promise<void>(resolve => { release = resolve; });
|
||||
await page.route("**/brand/nanobot_wordmark.svg", async route => {
|
||||
await pendingImage;
|
||||
await route.continue();
|
||||
});
|
||||
try {
|
||||
await page.goto(`/browser/fixture.html?case=skeleton-additions&surface=settings&state=${state}§ion=about`, { waitUntil: "domcontentloaded" });
|
||||
const row = page.locator("[data-settings-section] .settings-list-row").first();
|
||||
await expect(row).toBeVisible();
|
||||
const before = await row.boundingBox();
|
||||
release();
|
||||
const wordmark = page.locator('img[alt="nanobot"]');
|
||||
await expect(wordmark).toHaveJSProperty("complete", true);
|
||||
expect(await wordmark.evaluate(image => (image as HTMLImageElement).naturalWidth)).toBeGreaterThan(0);
|
||||
const after = await row.boundingBox();
|
||||
expect(Math.abs(after!.y - before!.y)).toBeLessThan(0.5);
|
||||
} finally {
|
||||
release();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -19,10 +19,10 @@ async function boxes(locator: Locator) {
|
||||
}));
|
||||
}
|
||||
|
||||
function sameBoxes(actual: Awaited<ReturnType<typeof boxes>>, expected: typeof actual) {
|
||||
function sameBoxes(actual: Awaited<ReturnType<typeof boxes>>, expected: typeof actual, surface = "") {
|
||||
expect(actual).toHaveLength(expected.length);
|
||||
for (let index = 0; index < actual.length; index++) for (const key of ["x", "y", "width", "height"] as const) {
|
||||
expect(Math.abs(actual[index][key] - expected[index][key]), `row ${index} ${key}`).toBeLessThan(0.5);
|
||||
expect(Math.abs(actual[index][key] - expected[index][key]), `${surface} row ${index} ${key}: ${JSON.stringify({ actual: actual[index], expected: expected[index] })}`).toBeLessThan(0.5);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ for (const width of [390, 1440]) for (const locale of ["en", "zh-CN"]) {
|
||||
await settle(page);
|
||||
const skeletonSelector = section === "overview" ? "[data-overview-skeleton-row]" : section === "models" ? "[data-model-preset-skeleton], .settings-footer" : section === "about" ? ".settings-list-row" : "[data-settings-skeleton-row]";
|
||||
const skeleton = await boxes(target.locator(skeletonSelector + notificationDetails));
|
||||
sameBoxes(skeleton, loaded);
|
||||
sameBoxes(skeleton, loaded, section);
|
||||
if (readingControl) sameBoxes(await boxes(target.locator("[data-skeleton-reading-size]")), readingControl);
|
||||
if (loadedControls) {
|
||||
const skeletonControls = await boxes(target.locator("[data-skeleton-switch]"));
|
||||
|
||||
Reference in new issue
Block a user