Skip to content

feat: add neighbor peeks to scrolling layout - #418

Open
tingkai-c wants to merge 4 commits into
acsandmann:mainfrom
tingkai-c:neighbor-peek
Open

feat: add neighbor peeks to scrolling layout#418
tingkai-c wants to merge 4 commits into
acsandmann:mainfrom
tingkai-c:neighbor-peek

Conversation

@tingkai-c

@tingkai-c tingkai-c commented Jul 21, 2026

Copy link
Copy Markdown

Summary

Adds opt-in neighbor peeks to the scrolling layout's Niri navigation mode.

When enabled, the immediate columns beside the focused column remain partially visible. With focus-follows-mouse enabled, hovering a visible neighboring sliver focuses that column without allowing focus to cascade repeatedly across the strip.

Configuration

[settings.layout.scrolling]
focus_navigation_style = "niri"
neighbor_peek_width = 24
neighbor_peek_rearm_distance = 20

neighbor_peek_width defaults to 0, preserving existing behavior.

neighbor_peek_rearm_distance defaults to 20 pixels and controls how far the pointer must move horizontally before another neighbor-peek focus change can occur.

Behavior

  • Keeps immediate neighboring columns partially visible in Niri mode.
  • Prioritizes the navigation-side neighbor when both peeks cannot fit.
  • Supports focus-follows-mouse interaction with the exposed slivers.
  • Latches after a hover-triggered focus change to prevent accidental focus cascades.
  • Re-arms after the configured horizontal pointer movement.
  • Uses generation tracking so stale asynchronous confirmations cannot affect a newer hover.
  • Resets hover state after clicks, drags, Space changes, layout-mode changes, and configuration reloads.
  • Adds semantic validation for both configuration values; Rift's existing hot-reload path enforces it.

Compatibility

The feature is opt-in. Existing scrolling behavior remains unchanged unless neighbor_peek_width is set to a positive value.

Testing

Added 12 focused tests across layout, input handling, reactor behavior, and configuration.

  • Layout tests cover bilateral peeks, direction-prioritized peeks, neutral reveals, and column adjacency.
  • Input tests cover hover latching, re-arming, mode gating, and stale generations.
  • Reactor tests cover clipped-window detection and cascade suppression.
  • Configuration tests cover defaults and validation.

Full test suite: 420 tests passed.

Demo

neighbor-peek-demo.mov

@tingkai-c

Copy link
Copy Markdown
Author

Thanks for merging main into this branch. The event-tap conflict resolution dropped the upstream tap_recovery_discards_cached_keys_and_uses_live_flags test, so I restored it unchanged in 597f697. I also ran the full test suite on the merged branch: 440 tests passed.

@tingkai-c

Copy link
Copy Markdown
Author

Rebased onto current main and resolved the conflict. I also fixed a hover re-arming edge case found during review and added regression coverage. All 484 tests and nightly rustfmt pass; the PR is mergeable again.

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