Skip to content

Add setting to disable URL/email specific layout - #2626

Draft
MiMoHo wants to merge 2 commits into
HeliBorg:mainfrom
MiMoHo:url-email-layout-toggle
Draft

Add setting to disable URL/email specific layout#2626
MiMoHo wants to merge 2 commits into
HeliBorg:mainfrom
MiMoHo:url-email-layout-toggle

Conversation

@MiMoHo

@MiMoHo MiMoHo commented Jul 8, 2026

Copy link
Copy Markdown

What

Adds a preference "Adapt layout for URL and email fields" (default on, i.e. current behaviour). When turned off, getKeyboardMode() returns TEXT for URI and email input types, so the base layout and popups stay identical to a normal text field: the comma key stays a comma (no / or @ swap), and no TLD popups are shown.

The whole change is a single gate in KeyboardLayoutSet.getKeyboardMode():

InputType.TYPE_CLASS_TEXT ->
    if (!Settings.getValues().mUrlEmailLayout) KeyboardMode.TEXT
    else if (InputTypeUtils.isEmailVariation(variation)) KeyboardMode.EMAIL
    else if (variation == InputType.TYPE_TEXT_VARIATION_URI) KeyboardMode.URL
    else KeyboardMode.TEXT

plus the pref plumbing (Settings/Defaults/SettingsValues) and one SwitchPreference in the Preferences screen, next to "Show TLD popup keys".

Why

In URL fields the comma key becomes / and in email fields @ (the variation_selector in functional_keys.json). This is intentional and can already be reverted with a custom functional-keys layout, as pointed out in #1573 and #734.

However, some users specifically want a keyboard whose base layout never shifts depending on the field — muscle memory for the comma position being the main reason — and building a full custom functional-keys layout is a fairly heavy step for "please don't move my comma". This offers a one-switch opt-out for that preference, without changing anything for everyone else.

Notes / open questions

  • Draft, opening this mainly for a decision: is a built-in setting wanted here, or should this stay "customize your layout"? Happy to close if the latter.
  • Default is unchanged behaviour → existing users see no difference.
  • Scope choice: the switch disables the entire URL/email mode (base key and TLD popups), which matches "no automatic adaptation at all". If you'd rather it only kept the comma/period base keys but still showed TLD popups, I can narrow it to the variation_selector instead.
  • English strings only; no translations touched.
  • Builds cleanly (:app:compileDebugSources).

Refs #1573, #734.

When typing in a URL field the comma key becomes "/" and in an email
field it becomes "@" (the variation_selector in functional_keys.json).
This is intentional, but some users prefer a keyboard whose base layout
never changes; currently the only way to keep the comma in these fields
is a custom functional-keys layout (see HeliBorg#1573, HeliBorg#734).

Add an "Adapt layout for URL and email fields" preference (default on,
i.e. unchanged behaviour). When disabled, getKeyboardMode() returns TEXT
for URI/email input types, so the normal layout and popups are used
everywhere.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MiMoHo
MiMoHo force-pushed the url-email-layout-toggle branch from b7450b8 to 5726200 Compare July 8, 2026 00:22
New resource strings only, per the CONTRIBUTING exception.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant