Skip to content

Commit e0ef719

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/hyprland-wayland-color-manager
2 parents ff6c341 + 58d2532 commit e0ef719

17 files changed

Lines changed: 971 additions & 113 deletions

‎.github/workflows/release-desktop.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,39 @@ jobs:
129129
git sparse-checkout set --no-cone '/*' '!/.repos/'
130130
git -c checkout.workers=0 checkout --detach FETCH_HEAD
131131
132+
# The runner's PowerShell 7.6/.NET 10 intermittently crashes during signing:
133+
# https://github.com/dotnet/runtime/issues/131636
134+
# Put the .NET 8 release first for both workflow shells and electron-builder.
135+
- name: Use PowerShell 7.4 for Windows ARM builds
136+
if: inputs.platform == 'win' && inputs.arch == 'arm64'
137+
shell: powershell
138+
run: |
139+
$ErrorActionPreference = "Stop"
140+
$ProgressPreference = "SilentlyContinue"
141+
$version = "7.4.20"
142+
$archive = Join-Path $env:RUNNER_TEMP "PowerShell-$version-win-arm64.zip"
143+
$installDir = Join-Path $env:RUNNER_TEMP "powershell-$version-arm64"
144+
Invoke-WebRequest -UseBasicParsing `
145+
-Uri "https://github.com/PowerShell/PowerShell/releases/download/v$version/PowerShell-$version-win-arm64.zip" `
146+
-OutFile $archive
147+
$expectedHash = "67eff749d5dae357501c95a3eec1dcd93f669824e3ca2b1d2adcdecdebf04f35"
148+
if ((Get-FileHash $archive -Algorithm SHA256).Hash -ne $expectedHash) {
149+
throw "PowerShell archive checksum mismatch"
150+
}
151+
Expand-Archive -Path $archive -DestinationPath $installDir
152+
$installDir | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
153+
& "$installDir\pwsh.exe" -NoProfile -NonInteractive -Command '$PSVersionTable; [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture'
154+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
155+
156+
- name: Verify Windows ARM PowerShell selection
157+
if: inputs.platform == 'win' && inputs.arch == 'arm64'
158+
shell: pwsh
159+
run: |
160+
$expectedPath = Join-Path $env:RUNNER_TEMP "powershell-7.4.20-arm64\pwsh.exe"
161+
if ((Get-Command pwsh.exe).Source -ne $expectedPath -or $PSVersionTable.PSVersion -ne [version]"7.4.20") {
162+
throw "Windows ARM builds must use the pinned PowerShell runtime"
163+
}
164+
132165
# Windows installs straight from the registry. There, linking the packages
133166
# takes the time, not downloading them, so a ~700 MB package cache did not
134167
# pay for its own restore. Across recent nightlies, restore plus install

‎apps/web/src/components/ProviderUpdatesAction.tsx‎

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,18 @@ import { stackedThreadToast, toastManager } from "./ui/toast";
1515
import { Tooltip, TooltipPopup, TooltipTrigger } from "./ui/tooltip";
1616

