Skip to content

feat: add follow option to app rules for auto workspace switching#351

Open
qeude wants to merge 2 commits into
acsandmann:mainfrom
qeude:feat/app-rule-follow-workspace
Open

feat: add follow option to app rules for auto workspace switching#351
qeude wants to merge 2 commits into
acsandmann:mainfrom
qeude:feat/app-rule-follow-workspace

Conversation

@qeude

@qeude qeude commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a follow option to app_rules that, when true, automatically switches the user to the assigned workspace when a matching window opens and the app is frontmost.

Problem

Before this change, if you had an app rule like:

{ app_id = "com.apple.dt.Xcode", workspace = 0 }

and opened Xcode while on workspace 2, the window would be created on workspace 0 but you'd stay on workspace 2. You had to manually switch to see it.

Solution

Add a follow boolean field to AppWorkspaceRule:

{ app_id = "com.apple.dt.Xcode", workspace = 0, follow = true }

When follow = true and the app is frontmost on open, the reactor triggers the existing handle_app_activation_workspace_switch path to switch to the target workspace.

Changes

  • Config: add follow field to AppWorkspaceRule
  • Model: propagate follow through AppRuleAssignment
  • Actor/Reactor:
    • handle_application_launched: switch workspace when app opens frontmost and rule has follow = true
    • handle_window_created: switch workspace when new window opens and app is frontmost with follow = true
    • process_windows_for_app_rules: returns whether a follow is needed
    • emit_layout_events / on_windows_discovered_with_app_info: propagate follow flag
  • Tests: add unit tests for model-level follow propagation, reactor-level follow detection, and the actual workspace switch mechanism
  • Docs: update rift.default.toml with the new option and an example

qeude added 2 commits May 5, 2026 22:21
Adds a per-rule follow flag that, when true, automatically switches
to the assigned workspace when a matching window opens and the app
is frontmost. This allows users to open an app and land directly
on the workspace it was assigned to, rather than staying on the
current workspace.
Adds integration tests for the reactor-level follow behavior and
updates the default config documentation with the new follow option.
@qeude qeude marked this pull request as ready for review May 5, 2026 20:22
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