Skip to content

Restore the voice toolbar feature - #108

Merged
Akshayykadam merged 2 commits into
Akshayykadam:mainfrom
AnhDuck:restore-voice-toolbar
Oct 27, 2026
Merged

Akshayykadam merged 2 commits into
Akshayykadam:mainfrom
AnhDuck:restore-voice-toolbar

Conversation

@AnhDuck

@AnhDuck AnhDuck commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Brings back Gboard's floating voice toolbar for Rambler dictation. While dictating, a new ⏬ button next to ✓ shrinks the keyboard into a small floating bar. Dictation keeps going, and ⌨ brings the full keyboard back.

Galaxy S24+: dictating with Rambler, minimizing to the floating bar, then bringing the keyboard back

Closes #98

What changed

  • It's Google's own feature. Gboard already ships this toolbar for Rambler. PixelBoard forced a flag (enable_rambler_al_toolbar) on, which swaps in Google's newer Rambler bar, and that bar has no minimize button. PixelBoard now forces the flag off while Rambler is selected, which brings back the older bar and its floating toolbar.
  • The custom part is where the minimize button sits. With the flag off, Google puts ⏬ where ✕ normally is, so you can't cancel. This PR keeps ✕ on the left and moves ⏬ next to ✓, the same spot as the Minimize button in regular voice typing.
  • Screen reader labels. Google's code labels every button on this bar "Close Rambler", so TalkBack would read ✕, ⏬ and ⌨ the same way. ⏬ is now read as "Minimize keyboard" and ⌨ as "Back to keyboard", using Gboard's existing translated text.
  Rambler bar
- [✕]                    [✓]    PixelBoard today (no minimize)
- [⏬]                   [✓]    Google's older bar as shipped (no cancel)
+ [✕]               [⏬] [✓]    This PR

There's no new setting.

Before and after

Tablet (Xiaomi Pad 7). Tap an image to open it full size.

Before After
Rambler bar Before: Rambler bar with only ✕ and ✓ After: Rambler bar with ✕, ⏬ and ✓
Minimized No minimize button After: keyboard minimized to the floating Rambler bar
Docked at the bottom No minimize button After: floating Rambler bar docked at the bottom

Phone (Galaxy S24+, after):

Rambler bar Minimized
Phone: Rambler bar with ✕, ⏬ and ✓ Phone: keyboard minimized to the floating Rambler bar

Full-quality phone video (MP4)

Testing

  • ./gradlew test passes (349 tests), including new tests for the flag, the minimize key bookkeeping and the patch wiring. I checked the patched code itself by building the APK and decoding it.
  • I patched stock Gboard 18.5.3 and tested it on two devices:
    • Xiaomi Pad 7: ⏬ minimizes, ⌨ brings the keyboard back, ✕ cancels and ✓ finishes. Dictation keeps going through minimize and restore. The floating bar can be dragged and docks at the bottom. The normal keyboard and regular voice typing don't get an extra button. Battery (Battery drain: Rambler keeps GoogleAsrService bound after dictation (candidate fix tested) #3): after pressing Home while minimized, the mic turns off and Google's speech service isn't left running.
    • Samsung Galaxy S24+ (Snapdragon 8 Gen 3, Android 17): minimize, drag, dock, restore and finish while dictating, as shown in the video above. I also read the screen reader labels from Android's accessibility tree: "Close Rambler", "Minimize keyboard" and "Insert text" on the bar, and "Back to keyboard" and "Insert text" on the floating bar.

Not covered

  • I only tested Gboard 18.5.3. On other versions the flag change still applies, but ⏬ stays in Google's spot in place of ✕.
  • Regular voice typing's floating bar can also go vertical and snap to the left or right edge. The Rambler bar doesn't, and this PR doesn't add that.
  • While the floating bar is animating to your voice, it can't be dragged until you pause. That's Gboard's own behavior.

Risk

Easy to undo: reverting this PR brings back today's Rambler bar. It only changes the Rambler bar while Rambler is the selected voice typing engine.

Technical details
  • Flag. enable_rambler_al_toolbar (mra.n in 18.5.3) picks between Google's AL toolbar (flv: ✕ and ✓ only, not draggable) and the classic Rambler widget (flw: draggable, docks at the bottom). When it's false, fll hands the live Rambler session between the keyboard header and the widget, and the header's flz.D() returns the minimize key (avn(7) → msg.m(), enter the Rambler widget) instead of the close key. PixelBoard had the flag in AGENTIC_FEATURE_FLAGS, so it was forced on. GboardRambler1803StockPolicy now returns false for it while Rambler is selected and leaves it alone otherwise.
  • GboardRamblerMinimizeKeyPatch (18.5.3 targets only; it does nothing if any target is missing):
    • flz.D(): add Gboard's minimize key to key_pos_header_end_extra_key (mub.a), the slot stock voice typing uses for Minimize, then return the stock close key (E(u())) for the close slot.
    • flb.I(...) (header teardown): remove the key from the end slot (mue.a).
    • flz.W(...): Rambler hides the other header slots, so show the end slot again afterwards.
    • flz.D() and flw.D() (the floating widget's ⌨ key): F(icon, action) is C(icon, action) + label "Close Rambler" (0x7f14004a) + a(). Both keys are now built with C() and labelled with mtm.h(): 0x7f14167c "Minimize keyboard" (stock voice typing's Minimize label) and 0x7f1401ab "Back to keyboard".
    • GboardRamblerMinimizeKeyRuntime looks up the slot id by name and remembers whether it placed the key, so teardown only removes what it added.
  • Three new RuntimeCallId entries. No new settings, strings or resources; the labels are Gboard's own strings.

Written with Claude Opus 5.5. Reviewed by GPT-6.1 Sol (high reasoning) over 2 rounds: round 1 found the screen reader labels, and round 2 found no issues. Tested on a Samsung Galaxy S24+ (Snapdragon 8 Gen 3) and a Xiaomi Pad 7.

🤖 Generated with Claude Code

AnhDuck and others added 2 commits October 27, 2026 00:18
Rambler hid Gboard's collapsed voice toolbar because PixelBoard forced
enable_rambler_al_toolbar on. With it off, stock Gboard already shows a
minimize key in the Rambler header, collapses the keyboard into the
floating voice toolbar, and hands the live Rambler session between the
header and the toolbar.

- Force enable_rambler_al_toolbar off while Rambler is selected
- Keep the Rambler close key and move Gboard's minimize key into the
  header end extra key slot next to the finish key, matching stock voice
  typing (18.5.3 only; other versions keep stock placement)
- Remove the minimize key on Rambler header teardown and keep it visible
  when the header hides non-Rambler slots
- Add policy, runtime and patch source tests

Closes Akshayykadam#98

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gboard builds every Rambler bar key through flb.F(), which labels it
"Close Rambler". With the AL toolbar off, TalkBack read the minimize key
and the floating toolbar's keyboard key as "Close Rambler" too, next to
the real close key. Build both keys through F()'s own builder and give
them Gboard's existing localized labels: "Minimize keyboard" (the label
stock voice typing uses) and "Back to keyboard".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnhDuck
AnhDuck marked this pull request as ready for review October 27, 2026 07:54
@Akshayykadam
Akshayykadam merged commit 0a3d0c6 into Akshayykadam:main Oct 27, 2026
1 check passed
@Akshayykadam

Copy link
Copy Markdown
Owner

Thanks a lot for the high-quality contribution, @AnhDuck! LGTM! Merging now.

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.

Feature Request: Hide keyboard while using Rambler Voice Typing

2 participants