1717
/**
18-
* Updates every outdated provider on every connected machine at once, then
19-
* reports the results in one toast. Each server queues updates that share an
20-
* installer, so sending them all together is safe. The server still checks
21-
* permissions: a session that cannot operate a machine gets a failure line for
22-
* it. Renders nothing when no machine has a one-click update.
18+
* Every outdated provider with a one-click update on every connected machine,
19+
* plus a function that updates them all and reports the results in one toast.
20+
* Each server queues updates that share an installer, so sending them all
21+
* together is safe. The server still checks permissions: a session that
22+
* cannot operate a machine gets a failure line for it. The returned promise
23+
* settles when every update has finished.
2324
*/
24-
export function ProviderUpdatesAction() {
25+
export function useProviderUpdates() {
2526
const { environments } = useEnvironments();
2627
const updateProvider = useAtomCommand(serverEnvironment.updateProvider, {
2728
reportFailure: false,
2829
});
29-
const pending = useRef(false);
30-
const [isPending, setIsPending] = useState(false);
3130
const machines = useMemo(
3231
() =>
3332
environments.flatMap((environment) => {
@@ -44,6 +43,41 @@ export function ProviderUpdatesAction() {
4443
}),
4544
[environments],
4645
);
46+
47+
const updateAll = async () => {
48+
const runs = await Promise.all(
49+
machines.flatMap(({ environmentId, label, candidates }) =>
50+
candidates.map(async (candidate): Promise<ProviderUpdateRun> => ({
51+
machineLabel: label,
52+
driver: candidate.driver,
53+
instanceId: candidate.instanceId,
54+
result: await updateProvider({
55+
environmentId,
56+
input: { provider: candidate.driver, instanceId: candidate.instanceId },
57+
}),
58+
})),
59+
),
60+
);
61+
const view = getProviderUpdateRunToastView(runs);
62+
if (view) {
63+
toastManager.add(
64+
stackedThreadToast({
65+
...view,
66+
description: <span className="whitespace-pre-line">{view.description}</span>,
67+
}),
68+
);
69+
}
70+
};
71+
72+
return { machines, updateAll };
73+
}
74+
75+
/** Provider settings button for {@link useProviderUpdates}. Renders nothing
76+
when no machine has a one-click update. */
77+
export function ProviderUpdatesAction() {
78+
const { machines, updateAll } = useProviderUpdates();
79+
const pending = useRef(false);
80+
const [isPending, setIsPending] = useState(false);
4781
// Candidates leave the list as soon as their servers report them queued, so
4882
// keep the button while the run is in flight.
4983
if (machines.length === 0 && !isPending) {
@@ -55,28 +89,7 @@ export function ProviderUpdatesAction() {
5589
pending.current = true;
5690
setIsPending(true);
5791
try {
58-
const runs = await Promise.all(
59-
machines.flatMap(({ environmentId, label, candidates }) =>
60-
candidates.map(async (candidate): Promise<ProviderUpdateRun> => ({
61-
machineLabel: label,
62-
driver: candidate.driver,
63-
instanceId: candidate.instanceId,
64-
result: await updateProvider({
65-
environmentId,
66-
input: { provider: candidate.driver, instanceId: candidate.instanceId },
67-
}),
68-
})),
69-
),
70-
);
71-
const view = getProviderUpdateRunToastView(runs);
72-
if (view) {
73-
toastManager.add(
74-
stackedThreadToast({
75-
...view,
76-
description: <span className="whitespace-pre-line">{view.description}</span>,
77-
}),
78-
);
79-
}
92+
await updateAll();
8093
} finally {
8194
pending.current = false;
8295
setIsPending(false);

‎apps/web/src/components/ServerUpdateAction.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ type UpdateButtonProps = Pick<ComponentProps<typeof Button>, "variant" | "size"
6565
readonly appearance?: "button" | "icon";
6666
};
6767

68-
function useServerUpdate() {
68+
/** Updates one server and waits until it is back on the target version.
69+
Reports its own success or failure toast; never rejects. */
70+
export function useServerUpdate() {
6971
const updateServer = useAtomCommand(serverEnvironment.updateServer, { reportFailure: false });
7072
return async (target: ServerUpdateTarget, failureTitle = "Server update failed") => {
7173
const { environmentId, serverLabel, selfUpdate, targetVersion } = target;
@@ -164,7 +166,9 @@ export function ServerUpdatesAction({
164166
);
165167
}
166168

167-
function canUpdateServer(result: AsyncResult.AsyncResult<AuthSessionState, unknown>): boolean {
169+
export function canUpdateServer(
170+
result: AsyncResult.AsyncResult<AuthSessionState, unknown>,
171+
): boolean {
168172
if (result._tag !== "Success" || !result.value.authenticated) return false;
169173
return sessionGrantsScope(result.value, AuthEnvironmentMaintainScope);
170174
}

‎apps/web/src/components/sidebar/DesktopUpdateStatusIcon.tsx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { RefreshIcon } from "~/components/ui/refresh-icon";
2-
import { CheckIcon, DownloadIcon, RotateCwIcon } from "lucide-react";
2+
import { CheckIcon, CircleArrowUpIcon, DownloadIcon, RotateCwIcon } from "lucide-react";
33
import type { AnimationEventHandler } from "react";
44

55
const DOWNLOAD_PROGRESS_RADIUS = 14;
@@ -10,7 +10,10 @@ export type DesktopUpdateStatusIconState =
1010
| "checking"
1111
| "available"
1212
| "downloading"
13-
| "downloaded";
13+
| "downloaded"
14+
// Other machines or providers have updates. Matches the server update icon
15+
// in Connections settings; the download arrow stays for this app's own file.
16+
| "everything";
1417

1518
function normalizeDesktopUpdateDownloadPercent(percent: number | null): number {
1619
if (percent === null || !Number.isFinite(percent)) return 0;
@@ -115,6 +118,7 @@ export function DesktopUpdateStatusIcon({
115118
return <DesktopUpdateDownloadingIcon percent={downloadPercent ?? null} />;
116119
}
117120
if (status === "downloaded") return <DesktopUpdateDownloadedIcon />;
121+
if (status === "everything") return <CircleArrowUpIcon className="size-4" />;
118122

119123
return (
120124
<RefreshIcon

0 commit comments

Comments
 (0)