Skip to content

feat(SwipeActions): swipe messages and Activity items to run an action - #530

Merged
3kh0 merged 5 commits into
3kh0:mainfrom
ingoau:feat/swipe-actions
Dec 4, 2026
Merged

3kh0 merged 5 commits into
3kh0:mainfrom
ingoau:feat/swipe-actions

Conversation

@ingoau

@ingoau ingoau commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Adds the Swipe Actions plugin (messages category, off by default).

What it does

Swipe a message or Activity item sideways with two fingers on a trackpad to run an action, like swiping an email on a phone. The row slides with your fingers over a coloured reveal showing the action; past the line it fills in and taps the trackpad once (navigator.vibrate, Slack desktop on a Mac), and letting go runs it. Letting go short of the line puts it back; a quick flick runs it anyway.

Each direction gets its own action, per surface:

  • Channels, DMs & Unreads and Threads (two pairs): any message menu or hover action (handle_message_actions), an app message shortcut, another plugin's action from menu.getMessageActions, or toggling a reaction with a chosen emoji (changeReactionFromUserAction).
  • Activity: an item's right-click menu entry (from getActivityItemMenuTemplate / getNonChannelActivityItemMenuTemplate), or a hover toolbar button such as Clear, Mark complete or Reschedule.

The custom settings panel lists seeded actions, plus anything seen when you open a message's or an Activity item's menu (MAMenu / MenuFromTemplate patches), saved in plugin storage. Swipe distance, when the action runs (on release or on crossing the line), quick flicks, haptics and scroll direction are live settings.

How swipes are read

Pages get no scroll phases, so engine.ts reads swipes from wheel events alone: a capture-phase, non-passive document listener locks to the horizontal axis, and the end of a swipe is a gap in events or a run of shrinking deltas (AppKit momentum after the fingers lift), whose travel is taken back. Vertical scrolling, mouse wheels (coarse first deltas, deltaMode, Shift) and sideways scrolling inside code blocks and tables are left alone. Pop-outs are covered through api.onDocument.

Verification

  • bun run fmt:check, bun run lint, bun run typecheck, bun run test (new engine.test.ts and actions.test.ts). lint:sh not run: no ShellCheck locally, and no shell changes.
  • bun run build -- desktop firefox chromium userscript, bun run extension:lint, bun run extension:validate, git diff --check
  • Tested in Slack desktop over CDP: channel, Unreads and thread swipes (reply in thread, forward, emoji picker), Activity swipes (Open in home; Clear, then Undo), vertical scroll unaffected, settings panel and catalog discovery.

🤖 Generated with Claude Code

ingoau and others added 4 commits December 4, 2026 13:31
Two-finger trackpad swipes on messages (channels, DMs, Unreads, threads) and
Activity items run an action picked per surface and direction: any message
menu or hover action, an app shortcut, a reaction, or an Activity menu item
or hover button such as Clear.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… pop-outs

Messages with attachments start with hidden aria-label spans, so the swipe
moved a span and the reveal covered the message. Slide the row child that
holds the message kit instead. Node checks no longer use instanceof, which
missed every node in a pop-out window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Resting fingers past the line no longer count as letting go; a stop
  after steady movement waits 300 ms before the action runs.
- Wheel events use their own timestamps, so momentum queued behind a
  slow render doesn't start a new swipe.
- A vertical scroll or reversal right after a swipe is no longer
  swallowed as momentum.
- Engine clock and timers come from the window the swipe happens in.
- Retry finding Slack's message action handler instead of caching a miss.
- Wait for the saved action list to load before saving discoveries.
- Roll back the editor when saving a setting fails.
- Split Activity "to-do" and "Save for later" into separate actions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ealed strip

Slowing down while sliding back was read as post-lift momentum, and taking
that travel back put the row past the line again, so it ran anyway. A run
of shrinking deltas toward the start now cancels, and pulling back 20px from
the furthest point disarms until you push out again.

The label now spans the revealed strip and adapts to its size: icon over
text on tall rows, one line with an ellipsis on short ones, icon only when
narrow. Built-in actions get short names.
@3kh0
3kh0 merged commit 5a4a395 into 3kh0:main Dec 4, 2026
16 checks passed
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.

2 participants