Skip to content

fix(ADFA-2579): Make font slider responsive#862

Merged
dara-abijo-adfa merged 2 commits intostagefrom
bugfix/ADFA-2579-font-slider
Jan 23, 2026
Merged

fix(ADFA-2579): Make font slider responsive#862
dara-abijo-adfa merged 2 commits intostagefrom
bugfix/ADFA-2579-font-slider

Conversation

@dara-abijo-adfa
Copy link
Contributor

Resolve issue with font slider not responding to drag events

Fixes #845

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 20, 2026

📝 Walkthrough

Release Notes - Font Slider Responsiveness Fix

Summary

Fixes unresponsive font size slider control by removing special-case handling that was blocking drag and touch events.

Changes

  • Removed Slider exception from long-press recursion: The applyLongPressRecursively function no longer skips Slider components, allowing touch events to propagate normally to sliders for drag interactions

  • Simplified dialog preference tooltip handling: Replaced list-item-specific long-click listener with recursive long-press handling on the dialog's decor view, enabling tooltips across all dialog content while allowing underlying controls (like sliders) to function properly

Impact

  • Font size slider now responds to drag events as expected
  • Tooltip system remains functional across dialog content
  • Cleaner, more maintainable code with centralized gesture handling

⚠️ Risks & Best Practice Violations

Risk: Removing Slider exception may introduce unintended side effects

  • Long-press handlers are now applied to Slider components recursively
  • If Slider events are not properly consumed by the long-press listener, this could cause unexpected behavior
  • Mitigation: Verify slider drag behavior does not trigger tooltips unintentionally

Risk: Lack of test coverage

  • No unit tests visible for Slider drag functionality
  • Changes were validated only through manual issue resolution (Issue #845)
  • Recommendation: Add regression tests for slider interactions and long-press behavior

Best Practice: Consider adding explicit long-press suppression for Slider

  • Rather than removing the exception entirely, consider conditionally preventing long-press on Slider to avoid consuming events
  • Current approach assumes listeners will return proper boolean values to avoid event consumption

Walkthrough

The changes simplify long-press gesture handling by removing Slider-specific special cases from the recursive view traversal and applying a unified long-press handler across all views in a dialog's hierarchy.

Changes

Cohort / File(s) Summary
Gesture handling simplification
common/src/main/java/com/itsaky/androidide/utils/ViewExtensions.kt
Removed Slider-specific recursion path from applyLongPressRecursively. All ViewGroup children now processed uniformly via recursive calls without special setupGestureHandling invocation for Sliders.
Dialog long-press interaction
preferences/src/main/java/com/itsaky/androidide/preferences/DialogPreference.kt
Replaced per-item ListView OnItemLongClickListener with recursive long-press handler applied to dialog's decor view, broadening tooltip trigger to all long-presses within the dialog rather than just list items.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Daniel-ADFA
  • itsaky-adfa

Poem

🐰 Sliders once caught in special care,
Now glide through views both here and there,
Recursion flows so pure and clean,
No branching paths to block the scene,
Tooltips dance on every press! 🎯

🚥 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
Title check ✅ Passed The title clearly indicates the primary change: making the font slider responsive, which directly addresses the linked issue about the unresponsive slider.
Description check ✅ Passed The description is directly related to the changeset, clearly stating the intent to resolve the unresponsive font slider issue and referencing the linked issue #845.
Linked Issues check ✅ Passed The code changes address the unresponsive slider issue by removing Slider-specific recursion handling and applying a recursive long-press handler to the dialog's decor view, which should restore slider responsiveness.
Out of Scope Changes check ✅ Passed All changes are scoped to the font slider responsiveness issue: removing problematic Slider-specific handling in ViewExtensions and updating the dialog preference's long-press handler application.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@preferences/src/main/java/com/itsaky/androidide/preferences/DialogPreference.kt`:
- Around line 49-52: List-based dialog preferences
(SingleChoicePreference/MultiChoicePreference) never get long-press tooltips
because setSingleChoiceItems/setMultiChoiceItems create a ListView and
applyLongPressRecursively (in ViewExtensions.kt) bails out for ListView, so
TooltipManager.showIdeCategoryTooltip attached in DialogPreference.kt never
reaches list items; fix by adding list-item-specific long-press wiring in
ChoiceBasedDialogPreference: after building the AlertDialog in
DialogPreference.createDialog (or in ChoiceBasedDialogPreference), find the
dialog's ListView (alertDialog.listView or
alertDialog.window?.decorView?.findViewById<ListView>(android.R.id.list)) and
iterate its children to set the same long-press listener that calls
TooltipManager.showIdeCategoryTooltip(preference.context, view, tooltipTag) (or
modify applyLongPressRecursively to descend into ListView children) so list rows
receive the tooltip handler.

@jatezzz jatezzz self-requested a review January 22, 2026 13:59
@dara-abijo-adfa dara-abijo-adfa merged commit ee003a9 into stage Jan 23, 2026
2 checks passed
@dara-abijo-adfa dara-abijo-adfa deleted the bugfix/ADFA-2579-font-slider branch January 23, 2026 15:31
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.

Font size slider is unresponsive

2 participants

Comments