Skip to content

[Bug]: Swiping fast onto a slider or an item with actions adjusts the previous reading control #449

Open

Description

@nibarAhmed

If you move onto a slider, or an item with actions, and swipe up or down straight away, Backtalk changes the reading control you were on before (for example characters) instead of the slider's value or the item's actions. Swiping slowly works.

Steps to reproduce

  1. Set the reading control to characters.
  2. Open Settings > Sound & vibration.
  3. Swipe right onto a volume slider and swipe up immediately after.

Actual behavior

The characters reading control is adjusted and the volume doesn't change.

Expected behavior

The slider is adjusted, the same as when you pause before swiping up. The same goes for items with actions, such as home screen app icons: a fast swipe up or down should move through the actions.

Cause

When focus lands on a slider or an item with actions, SelectorController.newItemFocused switches the reading control automatically, but while a touch is active it holds the switch back until touchInteractionState(false). Android reports the end of the touch about 300 ms after the finger lifts, while Backtalk acts on its own gestures right away. A fast second swipe therefore lands in the same touch interaction and acts on the old reading control. I confirmed the order with trace logs on an emulator: the adjust ran with GRANULARITY_CHARACTERS before the switch to the slider setting.

Fix

This is fixed on my branch t3/fix-slider-action-touch-lag (commit 8ad68685): adjustSelectedSetting and selectPreviousOrNext now apply the held-back switch before acting, so a fast swipe acts on the item you just reached. It includes a unit test that fails without the fix, and I checked sliders, app icon actions and changing the reading control on an emulator. I'll open a PR once I'm under my open PR limit.

Device

  • Samsung Galaxy S26 Ultra (SM-S948B), Android 17
  • Backtalk master (dcf14ead)

Activity

  1. nibarAhmed commented on Nov 14, 2026

    @nibarAhmed
    ContributorAuthor

    Note

    🤖 Claude Opus 5.5 responding on behalf of nibarAhmed

    The fix is verified on a Galaxy S26 Ultra: a fast swipe onto a slider or an item with actions now adjusts that item. Before I open the PR, one decision on how much of Google's SelectorController.java it should touch.

    Proposed change

    The fix applies the held-back switch at the start of the two gestures that read the reading control:

    /**
     * Applies a focus change that is waiting for the touch to end. A gesture can arrive before the
     * touch ends, so it must act on the setting for the item that now has focus.
     */
    private void applyPendingFocusChange() {
      if (lastFocusedNode != null) {
        switchCurrentSetting(lastFocusedNode);
      }
    }
    
    private boolean selectPreviousOrNext(...) {
      applyPendingFocusChange();
      ...
    }
    
    public void adjustSelectedSetting(EventId eventId, boolean isNext) {
      applyPendingFocusChange();
      ...
    }

    The regression test goes in WebReadingControlTest.kt, which is Backtalk's own file.

    Decision needed

    touchInteractionState already does the same thing inline when the touch ends:

    if (!touchActive) {
      if (lastFocusedNode != null) {
        switchCurrentSetting(lastFocusedNode);
      }
    }
    1. Leave Google's block untouched (recommended). The change to Google's file is about 10 added lines and no rewritten ones. The cost is that the three-line check exists twice.
    2. Make that block call the helper. There's no duplication, but four of Google's existing lines are rewritten, which makes merges from upstream a bit more likely to conflict.

    Both behave the same. My branch currently has option 2; I'll switch it to whichever you prefer before opening the PR.

  2. trypsynth commented on Nov 15, 2026

    @trypsynth
    Owner

    Option 1, please: leave Google's block in touchInteractionState as it is and add the helper for the two gestures. Having the three-line check in two places is a fair price for keeping Google's lines unchanged. This is the bug I most want fixed, and I know you're at three open PRs, so I'll get #451 or #407 done first to free a slot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions