Skip to content

Add flip-scroll extension - #29914

Closed
oh-roman wants to merge 1 commit into
raycast:mainfrom
oh-roman:ext/flip-scroll
Closed

oh-roman wants to merge 1 commit into
raycast:mainfrom
oh-roman:ext/flip-scroll

Conversation

@oh-roman

@oh-roman oh-roman commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds Flip Scroll — a single no-view command that toggles macOS natural scrolling,
for switching between trackpad and mouse without opening System Settings.

On the approach

The command calls setSwipeScrollDirection from the private PreferencePanesSupport
framework via JXA. Since that is a private API, here is why:

  • defaults write -g com.apple.swipescrolldirection alone does not take effect until
    the next login. It appears to work only while System Settings is open, because that
    app applies the change for you.
  • activateSettings -u does apply it, but it re-applies the entire global preference
    domain including the keyboard context. That re-registers the system symbolic hotkeys
    and can hand ⌘Space back to Spotlight on every toggle.
  • setSwipeScrollDirection is the function the Trackpad pane itself calls and changes
    only this one setting. No window opens, no Accessibility permission is required.

Verified on macOS 26 (Tahoe).

Screencast

The command has no UI — it runs and shows a HUD. Screen recording below shows a page
scrolled in one direction, the hotkey pressed, and the same gesture scrolling the
opposite way.

Checklist

@raycastbot raycastbot added new extension Label for PRs with new extensions platform: macOS labels Aug 2, 2026
@raycastbot

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@oh-roman
oh-roman marked this pull request as ready for review August 2, 2026 15:13
@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds Flip Scroll, a macOS-only no-view command that instantly toggles the global natural-scrolling preference through the private PreferencePanesSupport framework.

  • Adds the command implementation with current-state detection, live preference switching, success and error HUDs.
  • Adds the Raycast extension manifest, build configuration, documentation, changelog, icon, and Store metadata.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete current failure identified in the new extension.

The command has a matching manifest entry, uses fixed executable paths and arguments, handles execution failures with user-visible feedback, and includes the expected extension metadata and locked dependencies.

Important Files Changed

Filename Overview
extensions/flip-scroll/src/flip-scroll-direction.ts Implements the natural-scrolling toggle through fixed system binaries and a private macOS framework, with HUD feedback and handled execution errors.
extensions/flip-scroll/package.json Defines a correctly scoped macOS-only no-view command with matching source entry point, System category, standard scripts, and required manifest metadata.
extensions/flip-scroll/package-lock.json Pins the extension’s runtime and development dependency graph with integrity hashes.
extensions/flip-scroll/README.md Documents the command’s purpose, behavior, and private-framework approach consistently with the implementation.
extensions/flip-scroll/CHANGELOG.md Adds an initial release entry using the expected merge-date placeholder.

Reviews (1): Last reviewed commit: "Create Flip Scroll extension" | Re-trigger Greptile

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for your contribution 🔥

We already have an extension in the Store that covers the same core functionality:

Both are a single no-view command that toggles macOS natural scrolling so you can switch between trackpad and mouse without digging through System Settings.

The existing extension already provides:

  • Change Scroll Direction, a no-view toggle between "natural" and "mouse-friendly"
  • Immediate apply via System Settings UI automation, including a Tahoe-specific script

This PR adds some useful capabilities:

  • Applies the same preference through setSwipeScrollDirection instead of opening System Settings
  • No Accessibility permission, and no full-domain activateSettings refresh that can steal ⌘Space
  • A HUD that reports the new state (trackpad vs mouse)

However, these appear to be natural enhancements to the existing extension rather than enough differentiation for a separate extension with the same primary workflow.

Could we consider contributing the live PreferencePanesSupport toggle to the existing extension instead?

This would help avoid duplication and keep scroll-direction toggling consolidated in one extension.
As mentioned in our extension guidelines here ↗

@0xdhrv
0xdhrv marked this pull request as draft August 18, 2026 15:18
@0xdhrv 0xdhrv self-assigned this Aug 18, 2026
@oh-roman

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review — agreed, the primary workflow does overlap, so I'm happy
to contribute the improvements to Change Scroll Direction instead.

What I'd bring over:

  • Replace the System Settings UI automation with a direct setSwipeScrollDirection call
    from PreferencePanesSupport — the same function the Trackpad pane itself calls. It
    writes the preference and applies it live in one step.
  • That removes scripts.ts with its per-version AppleScripts (Tahoe / Ventura / older)
    and the run-applescript dependency, so there's no UI hierarchy to re-fix on each
    macOS release, and no Accessibility permission needed.
  • Read current state via defaults read -g com.apple.swipescrolldirection (treating a
    missing key as "on", which is how macOS behaves on a fresh account) so the HUD can
    report the resulting state — "Natural scrolling ON (trackpad)" / "OFF (mouse)" —
    instead of "Scroll direction changed".
  • The existing jest suite covers fetchAppleScript, which goes away with the scripts;
    I'll rework the tests accordingly.

Heads up that this replaces the command's implementation end to end, so expect a rewrite
of changeScrollDirection.ts rather than a small patch. I'd add myself to contributors.

One separate, entirely optional question for @gregoralbrecht: I drew an icon for this
while working on my own version, and I'd be glad to offer it if you like it — happy to
post it here first so you can see it before deciding. Completely your call, and a "no"
changes nothing about the code above; I'll send that either way.

Would you prefer I close this PR and open a fresh one against
extensions/change-scroll-direction, or repurpose this branch?

@0xdhrv

0xdhrv commented Aug 31, 2026

Copy link
Copy Markdown
Member

Thanks for the detailed review — agreed, the primary workflow does overlap, so I'm happy to contribute the improvements to Change Scroll Direction instead.

What I'd bring over:

  • Replace the System Settings UI automation with a direct setSwipeScrollDirection call
    from PreferencePanesSupport — the same function the Trackpad pane itself calls. It
    writes the preference and applies it live in one step.
  • That removes scripts.ts with its per-version AppleScripts (Tahoe / Ventura / older)
    and the run-applescript dependency, so there's no UI hierarchy to re-fix on each
    macOS release, and no Accessibility permission needed.
  • Read current state via defaults read -g com.apple.swipescrolldirection (treating a
    missing key as "on", which is how macOS behaves on a fresh account) so the HUD can
    report the resulting state — "Natural scrolling ON (trackpad)" / "OFF (mouse)" —
    instead of "Scroll direction changed".
  • The existing jest suite covers fetchAppleScript, which goes away with the scripts;
    I'll rework the tests accordingly.

Heads up that this replaces the command's implementation end to end, so expect a rewrite of changeScrollDirection.ts rather than a small patch. I'd add myself to contributors.

One separate, entirely optional question for @gregoralbrecht: I drew an icon for this while working on my own version, and I'd be glad to offer it if you like it — happy to post it here first so you can see it before deciding. Completely your call, and a "no" changes nothing about the code above; I'll send that either way.

Would you prefer I close this PR and open a fresh one against extensions/change-scroll-direction, or repurpose this branch?

Thanks for understanding ❤️

You can create a new PR for the existing extension, and I advise to backup this branch if you want to

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

Labels

new extension Label for PRs with new extensions platform: macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants