Skip to content

fix: prevent search selection auto-scroll - #559

Merged
phurpa-tsering merged 1 commit into
VoidenHQ:betafrom
igorzelaya-io:bugfix/prevent-selection-auto-scroll
Oct 5, 2026
Merged

phurpa-tsering merged 1 commit into
VoidenHQ:betafrom
igorzelaya-io:bugfix/prevent-selection-auto-scroll

Conversation

@igorzelaya-io

Copy link
Copy Markdown
Contributor

Fixes #558

Summary

  • keep the hidden CodeMirror search bridge panel out of layout
  • explicitly place the bridge at the top so it cannot become a viewport-sized bottom scroll margin
  • add a regression test for panel placement and the resulting bottom margin

Root cause

Voiden renders its persistent Find controls outside CodeMirror, but still opens an empty internal panel to initialize CodeMirror search state. Custom CodeMirror panels default to the bottom unless the returned panel specifies top: true. Because the internal panel group is hidden, CodeMirror measured it as a full-height bottom scroll margin. Its drag-selection logic therefore treated ordinary pointer positions as below the viewport and continuously scrolled downward.

Verification

  • vitest --config vitest.config.ts run src/core/editors/code/__test__/hiddenSearchPanel.test.ts (passes)
  • exact component reproduction before the fix reported a 720px bottom scroll margin and advanced scrollTop during a held, mid-viewport drag; the regression test now asserts a zero bottom margin

Existing baseline issues

The full UI run completed 188 tests successfully but still has one unrelated pipeline assertion failure and one existing plugin mock suite error.

@phurpa-tsering
phurpa-tsering changed the base branch from main to beta September 21, 2026 08:00
@phurpa-tsering

phurpa-tsering commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks @igorzelaya-io for the fix and the regression test, and for tracing the cause so clearly.

One change before we can merge: we do development on the beta branch, not main, so this PR needs to target beta. Could you:

  • Rebase your branch onto beta. Since it's a single commit, this should work: git fetch origin && git rebase --onto origin/beta origin/main bugfix/prevent-selection-auto-scroll
  • Push it (git push --force-with-lease).
  • Change the PR's base branch from main to beta (Edit next to the PR title).

Once it's on beta, we'll finish reviewing and merge it there. Thanks!

@igorzelaya-io
igorzelaya-io force-pushed the bugfix/prevent-selection-auto-scroll branch from 759a38d to b8569e4 Compare September 22, 2026 08:28
@igorzelaya-io

igorzelaya-io commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Rebased bugfix/prevent-selection-auto-scroll onto the current beta branch and force-pushed with lease as requested. The PR is now based on beta and GitHub reports it mergeable.

After the rebase, beta already contains the hidden-panel helper and regression test, so this branch now only wires CodeEditor to createHiddenSearchPanel. The focused regression test passes (1/1).

@phurpa-tsering phurpa-tsering left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @igorzelaya-io, this looks good from our side! We reproduced the auto-scroll on beta and confirmed your change fixes it, with Find still working as expected. Thanks for the clear root-cause write-up and for contributing! 🙌

@phurpa-tsering
phurpa-tsering merged commit 650b5eb into VoidenHQ:beta Oct 5, 2026
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.

[Bug] Find/Search Causes Automatic Scrolling When Selecting Text in Non-VOID Files

2 participants