Skip to content

fix(ui): pointer-driven palette focus doesn't scroll the list - #11

Merged
kleinbem merged 1 commit into
mainfrom
crfull-prevent-scroll
Nov 11, 2026
Merged

kleinbem merged 1 commit into
mainfrom
crfull-prevent-scroll

Conversation

@kleinbem

@kleinbem kleinbem commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #10 (CodeRabbit outside-diff finding in its last review, posted as it merged): focusing a partly visible result on mousemove could scroll the list and slide another result under the pointer. Pointer-driven followSelection now focuses with preventScroll: true; arrow keys keep scrolling.

Tests: npm run check 0 errors (1 existing autofocus warning).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Prevented the page from scrolling when selecting results with a pointer, while preserving existing keyboard navigation behaviour.

CodeRabbit on #10 (outside the diff): focusing a partly visible result
on mousemove could scroll another result under the cursor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Pointer movement now focuses the selected command result without scrolling. Keyboard navigation keeps the default focus behaviour.

Changes: Command palette focus

Layer / File(s) Summary
Selection focus scroll control
src/lib/components/CommandPalette.svelte
followSelection accepts an optional preventScroll value and passes it to the selected result link’s focus call. Pointer movement sets the value to true; keyboard navigation uses the default value.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Possibly related PRs

  • kleinbem-dev/foyer#10: Adds pointer-driven focus for the highlighted result; this PR prevents that focus from scrolling.
  • kleinbem-dev/foyer#9: Adds result-selection focus handling that this PR extends with a scroll-prevention option.
Merge Risk: Minimal · up to 5a563

Pointer selection is intended to avoid unwanted scrolling while keyboard navigation remains unchanged. No merge-blocking risk is identified.

Architecture risk: Low · up to 5a563

The change affects 1 system.

Changed systems: src

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (ui) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/lib/components/CommandPalette.svelte: followSelection adds an optional preventScroll parameter, defaulting to false, and forwards it to the selected result link’s focus call. The previous implementation focused the link without focus options.
  • observed — Modified behavior in src/lib/components/CommandPalette.svelte: Pointer movement now calls followSelection(true), requesting focus without scrolling; it previously called followSelection() with the default behaviour.
Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: preventing unwanted scrolling when pointer-driven palette focus occurs.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d204b4b5-3552-498e-9dc4-32a26cab461e
Commits

Reviewing files that changed from the base of the PR and between b8bf836 and 5a56373.

Files selected for processing: 1

  • src/lib/components/CommandPalette.svelte

Limit details: You’ve used all 10 included reviews currently available.

@kleinbem
kleinbem merged commit 8f7ff3e into main Nov 11, 2026
3 checks passed
@kleinbem
kleinbem deleted the crfull-prevent-scroll branch November 11, 2026 03:15
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