Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "Browservorschau",
"49de6209699eb616": "Unbenannter Passkey",
"b4a5bb1075d95154": "Passkey auswählen",
"61aa0109862ff7ca": "Nightly",
"f3430cac09a505a0": "Stable",
"1f12213f4d809e89": "Du bist auf dem neuesten Stand!",
"c6399b55619e2f67": "T3 Code {version} ist derzeit die neueste verfügbare Version.",
"b6e5b31255e011c5": "OK",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "Neu starten",
"116a21f6cc215e5f": "Suche nach Updates fehlgeschlagen",
"32c88cd9421abf33": "Es konnte nicht nach Updates gesucht werden.",
"9e5ada64a94c10de": "Dieser {build}-Build kann sich über den Kanal {saved} nicht selbst aktualisieren. Stelle den Update-Kanal wieder auf {build} um oder nutze Review neben Update-Kanal, um den Wechsel zu {saved} erneut zu versuchen.",
"b37aca07d3c644d9": "Ein unbekannter Fehler ist aufgetreten. Bitte versuche es später erneut.",
"c8c23435e780a60c": "Updates nicht verfügbar",
"aecf7c98b81bef7a": "Automatische Updates sind derzeit nicht verfügbar.",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "Browser preview",
"49de6209699eb616": "Unnamed passkey",
"b4a5bb1075d95154": "Choose a passkey",
"61aa0109862ff7ca": "Nightly",
"f3430cac09a505a0": "Stable",
"1f12213f4d809e89": "You're up to date!",
"c6399b55619e2f67": "T3 Code {version} is currently the newest version available.",
"b6e5b31255e011c5": "OK",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "Restart",
"116a21f6cc215e5f": "Update check failed",
"32c88cd9421abf33": "Could not check for updates.",
"9e5ada64a94c10de": "This {build} build can't update from the {saved} track on its own. Switch the update track back to {build}, or use Review beside Update track to retry the switch to {saved}.",
"b37aca07d3c644d9": "An unknown error occurred. Please try again later.",
"c8c23435e780a60c": "Updates unavailable",
"aecf7c98b81bef7a": "Automatic updates are not available right now.",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "Vista previa del navegador",
"49de6209699eb616": "Llave de acceso sin nombre",
"b4a5bb1075d95154": "Elige una llave de acceso",
"61aa0109862ff7ca": "Nightly",
"f3430cac09a505a0": "Estable",
"1f12213f4d809e89": "¡Estás al día!",
"c6399b55619e2f67": "T3 Code {version} es la versión más reciente disponible.",
"b6e5b31255e011c5": "Aceptar",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "Reiniciar",
"116a21f6cc215e5f": "Error al buscar actualizaciones",
"32c88cd9421abf33": "No se pudo buscar actualizaciones.",
"9e5ada64a94c10de": "Esta compilación {build} no puede actualizarse por sí sola desde el canal {saved}. Vuelve a poner el canal de actualizaciones en {build} o usa Revisar junto a Canal de actualizaciones para reintentar el cambio a {saved}.",
"b37aca07d3c644d9": "Se produjo un error desconocido. Vuelve a intentarlo más tarde.",
"c8c23435e780a60c": "Actualizaciones no disponibles",
"aecf7c98b81bef7a": "Las actualizaciones automáticas no están disponibles ahora mismo.",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "Aperçu du navigateur",
"49de6209699eb616": "Clé d’accès sans nom",
"b4a5bb1075d95154": "Choisir une clé d’accès",
"61aa0109862ff7ca": "Nightly",
"f3430cac09a505a0": "Stable",
"1f12213f4d809e89": "Vous êtes à jour !",
"c6399b55619e2f67": "T3 Code {version} est actuellement la version la plus récente.",
"b6e5b31255e011c5": "OK",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "Redémarrer",
"116a21f6cc215e5f": "Échec de la recherche de mises à jour",
"32c88cd9421abf33": "Impossible de rechercher des mises à jour.",
"9e5ada64a94c10de": "Cette version {build} ne peut pas se mettre à jour seule depuis le canal {saved}. Remettez le canal de mise à jour sur {build}, ou utilisez Consulter à côté de Canal de mise à jour pour relancer le passage à {saved}.",
"b37aca07d3c644d9": "Une erreur inconnue s’est produite. Veuillez réessayer plus tard.",
"c8c23435e780a60c": "Mises à jour indisponibles",
"aecf7c98b81bef7a": "Les mises à jour automatiques ne sont pas disponibles pour le moment.",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "ブラウザープレビュー",
"49de6209699eb616": "名前のないパスキー",
"b4a5bb1075d95154": "パスキーを選択",
"61aa0109862ff7ca": "Nightly",
"f3430cac09a505a0": "安定版",
"1f12213f4d809e89": "最新の状態です",
"c6399b55619e2f67": "T3 Code {version} が現在利用できる最新バージョンです。",
"b6e5b31255e011c5": "OK",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "再起動",
"116a21f6cc215e5f": "更新の確認に失敗しました",
"32c88cd9421abf33": "更新を確認できませんでした。",
"9e5ada64a94c10de": "この {build} ビルドは {saved} トラックから単独では更新できません。更新トラックを {build} に戻すか、更新トラックの横にある「レビュー」を使って {saved} への切り替えを再試行してください。",
"b37aca07d3c644d9": "不明なエラーが発生しました。しばらくしてからもう一度お試しください。",
"c8c23435e780a60c": "更新を利用できません",
"aecf7c98b81bef7a": "現在、自動更新は利用できません。",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "브라우저 미리 보기",
"49de6209699eb616": "이름 없는 패스키",
"b4a5bb1075d95154": "패스키 선택",
"61aa0109862ff7ca": "Nightly",
"f3430cac09a505a0": "Stable",
"1f12213f4d809e89": "최신 버전입니다!",
"c6399b55619e2f67": "T3 Code {version}이(가) 현재 사용 가능한 최신 버전입니다.",
"b6e5b31255e011c5": "확인",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "다시 시작",
"116a21f6cc215e5f": "업데이트 확인 실패",
"32c88cd9421abf33": "업데이트를 확인할 수 없습니다.",
"9e5ada64a94c10de": "이 {build} 빌드는 {saved} 트랙에서 스스로 업데이트할 수 없습니다. 업데이트 트랙을 다시 {build}(으)로 바꾸거나, 업데이트 트랙 옆의 검토를 사용해 {saved}(으)로 전환을 다시 시도하세요.",
"b37aca07d3c644d9": "알 수 없는 오류가 발생했습니다. 나중에 다시 시도하세요.",
"c8c23435e780a60c": "업데이트를 사용할 수 없음",
"aecf7c98b81bef7a": "지금은 자동 업데이트를 사용할 수 없습니다.",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "Pré-visualização do navegador",
"49de6209699eb616": "Chave de acesso sem nome",
"b4a5bb1075d95154": "Escolha uma chave de acesso",
"61aa0109862ff7ca": "Nightly",
"f3430cac09a505a0": "Estável",
"1f12213f4d809e89": "Você está atualizado!",
"c6399b55619e2f67": "O T3 Code {version} é a versão mais recente disponível.",
"b6e5b31255e011c5": "OK",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "Reiniciar",
"116a21f6cc215e5f": "Falha ao verificar atualizações",
"32c88cd9421abf33": "Não foi possível verificar atualizações.",
"9e5ada64a94c10de": "Esta build {build} não consegue se atualizar sozinha pelo canal {saved}. Volte o canal de atualização para {build} ou use Revisar ao lado de Canal de atualização para tentar de novo a mudança para {saved}.",
"b37aca07d3c644d9": "Ocorreu um erro desconhecido. Tente novamente mais tarde.",
"c8c23435e780a60c": "Atualizações indisponíveis",
"aecf7c98b81bef7a": "As atualizações automáticas não estão disponíveis no momento.",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "Предпросмотр в браузере",
"49de6209699eb616": "Безымянный ключ доступа",
"b4a5bb1075d95154": "Выберите ключ доступа",
"61aa0109862ff7ca": "Nightly",
"f3430cac09a505a0": "Стабильный",
"1f12213f4d809e89": "У вас последняя версия!",
"c6399b55619e2f67": "T3 Code {version} — новейшая доступная версия.",
"b6e5b31255e011c5": "OK",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "Перезапустить",
"116a21f6cc215e5f": "Ошибка проверки обновлений",
"32c88cd9421abf33": "Не удалось проверить обновления.",
"9e5ada64a94c10de": "Эта сборка {build} не может сама обновиться с канала «{saved}». Верните канал обновлений на «{build}» или нажмите «Ревью» рядом с «Канал обновлений», чтобы повторить переход на «{saved}».",
"b37aca07d3c644d9": "Произошла неизвестная ошибка. Повторите попытку позже.",
"c8c23435e780a60c": "Обновления недоступны",
"aecf7c98b81bef7a": "Автоматические обновления сейчас недоступны.",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "Förhandsvisning i webbläsaren",
"49de6209699eb616": "Namnlös lösenordsnyckel",
"b4a5bb1075d95154": "Välj en lösenordsnyckel",
"61aa0109862ff7ca": "Nightly",
"f3430cac09a505a0": "Stable",
"1f12213f4d809e89": "Du har den senaste versionen!",
"c6399b55619e2f67": "T3 Code {version} är den senaste tillgängliga versionen.",
"b6e5b31255e011c5": "OK",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "Starta om",
"116a21f6cc215e5f": "Sökningen efter uppdateringar misslyckades",
"32c88cd9421abf33": "Kunde inte söka efter uppdateringar.",
"9e5ada64a94c10de": "Den här {build}-versionen kan inte uppdatera sig själv från spåret {saved}. Byt tillbaka uppdateringsspåret till {build}, eller använd Granska bredvid Uppdateringsspår för att försöka byta till {saved} igen.",
"b37aca07d3c644d9": "Ett okänt fel inträffade. Försök igen senare.",
"c8c23435e780a60c": "Uppdateringar är inte tillgängliga",
"aecf7c98b81bef7a": "Automatiska uppdateringar är inte tillgängliga just nu.",
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/i18n/translations/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"6994444f4fec4070": "浏览器预览",
"49de6209699eb616": "未命名通行密钥",
"b4a5bb1075d95154": "选择通行密钥",
"61aa0109862ff7ca": "Nightly 版",
"f3430cac09a505a0": "稳定版",
"1f12213f4d809e89": "已是最新版本!",
"c6399b55619e2f67": "T3 Code {version} 已是最新版本。",
"b6e5b31255e011c5": "确定",
Expand All @@ -74,6 +76,7 @@
"2f0a8211a72e29aa": "重启",
"116a21f6cc215e5f": "检查更新失败",
"32c88cd9421abf33": "无法检查更新。",
"9e5ada64a94c10de": "此 {build} 构建无法自行从 {saved} 通道更新。请将更新通道切回 {build},或使用“更新通道”旁的“查看”重新尝试切换到 {saved}。",
"b37aca07d3c644d9": "发生未知错误,请稍后重试。",
"c8c23435e780a60c": "更新不可用",
"aecf7c98b81bef7a": "目前无法自动更新。",
Expand Down
24 changes: 21 additions & 3 deletions apps/desktop/src/preview/Manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2415,10 +2415,18 @@ describe("PreviewManager", () => {
Effect.gen(function* () {
const host = yield* DesktopBrowserHost.DesktopBrowserHost;
const serverTab = { threadId: "thread-1", tabId: "server-tab-1" };
const windowThrottling = vi.fn<(enabled: boolean) => void>();
const mainWebContents = Object.assign(makeTestHostWebContents(), {
setBackgroundThrottling: windowThrottling,
});
const contents = Object.assign(
makeTestPreviewWebContents(async () => {
throw new Error("unused");
}, 42),
makeTestPreviewWebContents(
async () => {
throw new Error("unused");
},
42,
mainWebContents,
),
{
isDevToolsOpened: () => false,
getUserAgent: () => "Electron",
Expand All @@ -2431,6 +2439,11 @@ describe("PreviewManager", () => {
) as unknown as typeof contents.debugger.sendCommand;
fromId.mockReturnValue(contents);
const manager = yield* PreviewManager.PreviewManager;
yield* manager.setMainWindow({
isDestroyed: () => false,
once: vi.fn(),
webContents: mainWebContents,
} as never);
const capturing = yield* Queue.unbounded<boolean>();
yield* manager.subscribeStateChanges((_tabId, state) =>
Queue.offer(capturing, state.capturing).pipe(Effect.asVoid),
Expand Down Expand Up @@ -2463,9 +2476,14 @@ describe("PreviewManager", () => {
}),
);
expect(yield* Queue.take(capturing)).toBe(true);
// A locked or covered window paints a guest it had hidden only while unthrottled.
expect(windowThrottling.mock.calls).toEqual([[false]]);
expect(contents.setBackgroundThrottling.mock.calls).toEqual([[false]]);
yield* manager.setCaptureDrawn("tab_1", true);
screenshot.resolve({ data: "" });
expect(yield* Queue.take(capturing)).toBe(false);
expect(windowThrottling.mock.calls).toEqual([[false], [true]]);
expect(contents.setBackgroundThrottling.mock.calls).toEqual([[false], [true]]);
}).pipe(Effect.provide(managerLayer())),
);

Expand Down
21 changes: 21 additions & 0 deletions apps/desktop/src/preview/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3623,6 +3623,8 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
{ discard: true },
);
});
// A hidden or locked window draws no frames, so a guest it hid stays unpainted until unthrottled.
const serverCaptureLeases = new Map<string, { readonly tabId: string; readonly lease: symbol }>();
const updateServerTabCapturing = Effect.fn("PreviewManager.updateServerTabCapturing")(
function* (painting: {
readonly key: { readonly threadId: string; readonly tabId: string };
Expand All @@ -3633,6 +3635,25 @@ const makeNativeOperations = Effect.fn("PreviewManager.makeOperations")(function
candidate.serverTab?.threadId === painting.key.threadId &&
candidate.serverTab.tabId === painting.key.tabId,
);
const key = `${painting.key.threadId}\u0000${painting.key.tabId}`;
const held = serverCaptureLeases.get(key);
if (!painting.active && held) {
serverCaptureLeases.delete(key);
yield* stopFrameCapture(held.tabId, held.lease);
} else if (painting.active && !held && tab) {
const lease = Symbol("server-capture");
yield* startFrameCapture(tab.tabId, lease).pipe(
Effect.andThen(
Effect.sync(() => serverCaptureLeases.set(key, { tabId: tab.tabId, lease })),
),
Effect.catch((error) =>
Effect.logWarning("Failed to unthrottle a server tab for its capture.", {
tabId: tab.tabId,
error,
}),
),
);
}
if (tab && tab.capturing !== painting.active) {
yield* update(tab.tabId, { capturing: painting.active });
}
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/settings/DesktopClientSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const clientSettings: ClientSettings = {
browserDefaultAppearance: "dark",
browserRecordingFrameRate: 60,
browserLinkTarget: "app",
sideThreadOpenTarget: "main",
browserAutoShowFloatingPreview: false,
browserProfiles: [{ id: "work", name: "Work", kind: "persistent" }],
browserDefaultProfileId: "work",
Expand Down
76 changes: 71 additions & 5 deletions apps/desktop/src/updates/DesktopUpdates.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ const stableUpdateInfo = (
};
};

// Subscribes before emitting, so the state the emit publishes is the one awaited, not a scheduler yield.
const nextPublishedState = (emit: () => void) =>
Effect.gen(function* () {
const updates = yield* DesktopUpdates.DesktopUpdates;
const { changes } = yield* updates.subscribe;
const published = yield* Stream.runHead(changes).pipe(Effect.forkChild);
emit();
yield* Fiber.join(published);
return yield* updates.getState;
});

describe("DesktopUpdates", () => {
it.effect("updates Linux .deb installs and leaves other non-AppImage installs off", () =>
Effect.gen(function* () {
Expand Down Expand Up @@ -1191,16 +1202,49 @@ describe("DesktopUpdates", () => {
const updates = yield* DesktopUpdates.DesktopUpdates;
yield* updates.configure;
yield* updates.check("startup");
harness.emit("update-available", { version: "1.2.4-nightly.20261027.1" });
yield* flushCallbacks;

assert.equal((yield* updates.getState).channel, "nightly");
assert.isNull((yield* updates.getState).availableVersion);
const state = yield* nextPublishedState(() =>
harness.emit("update-available", { version: "1.2.4-nightly.20261027.1" }),
);
assert.equal(state.channel, "nightly");
assert.isNull(state.availableVersion);
assert.equal(state.status, "error");
assert.equal(state.errorContext, "check");
assert.isTrue(state.canRetry);
assert.deepEqual(state.trackMismatch, { buildChannel: "latest" });
assert.deepEqual(harness.checkAllowedDowngrade, [false]);
}),
).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
});

it.effect("reports a track mismatch when the feed offers no release at all", () => {
const harness = makeHarness({ savedChannel: "nightly" });

return Effect.scoped(
Effect.gen(function* () {
const updates = yield* DesktopUpdates.DesktopUpdates;
yield* updates.configure;
yield* updates.check("startup");
const state = yield* nextPublishedState(() => harness.emit("update-not-available"));
assert.equal(state.status, "error");
assert.equal(state.errorContext, "check");
assert.isTrue(state.canRetry);
assert.deepEqual(state.trackMismatch, { buildChannel: "latest" });

// A later failure has its own reason, so the mismatch must not stay attached to it.
const failed = yield* nextPublishedState(() =>
harness.emit("error", new Error("background updater failure")),
);
assert.isUndefined(failed.trackMismatch);

const mismatched = yield* nextPublishedState(() => harness.emit("update-not-available"));
assert.isDefined(mismatched.trackMismatch);
yield* updates.check("menu");
assert.equal((yield* updates.getState).status, "checking");
assert.isUndefined((yield* updates.getState).trackMismatch);
}),
).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
});

it.effect("never offers an older Nightly to a Nightly build's own checks", () => {
const harness = makeHarness({ appVersion: "1.2.4-nightly.20261027.1" });

Expand Down Expand Up @@ -1389,6 +1433,28 @@ describe("DesktopUpdates under a managed policy", () => {
).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
});

it.effect("does not name a blocked build track as the one to switch back to", () => {
const harness = makeHarness({
appVersion: "1.2.4-nightly.20261027.1",
savedChannel: "latest",
policy: managed({ allowNightly: false, feedUrl: "https://updates.example.com/t3code" }),
});

return Effect.scoped(
Effect.gen(function* () {
const updates = yield* DesktopUpdates.DesktopUpdates;
yield* updates.configure;
yield* updates.check("startup");
const state = yield* nextPublishedState(() => harness.emit("update-not-available"));

assert.equal(state.channel, "latest");
assert.equal(state.status, "error");
assert.equal(state.errorContext, "check");
assert.isUndefined(state.trackMismatch);
}),
).pipe(Effect.provide(Layer.merge(TestClock.layer(), harness.layer)));
});

it.effect("does not report the channel as the only block when updates are off anyway", () => {
const harness = makeHarness({
appVersion: "1.2.3-nightly.20261028.1",
Expand Down
Loading
Loading