From 56ee38c24c988e53499be2877ecf7a244c86fdfd Mon Sep 17 00:00:00 2001 From: LeanBitLab Date: Tue, 26 May 2026 13:26:53 +0530 Subject: [PATCH 1/5] fix(emoji): scale grid cells by emoji font scale --- .gitignore | 4 ++- .../keyboard/emoji/DynamicGridKeyboard.java | 28 ++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index eb3db7f1c..70017a0e8 100755 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,6 @@ cline_docs/ .continue/ prompt_history.json chat.json -docs/superpowers/ \ No newline at end of file +docs/superpowers/ +.agents +.antigravitycli/ diff --git a/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java b/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java index 0e900cc2a..586ee470a 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java +++ b/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java @@ -65,19 +65,33 @@ public DynamicGridKeyboard(final SharedPreferences prefs, final Keyboard templat final Key key1 = getTemplateKey(Constants.RECENTS_TEMPLATE_KEY_CODE_1); final int horizontalGap = Math.abs(key1.getX() - key0.getX()) - key0.getWidth(); final float widthScale = determineWidthScale(key0.getWidth() + horizontalGap); + int columnsNumVal; + int horizontalStepVal; + int horizontalGapVal; if (categoryId == EmojiCategory.ID_EMOTICONS) { // Emoticons need more space, so we use approx half the columns final int standardColumns = mBaseWidth / (int) ((key0.getWidth() + horizontalGap) * widthScale); - mColumnsNum = Math.max(1, standardColumns / 2); - mHorizontalStep = mBaseWidth / mColumnsNum; - mHorizontalGap = (int) (horizontalGap * widthScale * 2); + columnsNumVal = Math.max(1, standardColumns / 2); + horizontalStepVal = mBaseWidth / columnsNumVal; + horizontalGapVal = (int) (horizontalGap * widthScale * 2); } else { - mHorizontalGap = (int) (horizontalGap * widthScale); - mHorizontalStep = (int) ((key0.getWidth() + horizontalGap) * widthScale); - mColumnsNum = mBaseWidth / mHorizontalStep; + horizontalGapVal = (int) (horizontalGap * widthScale); + horizontalStepVal = (int) ((key0.getWidth() + horizontalGap) * widthScale); + columnsNumVal = mBaseWidth / horizontalStepVal; } - mVerticalStep = (int) ((key0.getHeight() + mVerticalGap) + int verticalStepVal = (int) ((key0.getHeight() + mVerticalGap) / Math.sqrt(Settings.getValues().mKeyboardHeightScale)); + if (Settings.getValues().mEmojiKeyFit) { + final float scale = Settings.getValues().mFontSizeMultiplierEmoji; + horizontalGapVal = (int) (horizontalGapVal * scale); + horizontalStepVal = (int) (horizontalStepVal * scale); + columnsNumVal = Math.max(1, mBaseWidth / horizontalStepVal); + verticalStepVal = (int) (verticalStepVal * scale); + } + mHorizontalGap = horizontalGapVal; + mHorizontalStep = horizontalStepVal; + mColumnsNum = columnsNumVal; + mVerticalStep = verticalStepVal; if (spacerWidth > 0) setSpacerColumns(spacerWidth); mMaxKeyCount = maxKeyCount; From f4dd229de74c41a861ae2965dafd046d335ca9f2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 13:05:20 +0000 Subject: [PATCH 2/5] Initial plan From 8fedae23eed43f502d8463839ff257487825584f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 13:35:26 +0000 Subject: [PATCH 3/5] merge: sync from LeanType upstream main v3.8.2 Agent-Logs-Url: https://github.com/AsafMah/LeanType/sessions/f9b14912-7ddd-4a0a-a66f-62ba37fed84a Co-authored-by: AsafMah <6424271+AsafMah@users.noreply.github.com> --- dev-log.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/dev-log.md b/dev-log.md index 6aa2c9238..ec827f247 100644 --- a/dev-log.md +++ b/dev-log.md @@ -653,3 +653,24 @@ The backspace fixes were ready in PR #8, and the user asked to merge them to `ma ### Open Questions / Next Steps - Push the updated shortcuts PR branch. + +--- + +## 2026-05-26 — Sync with upstream LeanType main + +### Context +The issue requested syncing from upstream LeanType (LeanBitLab/HeliboardL), not upstream HeliBoard. + +### Actions Taken +- Repointed `upstream` remote to `https://github.com/LeanBitLab/HeliboardL.git` and fetched `upstream/main`. +- Verified shared history and divergence between `origin/main` and `upstream/main`. +- Merged `upstream/main` into `copilot/sync-with-upstream`. +- Reviewed merged file changes (`DynamicGridKeyboard.java` and `.gitignore`). +- Attempted to run `./gradlew compileOfflineRunTestsKotlin --no-daemon` for validation. + +### Decisions Made +- Used a direct merge commit to preserve upstream LeanType history instead of cherry-picking. +- Kept upstream's emoji grid scaling update as-is because it merged cleanly and is isolated. + +### Open Questions / Next Steps +- Gradle validation is blocked in this environment because `dl.google.com` is unreachable during dependency resolution. From 7f1b2675e8e05502da8b64f91d1234e899025470 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 13:38:06 +0000 Subject: [PATCH 4/5] fix: guard emoji fit scaling step during upstream sync Agent-Logs-Url: https://github.com/AsafMah/LeanType/sessions/f9b14912-7ddd-4a0a-a66f-62ba37fed84a Co-authored-by: AsafMah <6424271+AsafMah@users.noreply.github.com> --- .../keyboard/keyboard/emoji/DynamicGridKeyboard.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java b/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java index 586ee470a..84d9393c5 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java +++ b/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java @@ -65,9 +65,9 @@ public DynamicGridKeyboard(final SharedPreferences prefs, final Keyboard templat final Key key1 = getTemplateKey(Constants.RECENTS_TEMPLATE_KEY_CODE_1); final int horizontalGap = Math.abs(key1.getX() - key0.getX()) - key0.getWidth(); final float widthScale = determineWidthScale(key0.getWidth() + horizontalGap); - int columnsNumVal; - int horizontalStepVal; - int horizontalGapVal; + int columnsNumVal = 1; + int horizontalStepVal = 1; + int horizontalGapVal = 0; if (categoryId == EmojiCategory.ID_EMOTICONS) { // Emoticons need more space, so we use approx half the columns final int standardColumns = mBaseWidth / (int) ((key0.getWidth() + horizontalGap) * widthScale); @@ -84,7 +84,7 @@ public DynamicGridKeyboard(final SharedPreferences prefs, final Keyboard templat if (Settings.getValues().mEmojiKeyFit) { final float scale = Settings.getValues().mFontSizeMultiplierEmoji; horizontalGapVal = (int) (horizontalGapVal * scale); - horizontalStepVal = (int) (horizontalStepVal * scale); + horizontalStepVal = Math.max(1, (int) (horizontalStepVal * scale)); columnsNumVal = Math.max(1, mBaseWidth / horizontalStepVal); verticalStepVal = (int) (verticalStepVal * scale); } From 93e568a612f221c23d004736093e3f4e1a5b835f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 13:41:20 +0000 Subject: [PATCH 5/5] refactor: harden emoji grid step calculations from upstream sync Agent-Logs-Url: https://github.com/AsafMah/LeanType/sessions/f9b14912-7ddd-4a0a-a66f-62ba37fed84a Co-authored-by: AsafMah <6424271+AsafMah@users.noreply.github.com> --- .../keyboard/emoji/DynamicGridKeyboard.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java b/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java index 84d9393c5..36d2b4b67 100644 --- a/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java +++ b/app/src/main/java/helium314/keyboard/keyboard/emoji/DynamicGridKeyboard.java @@ -65,33 +65,33 @@ public DynamicGridKeyboard(final SharedPreferences prefs, final Keyboard templat final Key key1 = getTemplateKey(Constants.RECENTS_TEMPLATE_KEY_CODE_1); final int horizontalGap = Math.abs(key1.getX() - key0.getX()) - key0.getWidth(); final float widthScale = determineWidthScale(key0.getWidth() + horizontalGap); - int columnsNumVal = 1; - int horizontalStepVal = 1; - int horizontalGapVal = 0; + int columnsNumCalc = 1; + int horizontalStepCalc = 1; + int horizontalGapCalc = 0; if (categoryId == EmojiCategory.ID_EMOTICONS) { // Emoticons need more space, so we use approx half the columns final int standardColumns = mBaseWidth / (int) ((key0.getWidth() + horizontalGap) * widthScale); - columnsNumVal = Math.max(1, standardColumns / 2); - horizontalStepVal = mBaseWidth / columnsNumVal; - horizontalGapVal = (int) (horizontalGap * widthScale * 2); + columnsNumCalc = Math.max(1, standardColumns / 2); + horizontalStepCalc = Math.max(1, mBaseWidth / columnsNumCalc); + horizontalGapCalc = (int) (horizontalGap * widthScale * 2); } else { - horizontalGapVal = (int) (horizontalGap * widthScale); - horizontalStepVal = (int) ((key0.getWidth() + horizontalGap) * widthScale); - columnsNumVal = mBaseWidth / horizontalStepVal; + horizontalGapCalc = (int) (horizontalGap * widthScale); + horizontalStepCalc = Math.max(1, (int) ((key0.getWidth() + horizontalGap) * widthScale)); + columnsNumCalc = mBaseWidth / horizontalStepCalc; } - int verticalStepVal = (int) ((key0.getHeight() + mVerticalGap) + int verticalStepCalc = (int) ((key0.getHeight() + mVerticalGap) / Math.sqrt(Settings.getValues().mKeyboardHeightScale)); if (Settings.getValues().mEmojiKeyFit) { final float scale = Settings.getValues().mFontSizeMultiplierEmoji; - horizontalGapVal = (int) (horizontalGapVal * scale); - horizontalStepVal = Math.max(1, (int) (horizontalStepVal * scale)); - columnsNumVal = Math.max(1, mBaseWidth / horizontalStepVal); - verticalStepVal = (int) (verticalStepVal * scale); + horizontalGapCalc = (int) (horizontalGapCalc * scale); + horizontalStepCalc = Math.max(1, (int) (horizontalStepCalc * scale)); + columnsNumCalc = Math.max(1, mBaseWidth / horizontalStepCalc); + verticalStepCalc = (int) (verticalStepCalc * scale); } - mHorizontalGap = horizontalGapVal; - mHorizontalStep = horizontalStepVal; - mColumnsNum = columnsNumVal; - mVerticalStep = verticalStepVal; + mHorizontalGap = horizontalGapCalc; + mHorizontalStep = horizontalStepCalc; + mColumnsNum = columnsNumCalc; + mVerticalStep = verticalStepCalc; if (spacerWidth > 0) setSpacerColumns(spacerWidth); mMaxKeyCount = maxKeyCount;