Watchkey: Add Windows support via Windows Hello#26951
Watchkey: Add Windows support via Windows Hello#26951raycastbot merged 2 commits intoraycast:mainfrom
Conversation
|
Thank you for the update! 🎉 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days. |
Greptile SummaryThis PR adds Windows support to Watchkey using the watchkey-win CLI with Windows Hello biometric authentication, introducing platform-aware path resolution, an update checker, and a 'not available' screen for Import Key on Windows.
Confidence Score: 4/5Do not merge — three P1 issues must be resolved first. The lowercase 'windows' platform key will fail schema validation, the hooks-after-return pattern violates React rules and will be flagged by ESLint, and the version-string mismatch causes the update toast to fire on every launch. extensions/watchkey/package.json (platform casing), extensions/watchkey/src/import-key.tsx (hooks order), extensions/watchkey/src/watchkey.ts (version comparison) Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/watchkey/package.json
Line: 10
Comment:
**Incorrect `platforms` casing**
The value `"windows"` uses lowercase, but the Raycast schema requires `"Windows"` (capital W). Incorrect casing can cause schema validation failures and block publishing.
```suggestion
"Windows"
```
**Rule Used:** What: Ensure `platforms` only contains macOS and/o... ([source](https://app.greptile.com/review/custom-context?memory=b3b94d4e-bae6-49ea-b437-ed0f62a1456c))
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/watchkey/src/import-key.tsx
Line: 13-18
Comment:
**React Hooks called after conditional return**
`useInstallGuard` and `useUpdateCheck` are invoked after the early `return` on line 13, violating the Rules of Hooks. ESLint (`react-hooks/rules-of-hooks`) will flag this. Move the platform check after the hook calls:
```suggestion
const { installed, installView } = useInstallGuard();
useUpdateCheck();
if (platform() === "win32") {
return <Detail markdown="# Not Available\n\nImport Key is only available on macOS. It imports existing macOS Keychain items into watchkey." />;
}
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: extensions/watchkey/src/watchkey.ts
Line: 122-128
Comment:
**Version string mismatch always triggers update toast**
`getInstalledVersion()` returns the raw CLI output (e.g. `"watchkey 1.0.0"` or `"v1.0.0"`), while `getLatestVersion()` strips the `v` prefix via regex, yielding `"1.0.0"`. Because the strings differ in format, `installed !== latest` is always `true` and the update toast fires on every launch. Normalize the installed version:
```suggestion
async function getInstalledVersion(): Promise<string | null> {
try {
const output = await execPromise(WATCHKEY_PATH!, ["--version"]);
const match = output.trim().match(/[\d]+\.[\d]+\.[\d]+(?:[.\-][\w.]+)?/);
return match ? match[0] : output.trim();
} catch {
return null;
}
}
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "[Watchkey] Add cross-platform Windows su..." | Re-trigger Greptile |
| "platforms": [ | ||
| "macOS" | ||
| "macOS", | ||
| "windows" |
There was a problem hiding this comment.
The value "windows" uses lowercase, but the Raycast schema requires "Windows" (capital W). Incorrect casing can cause schema validation failures and block publishing.
| "windows" | |
| "Windows" |
Rule Used: What: Ensure platforms only contains macOS and/o... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/watchkey/package.json
Line: 10
Comment:
**Incorrect `platforms` casing**
The value `"windows"` uses lowercase, but the Raycast schema requires `"Windows"` (capital W). Incorrect casing can cause schema validation failures and block publishing.
```suggestion
"Windows"
```
**Rule Used:** What: Ensure `platforms` only contains macOS and/o... ([source](https://app.greptile.com/review/custom-context?memory=b3b94d4e-bae6-49ea-b437-ed0f62a1456c))
How can I resolve this? If you propose a fix, please make it concise.| if (platform() === "win32") { | ||
| return <Detail markdown="# Not Available\n\nImport Key is only available on macOS. It imports existing macOS Keychain items into watchkey." />; | ||
| } | ||
|
|
||
| const { installed, installView } = useInstallGuard(); | ||
| useUpdateCheck(); |
There was a problem hiding this comment.
React Hooks called after conditional return
useInstallGuard and useUpdateCheck are invoked after the early return on line 13, violating the Rules of Hooks. ESLint (react-hooks/rules-of-hooks) will flag this. Move the platform check after the hook calls:
| if (platform() === "win32") { | |
| return <Detail markdown="# Not Available\n\nImport Key is only available on macOS. It imports existing macOS Keychain items into watchkey." />; | |
| } | |
| const { installed, installView } = useInstallGuard(); | |
| useUpdateCheck(); | |
| const { installed, installView } = useInstallGuard(); | |
| useUpdateCheck(); | |
| if (platform() === "win32") { | |
| return <Detail markdown="# Not Available\n\nImport Key is only available on macOS. It imports existing macOS Keychain items into watchkey." />; | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/watchkey/src/import-key.tsx
Line: 13-18
Comment:
**React Hooks called after conditional return**
`useInstallGuard` and `useUpdateCheck` are invoked after the early `return` on line 13, violating the Rules of Hooks. ESLint (`react-hooks/rules-of-hooks`) will flag this. Move the platform check after the hook calls:
```suggestion
const { installed, installView } = useInstallGuard();
useUpdateCheck();
if (platform() === "win32") {
return <Detail markdown="# Not Available\n\nImport Key is only available on macOS. It imports existing macOS Keychain items into watchkey." />;
}
```
How can I resolve this? If you propose a fix, please make it concise.| async function getInstalledVersion(): Promise<string | null> { | ||
| try { | ||
| const output = await execPromise(WATCHKEY_PATH!, ["--version"]); | ||
| return output.trim(); | ||
| } catch { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
Version string mismatch always triggers update toast
getInstalledVersion() returns the raw CLI output (e.g. "watchkey 1.0.0" or "v1.0.0"), while getLatestVersion() strips the v prefix via regex, yielding "1.0.0". Because the strings differ in format, installed !== latest is always true and the update toast fires on every launch. Normalize the installed version:
| async function getInstalledVersion(): Promise<string | null> { | |
| try { | |
| const output = await execPromise(WATCHKEY_PATH!, ["--version"]); | |
| return output.trim(); | |
| } catch { | |
| return null; | |
| } | |
| async function getInstalledVersion(): Promise<string | null> { | |
| try { | |
| const output = await execPromise(WATCHKEY_PATH!, ["--version"]); | |
| const match = output.trim().match(/[\d]+\.[\d]+\.[\d]+(?:[.\-][\w.]+)?/); | |
| return match ? match[0] : output.trim(); | |
| } catch { | |
| return null; | |
| } | |
| } |
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/watchkey/src/watchkey.ts
Line: 122-128
Comment:
**Version string mismatch always triggers update toast**
`getInstalledVersion()` returns the raw CLI output (e.g. `"watchkey 1.0.0"` or `"v1.0.0"`), while `getLatestVersion()` strips the `v` prefix via regex, yielding `"1.0.0"`. Because the strings differ in format, `installed !== latest` is always `true` and the update toast fires on every launch. Normalize the installed version:
```suggestion
async function getInstalledVersion(): Promise<string | null> {
try {
const output = await execPromise(WATCHKEY_PATH!, ["--version"]);
const match = output.trim().match(/[\d]+\.[\d]+\.[\d]+(?:[.\-][\w.]+)?/);
return match ? match[0] : output.trim();
} catch {
return null;
}
}
```
How can I resolve this? If you propose a fix, please make it concise.Add Windows support via watchkey-win CLI with Windows Hello biometric authentication. Platform-aware binary path resolution, update checker, and install instructions. Import Key shows not-available on Windows.
f3e0506 to
7fa331b
Compare
0xdhrv
left a comment
There was a problem hiding this comment.
Looks good to me, approved ✅
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Summary
/usr/local/bin,/opt/homebrew/bin; Windows:%LOCALAPPDATA%\watchkey)os.homedir()whenLOCALAPPDATAenv var is unavailable (Raycast sandboxed environment)"windows"to theplatformsarrayTest plan
%LOCALAPPDATA%\watchkey\watchkey.exe