Skip to content

Improve hotkey capture and refresh download page#7

Merged
Derpedyea merged 1 commit into
mainfrom
feature/hotkey-capture-download-refresh
May 5, 2026
Merged

Improve hotkey capture and refresh download page#7
Derpedyea merged 1 commit into
mainfrom
feature/hotkey-capture-download-refresh

Conversation

@Derpedyea
Copy link
Copy Markdown
Member

@Derpedyea Derpedyea commented May 5, 2026

Summary

  • Expanded desktop hotkey parsing and capture support for more keys, including numpad keys, function keys through F24, and additional special keys.
  • Reworked the hotkey settings UI from a text input into an interactive capture button with live state, validation feedback, and cancel-on-blur behavior.
  • Updated the download page marketing layout with a stronger hero, direct Windows/macOS download actions, refreshed platform cards, and a simplified requirements section.
  • Added new styling for the hotkey capture control, download hero, platform cards, and requirements bar to match the updated layout.

Testing

  • Not run
  • Checked the updated hotkey capture flow in code for modifier-only shortcuts, Escape cancel, and invalid-key feedback handling.
  • Reviewed the download page markup and CSS changes for the new hero, platform cards, and responsive layout adjustments.

Summary by CodeRabbit

Release Notes

New Features

  • Hotkey settings now feature an interactive capture button with visual feedback, replacing manual text input entry
  • Expanded keyboard key support: Numpad keys, extended function keys through F24, NumLock, ScrollLock, and PrintScreen now supported
  • Redesigned Download page with dedicated platform-specific selection cards and improved installer section for streamlined setup

- Add broader hotkey parsing and capture support
- Replace download specs with new platform-focused layout
- Polish desktop hotkey picker styling
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
laryn-transcribe ad82922 May 05 2026, 05:04 PM

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0afd0d5c-09ca-48ac-a60e-226747e7f329

📥 Commits

Reviewing files that changed from the base of the PR and between 787fdb4 and ad82922.

📒 Files selected for processing (4)
  • apps/desktop/main.cjs
  • apps/desktop/src/renderer/MainView.tsx
  • apps/desktop/src/renderer/styles.css
  • apps/worker/src/index.ts

📝 Walkthrough

Walkthrough

This PR enhances hotkey capture functionality with expanded key support and a dedicated UI component, while separately redesigning the marketing download page template with new hero layout and platform cards.

Changes

Hotkey Capture Infrastructure & UI

Layer / File(s) Summary
Key Support Expansion
apps/desktop/main.cjs
HOTKEY_KEY_CODES now programmatically generates Numpad digit keys, adds Numpad operators (multiply, add, subtract, divide, decimal, enter), extends function keys to F24, and adds NumLock, ScrollLock, PrintScreen.
Hotkey Canonicalization
apps/desktop/main.cjs
HOTKEY_CANONICAL_PARTS map introduced; normalizeHotkeyPart() updated to canonicalize key names case-insensitively via HOTKEY_KEY_CODES before fallback to aliases, replacing prior F1F12 regex special-casing.
Capture UI Component
apps/desktop/src/renderer/MainView.tsx
SectionHotkey refactored from freeform text input to dedicated capture button with capturing state, captureError tracking, keyboard event handling (onKeyDown/onKeyUp/onBlur) for starting, canceling (Esc/blur), and committing captured shortcuts.
Keyboard Handling & Validation
apps/desktop/src/renderer/MainView.tsx
Added CapturedHotkey type, MODIFIER_EVENT_CODES set, KEYBOARD_CODE_TO_HOTKEY mapping, and helper functions to extract modifiers, resolve key parts, and validate shortcut combinations (modifier-only shortcuts require two modifiers).
Capture Button Styling
apps/desktop/src/renderer/styles.css
New .hotkey-capture component class with base layout, colors, shadow, and data-capturing="true" state styling for active-capture indication.

Marketing Download Page Redesign

Layer / File(s) Summary
Template Restructure
apps/worker/src/index.ts
downloadBody() HTML reworked with computed windowsHref/macHref variables, replaced two-card download-choices layout with hero section, new "Platforms" cards (Windows recommended + macOS early build), and new "Requirements" section in Setup flow.
Styling Updates
apps/worker/src/index.ts
marketingCss() adds rules for download hero, installer card, platform card grid, and requirements bar; removes old download-choices and download-specs styling; includes responsive breakpoint adjustments for new layout.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~40 minutes

Poem

🐇 A capture button springs to life,
Keys dance through Numpad, plain and rife,
While downloads bloom with platforms bright,
More hotkeys shine, the UI's right!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/hotkey-capture-download-refresh

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Derpedyea Derpedyea merged commit 5f8ebf1 into main May 5, 2026
2 of 3 checks passed
@Derpedyea Derpedyea deleted the feature/hotkey-capture-download-refresh branch May 5, 2026 17:04
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant User as User
    participant UI as Hotkey Settings UI
    participant Capturer as Capture Handler
    participant Backend as Main Process (main.cjs)
    participant Renderer as Web Content
    participant Worker as Cloudflare Worker
    participant Download as Download Page Hero

    Note over User,Renderer: CHANGED: Hotkey Capture Flow
    User->>UI: Click capture button
    UI->>Capturer: beginCapture() - focus button, set capturing=true
    Capturer->>Capturer: Start listening for key events
    User->>Capturer: Press key combination
    alt Escape pressed (no modifiers)
        Capturer->>UI: cancelCapture() - restore rawHotkey
        UI-->>User: Reset to previous hotkey
    else Key press with modifiers
        Capturer->>Capturer: hotkeyFromKeyboardEvent(event)
        alt Invalid key (no supported key part)
            Capturer-->>UI: Set captureError "That key is not supported."
        else No modifiers pressed
            Capturer-->>UI: Set captureError "Add Ctrl, Alt, Shift, or Win."
        else Only 1 modifier, no key
            Capturer-->>UI: Set captureError "Modifier-only shortcuts need two modifiers."
        else Valid shortcut detected
            alt hasKey (non-modifier key pressed)
                Capturer->>UI: commitCapture(hotkey) - set capturing=false
                UI->>Backend: onSetHotkey(normalizedHotkey)
                Backend-->>UI: Hotkey updated
                UI-->>User: Show new hotkey as active
            else modifier-only (no key yet)
                Capturer->>Capturer: pendingModifierHotkey = current partial hotkey
                Note over Capturer: Wait for keyUp to finalize
                User->>Capturer: Release all modifiers
                Capturer->>UI: commitCapture(hotkey)
                UI->>Backend: onSetHotkey(hotkey)
            end
        end
    end
    note over Capturer: Capture ends on blur
    Capturer->>Capturer: onBlur event
    Capturer->>UI: cancelCapture() - restore rawHotkey

    Note over Worker: CHANGED: Download Page Layout
    User->>Worker: Request /download page
    Worker->>Worker: downloadBody(appUrl)
    Worker->>Download: Render hero-download section
    Download->>Download: Show Windows download button (.exe)
    Download->>Download: Show macOS download button (.dmg)
    Download->>Download: Show installer card with mock details
    Worker->>Worker: Render platform cards
    Worker->>Worker: Render simplified requirements section

    Note over Backend: CHANGED: Expanded Key Support
    Backend->>Backend: HOTKEY_KEY_CODES extended
    note over Backend: Added numpad keys, F13-F24, CapsLock, NumLock, ScrollLock, PrintScreen
    Backend->>Backend: HOTKEY_CANONICAL_PARTS lookup table
    Backend->>Backend: normalizeHotkeyPart() uses canonical table
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant