Fix: show all symbols in letter long-press popup (#113)#114
Merged
Conversation
When long-pressing a letter, the popup keyboard now includes all
symbols defined at the corresponding position in the symbols layout,
not just the primary label. Previously a symbols-layout entry such as
`% per` or `( < { [` only contributed its first label to the
letter's popup; the symbol key's own popup keys were discarded.
addSymbolPopupKeys (and the number-row-in-symbols branch of
addNumberRowOrPopupKeys) now collect both the symbol key's label and
its popup labels via PopupSet.getPopupKeyLabels. PopupSet.symbol is
renamed to PopupSet.symbols and changed from String? to
Collection<String>?. createPopupKeysArray addAll's them; getHintLabel
keeps a single-character hint via firstOrNull().
Fixes LeanBitLab#113
Assisted-by: GitHub Copilot CLI
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When long-pressing a letter, the popup includes a
symboltaken from the corresponding position of the symbols layout. Previously only the symbol key's primary label was propagated; the symbol key's own popups were silently dropped. So a symbols-layout entry like% ‰(where%is the key and‰is its popup) would only contribute%to the letter's popup.This PR makes the letter popup include both the symbol key's label and all of its popup labels.
Changes
PopupSet.symbol: String?→PopupSet.symbols: Collection<String>?(the existing// maybe list of keys?TODO comment hinted at this).KeyboardParser.addSymbolPopupKeys(and the number-row-in-symbols branch ofaddNumberRowOrPopupKeys) now collectkey.labelpluskey.popup.getPopupKeyLabels(params).PopupKeysUtils.createPopupKeysArrayusesaddAll(symbols);getHintLabelkeeps a single hint viafirstOrNull().The change is local to the symbols-popup pipeline and doesn't touch any other popup source (number / layout / language / language priority).
Test
./gradlew :app:compileStandardDebugKotlinsucceeds../gradlew :app:testStandardDebugUnitTest: the 9 failures present are the same ones present onmainbefore this patch (unrelated —LayoutUtils.getContentcannot find layout assets in the test classpath, plus a couple of pre-existing emoji/input-logic failures). No new regressions.q(row 0, col 0) now offers%and‰;f(row 1, col 3) offers_,%,‰;b(row 2, col 5) offers-,–,⁻,—,·.Disclosure
This patch was AI-assisted: investigation and code changes were produced with GitHub Copilot CLI. I reviewed the diff before opening the PR.
Fixes #113