Repository navigation
[P2] fix(updater): route hourly release-notes links to the hourly repo and let the disabled channel tooltip open - #11812
Conversation
…o and let the disabled channel tooltip open Co-authored-by: Orca <[email protected]>
📝 WalkthroughWalkthroughThe shared 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/settings/SettingsFormControls.tsx (1)
182-184: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove duplicated implementation commentary.
Keep the production rationale to one line. Remove the redundant test comment.
src/renderer/src/components/settings/SettingsFormControls.tsx#L182-L184: Replace the three-line comment with a one-line accessibility rationale.src/renderer/src/components/settings/SettingsFormControls.segmented-control.test.tsx#L32-L33: Remove the comment because the test name states the behavior.As per coding guidelines, comments must be concise, limited to non-obvious information, and preferably one line.
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 45f14b43-391d-4bf2-ae62-87b9beb580e6
📒 Files selected for processing (8)
src/renderer/src/components/UpdateCard.error-card.test.tsxsrc/renderer/src/components/UpdateCard.tsxsrc/renderer/src/components/settings/AccountsPane.test.tsxsrc/renderer/src/components/settings/GeneralUpdateSettingsSection.tsxsrc/renderer/src/components/settings/SettingsFormControls.segmented-control.test.tsxsrc/renderer/src/components/settings/SettingsFormControls.tsxsrc/shared/release-channel.test.tssrc/shared/release-channel.ts
Greptile SummaryThis PR fixes two independent bugs found in a production release scan: hourly-build release-notes links 404ing against the wrong GitHub repo, and a keyboard-inaccessible "macOS only" tooltip on the disabled Hourly channel segment. Both fixes are minimal, well-tested, and carry no behavioural regressions on the unaffected paths.
Confidence Score: 5/5Safe to merge — both changes are narrowly scoped, fully tested, and the blast-radius analysis for the shared SettingsSegmentedControl primitive is correct. The URL-routing fix consolidates a previously duplicated hardcoded string into a single tested helper whose logic is straightforward and covered by four distinct test cases (hourly, stable, v-prefixed RC, null). The aria-disabled change is a one-attribute swap on a component whose styling already uses an explicit conditional rather than the native :disabled pseudo-class, and the pre-existing click guard remains intact. All seven other consumers of SettingsSegmentedControl benefit from the fix without any call-site changes. Test coverage is additive across three new/updated files and all 25 targeted tests pass clean. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/shared/release-channel.ts | Adds getReleaseNotesUrlForVersion — correctly routes null to main-repo listing, hourly versions to HOURLY_RELEASE_REPO, and all other channels to MAIN_RELEASE_REPO via existing getVersionChannel logic. |
| src/renderer/src/components/UpdateCard.tsx | Replaces seven calls to the removed local releaseUrlForVersion helper with getReleaseNotesUrlForVersion; null-version (signature-mismatch) case explicitly preserved. |
| src/renderer/src/components/settings/SettingsFormControls.tsx | Swaps disabled for aria-disabled on segmented-control buttons; the click guard and explicit Tailwind class conditional keep styling and activation behaviour unchanged. |
| src/renderer/src/components/settings/GeneralUpdateSettingsSection.tsx | Replaces two hardcoded main-repo href strings with getReleaseNotesUrlForVersion(updateStatus.version), closing the same 404 on the Settings → Updates surface. |
| src/shared/release-channel.test.ts | New test block covers hourly, stable, rc (v-prefixed), and null cases for getReleaseNotesUrlForVersion; all four paths are pinned. |
| src/renderer/src/components/UpdateCard.error-card.test.tsx | Adds an hourly-build scenario verifying the rendered error-card Release notes link targets stablyai/orca-hourly. |
| src/renderer/src/components/settings/SettingsFormControls.segmented-control.test.tsx | New test file pins aria-disabled presence (and absence of native disabled), tooltip-on-focus, and click-guard for unavailable segmented-control options. |
| src/renderer/src/components/settings/AccountsPane.test.tsx | Updates two assertions from disabled to aria-disabled to match the corrected rendered output; no behavioural assertions removed. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["getReleaseNotesUrlForVersion(version)"] --> B{version is null?}
B -- Yes --> C["repo = MAIN_RELEASE_REPO\nReturn: github.com/stablyai/orca/releases"]
B -- No --> D{"getVersionChannel(version) === hourly?"}
D -- Yes --> E["repo = HOURLY_RELEASE_REPO\nstablyai/orca-hourly"]
D -- No --> F["repo = MAIN_RELEASE_REPO\nstablyai/orca"]
E --> G["Return: github.com/repo/releases/tag/v + normalizeTagToVersion(version)"]
F --> G
subgraph Callers
H["UpdateCard.tsx - 7 call sites"]
I["GeneralUpdateSettingsSection.tsx - 2 call sites"]
end
H --> A
I --> A
Reviews (1): Last reviewed commit: "[P2] fix(updater): route hourly release-..." | Re-trigger Greptile
…o and let the disabled channel tooltip open (stablyai#11812) Co-authored-by: Orca <[email protected]>
Summary
Two independent P2s found by the
v1.4.163-rc.1..v1.4.163-rc.3production release scan, both on the update / release-channel surface.Bug A — a pinned hourly build links "Release notes" to a tag that does not exist (404)
UpdateCard.tsxkept a privatereleaseUrlForVersion()that hardcoded the main repo:Hourly builds are not published there.
src/shared/release-channel.tsalready knows this — hourly artifacts go tostablyai/orca-hourly(HOURLY_RELEASE_REPO), stable and RC tostablyai/orca(MAIN_RELEASE_REPO). An hourly tag has no counterpart in the main repo, so every "Release notes" / "Check official releases" link rendered on an updater error card while running a pinned hourly build resolved to a GitHub 404.GeneralUpdateSettingsSection.tsxhad the same hardcoded main-repo URL in two more places.Fix: one shared
getReleaseNotesUrlForVersion(version)insrc/shared/release-channel.ts:85, deriving the repo from the existinggetVersionChannel(version). Seven call sites inUpdateCard.tsxand two inGeneralUpdateSettingsSection.tsxnow route through it. It also runs the version throughnormalizeTagToVersion, so an already-v-prefixed version no longer yields.../releases/tag/vv1.4.163.Deliberately preserved: the Windows signature-mismatch card passes
null, andnullstill resolves to the main repo's plain releases listing. That is intentional and the existing comment says why — linking the rejected version would let a user bypass the publisher check by re-running it.nullalso does not use/releases/latest, because/latestbreaks when GitHub's API is degraded. Both behaviors are unchanged and are pinned by new tests.Bug B — the "macOS only" tooltip on the disabled Hourly segment is unreachable by keyboard
ReleaseChannelSection.tsx:184-209disables the Hourly segment on Linux and Windows and attaches a tooltip explaining why. The code says exactly what it is for:SettingsSegmentedControlrendered that option with the nativedisabledattribute, andTooltipTriggerusesasChild, so the Radix trigger is the disabled button rather than a wrapper around it. A natively disabled button is removed from the tab order, so it can never receive focus — and the focus-driven half of the tooltip never fires. A keyboard or screen-reader user on Linux/Windows tabs straight past a greyed-out segment with an Apple glyph and no way to find out why it is greyed out.Fix:
aria-disabled={opt.disabled}instead ofdisabled={opt.disabled}.aria-disabledconveys the same state to assistive technology while leaving the button focusable. The component already had anif (!opt.disabled) { onChange(...) }click guard, so the option stays inert.ELI5
A. Orca can install builds from two different shelves: the normal shelf and an extra "hourly" shelf that only exists for macOS. If you were running something off the hourly shelf and the updater showed you an error, the "Release notes" link always pointed at the normal shelf — where your build was never stored. So you clicked it and got GitHub's "this page does not exist". Now the link looks up which shelf your build actually came from.
B. In Settings there is a row of buttons for picking your update channel: Stable / RC / Hourly. On Windows and Linux the Hourly button is greyed out, and it has a little popup that says "hourly builds are macOS-only".
If you use a mouse, you could hover it and read that popup — fine. But if you navigate with the keyboard, you couldn't: a greyed-out button is skipped entirely when you press Tab, so you can never land on it, so the popup explaining why it's greyed out can never appear. Keyboard and screen-reader users got a dead button and no explanation at all.
The fix marks the button as unavailable in a way that still lets you Tab to it and read the explanation, while pressing it still does nothing.
Screenshots
Captured from the Electron dev build over CDP, Settings → Updates → Release channel. Hourly is enabled on macOS (it is the only platform it ships for), so the disabled state cannot render on this host —
navigator.userAgentwas spoofed to Windows over CDP, sincegetShortcutPlatform()is whatReleaseChannelSectionreads. Disclosing that rather than implying a real Windows box.Keyboard — this is the bug. Tab to the Hourly segment:
disabled)aria-disabled)Hover — unchanged, and that is the point. Hovering the disabled segment before and after:
The before and after hover captures came out byte-identical (SHA-256
f498c53b2a562dad746251b93509983891bde228069cee92f83ca4331dadc2cdfor both), so only one is shown. Chromium dispatches pointer events to natively disabled buttons, so mouse hover already worked onorigin/main. See the scope correction above — this is a keyboard/AT fix only.Proof of fix
Run against this branch with only the production files reverted to
origin/main(tests kept),npx vitest run --config config/vitest.config.tsover the four touched test files:The last two
AccountsPanefailures are the same defect showing up on a second consumer: those assertions look foraria-disabled="true"on the WSL account-location segments and find the nativedisabledattribute instead.With the fix restored, the same command is 4 files / 25 tests passed.
New coverage added:
src/shared/release-channel.test.ts— hourly / stable / RC /nullcases forgetReleaseNotesUrlForVersion, including thenull→ main-repo-listing behavior the Windows signature-mismatch card depends on.src/renderer/src/components/UpdateCard.error-card.test.tsx— a new "UpdateCard hourly builds" block asserting the rendered error-card link points atstablyai/orca-hourly.src/renderer/src/components/settings/SettingsFormControls.segmented-control.test.tsx(new file) — asserts an unavailable option rendersaria-disabled="true"with no nativedisabledattribute, and that clicking it does not callonChange.Proof of no regression
npx oxfmt --checkandnpx oxlintclean on all changed files (enforced by lint-staged on commit).AccountsPane.test.tsxis updated, not deleted: the two assertions moved fromdisabled=""toaria-disabled="true". That is the only behavioral assertion change in this PR, and it is asserting the fix.Blast radius:
SettingsSegmentedControlis sharedBug B's fix touches a primitive with seven other consumers (WSL runtime pickers in
AccountsPane,AgentRuntimeSetting,DefaultWindowsProjectRuntimeSetting,ProjectWindowsRuntimeSetting; the fork-sync segments inRepositoryForkSyncSection;TerminalAdvancedSection;TerminalWindowsShellSection). Verified safe for all of them:onClickguard is unchanged and catches both mouse clicks and keyboardEnter/Spaceactivation, since both dispatch aclickevent on a<button>.SettingsFormControls.tsx:197is an explicitopt.disabled ? … : …conditional, not a Tailwinddisabled:variant, so it does not depend on the native attribute.type="button".aria-disabledis the ARIA-recommended pattern for a disabled control that must remain discoverable, and it keeps therole="radio"semantics intact.Testing
pnpm lint— clean (oxlint, type-aware audit, reliability gates, max-lines ratchet, localization catalog/extraction/coverage);oxfmt --checkclean via lint-stagedpnpm typecheck— clean (tsc: node + cli + web)pnpm test(targeted files at tip + full desktop suite on the combined tree)pnpm build— not run; no build-graph, packaging, or dependency change in this PRAI Review Report
Reviewed by Claude Opus 5 as part of a 45-agent release scan with adversarial refutation (21 candidates raised, 6 confirmed, 13 refuted). Risks checked for this change:
metaKey, no path assumptions, no shell invocation.getReleaseNotesUrlForVersionbuilds a URL string only.null→ main-repo-listing path is untouched, so the Windows signature-mismatch card still refuses to link the rejected artifact.verifyUpdateCodeSignatureis not referenced or reassigned anywhere in this diff.SettingsSegmentedControlconsumers audited (see above).Security Audit
eval, no dynamicimport().getReleaseNotesUrlForVersioninterpolates a version string into ahttps://github.com/…URL. The repo half is chosen from a closed set of two module-level constants — it is never caller-controlled. The version half comes from the updater's own release feed, not user input, and is passed throughnormalizeTagToVersion. The result is only ever handed to Orca's existing external-link opener, which is unchanged.disabled→aria-disabledswap widens which events the element emits, so it was checked for a click-through hole. The pre-existingif (!opt.disabled)guard closes it, and a new test pins that.Notes
getShortcutPlatform()insrc/renderer/src/lib/shortcut-platform.ts, which readsnavigator.userAgent.GeneralUpdateSettingsSection.tsxtoo, which was beyond the original finding — the scan flaggedUpdateCard.tsxonly, but the same hardcoded URL was present there and would 404 identically.Made with Orca 🐋