Skip to content

feat: Centralize shared keyboard options#1304

Open
thetwai-dev wants to merge 1 commit into
Greenstand:masterfrom
thetwai-dev:feat/hide-suggestions-on-keyboard
Open

feat: Centralize shared keyboard options#1304
thetwai-dev wants to merge 1 commit into
Greenstand:masterfrom
thetwai-dev:feat/hide-suggestions-on-keyboard

Conversation

@thetwai-dev

@thetwai-dev thetwai-dev commented Jun 17, 2026

Copy link
Copy Markdown

Thank you for opening a Pull Request!

Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests are added/updated (if necessary)
  • Ensure the linter passes (./codeAnalysis to automatically apply formatting/linting)
  • Appropriate docs were updated (if necessary)

📸 Proof of change (REQUIRED)

Every PR must include a screen recording / video showing the change working.
UI changes must also include before/after screenshots.
Just drag-and-drop the files into the boxes below — GitHub will upload them.
PRs without the required media will be flagged automatically and cannot be merged.

🎥 Screen recording / video (always required)

🖼️ Screenshots (required for any UI change)

Before After
  • This change has no user-visible / UI effect (refactor, docs, CI, etc.), so screenshots are not applicable.
    • A maintainer may also apply the non-ui label. A video is still required even for non-UI changes.

Addresses #736 partially. Only organize code, not hide suggestions.

@cynthiabondi
cynthiabondi requested a review from Elforama June 18, 2026 10:40

@Tarek-Bohdima Tarek-Bohdima left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for picking up such an old one, @thetwai-dev — and for digging into the keyboard options. I ran both approaches on an emulator (Pixel 7, Gboard) to ground this. A couple of things before it can land:

1. KeyboardType.Password — it works, with one tradeoff.
On Gboard it's actually the only approach that hides the suggestion strip. I also tried the "proper" route — InterceptPlatformTextInput + TYPE_TEXT_FLAG_NO_SUGGESTIONS — and Gboard ignores it: the strip still shows even with autocorrect disabled. So your choice is the right one for Gboard. The one visible tradeoff is that Gboard switches to its password layout (number row, no emoji/glide keys). I'm deferring the final yes/no on the approach to @Elforama since he researched this previously.

2. Scope — this is one field of several. #736 asks to hide suggestions on all text inputs. These still use KeyboardType.Text with suggestions on:

  • ChatScreen.kt:170
  • SessionNoteScreen.kt:104
  • NameEntryView.kt:107 and :134
  • AddWalletScreen.kt:110

Rather than copy-paste the same option into each, please centralize it — a single shared KeyboardOptions constant (or a small shared text-field composable) that all these fields use. Then change Fixes #736Addresses #736 so the issue stays open until every field is covered.

3. Minor — API consistency. You switched this one call site to autoCorrectEnabled while 7 others still use the deprecated autoCorrect. Both compile on Compose 1.7.5, but let's not mix spellings — migrate them together (ideally via the shared component above) or leave this one as autoCorrect for now.

No rush — happy to help once the approach is settled with Jonathan.

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown

✅ Thanks @thetwai-dev — required media detected. Nothing more needed here!

@thetwai-dev

Copy link
Copy Markdown
Author

For a single shared KeyboardOptions, one thing to note is that some of the text inputs have a few extra properties that are different from others. But I think it is possible to create like a shared base template that we can use to add more.

And for this issue, I'm just waiting for @Elforama to give the greenlight.

@Elforama

Copy link
Copy Markdown
Contributor

A single shared text input "template" that does it's best to hide the unneeded suggestions bar sounds great.

@thetwai-dev

Copy link
Copy Markdown
Author

@Elforama
And just to clarify, are you also accepting to use Keyboard.Password for fields that are simple text to hide suggestions? This would have some side effects as mentioned above.

@Elforama

Copy link
Copy Markdown
Contributor

No, only logic and\or config to avoid any extra keyboard tools. The input type should be per usecase

@thetwai-dev

thetwai-dev commented Jun 28, 2026

Copy link
Copy Markdown
Author

Ok, then I'll only centralize common keyboard options and leave the keyboard type as it is. (And this issue wouldn't be fully fixed by this pr yet)

@thetwai-dev
thetwai-dev force-pushed the feat/hide-suggestions-on-keyboard branch from cf682cd to 5554f57 Compare July 2, 2026 03:56
@thetwai-dev thetwai-dev changed the title feat: hide keyboard suggestions when typing organization name feat: Centralize shared keyboard options Jul 2, 2026
@thetwai-dev

Copy link
Copy Markdown
Author

The shared keyboard option only has 2 properties since those were the most common one that I could find. However, I believe there could be more default options we might want to add, and those values can be overwritten with .copy(..).

This also fixes the API inconsistency with autoCorrectEnabled.

@Elforama

Copy link
Copy Markdown
Contributor

@thetwai-dev Please attach a video showing the text fields working as well as fixing the merge conflict.

@thetwai-dev
thetwai-dev force-pushed the feat/hide-suggestions-on-keyboard branch from 896ab86 to 306c0b7 Compare July 17, 2026 01:43
@thetwai-dev

Copy link
Copy Markdown
Author
2026-07-16.18-38-23.mp4

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.

3 participants