Skip to content

fix: isolate horizontal scroll in disassembly view (#348)#725

Open
yhs0602 wants to merge 1 commit intomasterfrom
fix/348-tab-sensitivity
Open

fix: isolate horizontal scroll in disassembly view (#348)#725
yhs0602 wants to merge 1 commit intomasterfrom
fix/348-tab-sensitivity

Conversation

@yhs0602
Copy link
Owner

@yhs0602 yhs0602 commented Feb 25, 2026

Summary

Fixes #348 — Slight horizontal finger movement while scrolling vertically causes accidental horizontal scroll / apparent tab switching in the disassembly view.

Problem

The horizontalScroll modifier was applied directly on InfiniteList (which wraps a LazyColumn). Because both scroll directions competed at the same layout node, the horizontal scroll would intercept vertical gestures if the finger moved even slightly sideways.

Fix

Wrapped InfiniteList in a Box that owns the horizontalScroll, while InfiniteList/LazyColumn now exclusively owns vertical scroll:

// Before
InfiniteList(modifier = Modifier.horizontalScroll(rememberScrollState()), ...)

// After
Box(modifier = Modifier.fillMaxSize().horizontalScroll(scrollState)) {
    InfiniteList(modifier = Modifier.fillMaxWidth(), ...)
}

This way the LazyColumn gets first pick on vertical gestures, and only clearly horizontal swipes trigger the outer horizontalScroll.

Testing

  • Open a .so file → Disassembly tab
  • Scroll up/down with a slightly diagonal finger motion
  • Verify no accidental horizontal scrolling occurs

Summary by CodeRabbit

Release Notes

  • Refactor
    • Improved horizontal scrolling structure in the binary disassembler view for better layout management and scrolling performance.

Previously, horizontalScroll modifier was applied directly on InfiniteList
(which wraps a LazyColumn). This caused the horizontal scroll gesture to
compete with the vertical LazyColumn scroll, resulting in accidental
horizontal movement when users slightly tilted their finger while
scrolling vertically.

Fix: Wrap InfiniteList in a Box that owns horizontal scroll, while
InfiniteList/LazyColumn owns only vertical scroll. This ensures vertical
scroll takes priority over horizontal, eliminating accidental tab/scroll
switching.

Fixes #348
@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3a3d43 and 78e592e.

📒 Files selected for processing (1)
  • app/src/main/java/com/kyhsgeekcode/disassembler/ui/tabs/BinaryDisasmTab.kt

📝 Walkthrough

Walkthrough

The change restructures horizontal scrolling in the disassembly tab by moving the scroll modifier from the InfiniteList to a surrounding Box container with a dedicated scroll state, improving scroll sensitivity handling without altering the core rendering logic.

Changes

Cohort / File(s) Summary
Scroll State Refactoring
app/src/main/java/com/kyhsgeekcode/disassembler/ui/tabs/BinaryDisasmTab.kt
Relocated horizontal scroll modifier from InfiniteList to a containing Box element. Introduced dedicated rememberScrollState() for the Box, changed InfiniteList modifier from horizontalScroll() to fillMaxWidth(), and added fillMaxSize() to the outer Box to manage scroll sensitivity.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 wiggles nose
A scroll too swift, a touch too light,
Made swiping dance left-right,
But now the scroll state finds its place,
In a Box with breathing space,
Gentle flows instead of jumps—
No more sensitive tab bumps! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
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 fix: isolating horizontal scroll in the disassembly view to address the tab sensitivity issue.
Linked Issues check ✅ Passed The code changes successfully address issue #348 by separating horizontal and vertical scroll handlers, reducing unintended tab switches during vertical scrolling.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the horizontal scroll sensitivity issue; no out-of-scope modifications are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/348-tab-sensitivity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

Disassembly tabs are too sensitive

1 participant