Skip to content

Point the keyboard's hex colors at the shared Scribe colors - #803

Open
bhanu-dev82 wants to merge 15 commits into
scribe-org:mainfrom
bhanu-dev82:feat/783-keyboard-shared-colors
Open

bhanu-dev82 wants to merge 15 commits into
scribe-org:mainfrom
bhanu-dev82:feat/783-keyboard-shared-colors

Conversation

@bhanu-dev82

@bhanu-dev82 bhanu-dev82 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Contributor checklist


Description

Hey 👋 This is the keyboard step of #475. The keyboard now reads the shared scribe_* colors instead of hex literals. Where a hex already matched a shared color, nothing looks different 🙂 Following @andrewtavis's answers on this PR, there are also a few small intentional visual changes, listed below.

  • Conjugation sub-labels use scribe_caption (#E558564B light, #CAC4D0 dark).
  • The invalid and already-plural command bar uses scribe_keyboard_background.
  • The keyboard follows Scribe's own dark mode setting, which can differ from the phone, so I added a small scribeColorInt(id, dark) helper. Colors.kt and the new scribeColorInt share the same night-mode override. Lookups are cached, so suggestions don't build a new context on every keystroke.
  • Removed GeneralKeyboardIME.DARK_THEME and LIGHT_THEME. They colored the command-bar separators, which are set to transparent right after, so nothing changes on screen.
  • The floating keyboard border has a name now, scribe_keyboard_border (same #40888888, a grey not used elsewhere on the keyboard). I didn't use scribe_outline, as that's the orange button outline.

Intentional visual changes (old → new)

What Light Dark
Invalid / already-plural bar (scribe_keyboard_background) #D2D4DA → #D3D6DD unchanged #1E1E1E
Letter keys and key preview (scribe_key) unchanged #FFFFFF #444444 → #434343
Suggestion and autocomplete text, same as the key labels (scribe_text) #1E1E1E → #000000 unchanged #FFFFFF
Enter key (scribe_key_special, Figma values) unchanged #ADB3BD unchanged #2D2D2D
Delete, shift and mode keys (scribe_key_special) #AEB3BE → #ADB3BD #202020 → #2D2D2D
Clipboard clear-all icon (new scribe_delete, the delete red from #772) #E53935 → #E4572E #E53935 → #D11149
Wikidata info-panel page dots (active = scribe_text, inactive = scribe_caption) active unchanged #000000; inactive #CCCCCC → #E558564B active unchanged #FFFFFF; inactive #66FFFFFF → #CAC4D0

scribe_key_special already existed, so I updated it to the Figma values rather than adding a second special-key name. The Enter key used to work these out from fractions in KeyboardView; that calculation is gone.

Still kept as they are: the floating drag-handle pill, and the clipboard caption greys and card border.

ScribeColorResolverTest checks that the lookups give the expected values when the phone is in day mode and in night mode, for every scribe_* color.

KeyboardSharedColorsTest checks the command bars, conjugation labels and separators against the old values when the Scribe setting and the phone's mode disagree, plus the new letter key, special key, suggestion, clear-all and page-dot colors. The label color is now worked out once per grid instead of once per button 🚀

Related issue

@bhanu-dev82
bhanu-dev82 requested review from Roniscend and ashb155 and removed request for Roniscend November 26, 2026 06:49
@bhanu-dev82

Copy link
Copy Markdown
Collaborator Author

A few colors in the keyboard don't exactly match any shared color, so I kept them as they are for now. Wanted to check with you on each before changing anything 🙂

1. Light invalid / already-plural bar

  • Now: #D2D4DA
  • Normal toolbar and keyboard background: #D3D6DD
  • This looks like a mistake, and the difference is barely visible. Should I switch it to scribe_keyboard_background?

2. Dark letter keys

  • Now: Color.DKGRAY (#444444)
  • Shared scribe_key: #434343 (used by the conjugate grid)
  • A one-shade difference. Should the keys use scribe_key?

3. Light suggestion text

  • Now: #1E1E1E (dark mode uses white)
  • There's no shared color for this. Should I add scribe_suggestion_text (light #1E1E1E, dark #FFFFFF) so it has a name?

4. Enter key

  • Now: #2D2D2D dark / #ADB3BD light, worked out from fractions in KeyboardView
  • Delete and shift use #202020 / #AEB3BE
  • Funny enough, Enter is the one that matches Figma's special-key colors. Should we discuss this in Decide app colors vs Figma where they differ #787 rather than here?

5. Smaller one-off colors

  • Page dots: #66FFFFFF, #CCCCCC
  • Floating keyboard: border #40888888, drag handle #4DFFFFFF / #40000000
  • Clipboard: clear-all red #E53935, captions #999999, card border #20000000
  • These only show up in one place each. I'd leave them as they are unless you'd like named colors for them too.

Happy to add whichever you pick to this PR, or do them in a follow-up so this one stays a no-visual-change PR. Whatever's easier to review!

@andrewtavis

Copy link
Copy Markdown
Member

Thanks so much for this, @bhanu-dev82! Responses to your questions:

  1. Yes, let's do scribe_keyboard_background
  2. Yes, let's do scribe_key
  3. Autosuggestions can be the same as the characters that are on the keys, in my opinion, but what do you think?
  4. Let's make a scribe_special_key if there isn't one already and use the values in Figma
  5. Points on these:
    • What are page dots? Is this for unordered lists? In this case they should be the same as the text color, but let us know :)
    • Floating keyboard border can maybe be scribe_outline or some grey that's not used on the keyboard
    • Clipboard clear all should be the same color of red that we're using for the delete in add delete data option #772, and we can name this scribe_delete

Thanks so much for this, @bhanu-dev82!

@andrewtavis
andrewtavis self-requested a review November 26, 2026 07:10
@bhanu-dev82

Copy link
Copy Markdown
Collaborator Author

Thanks so much for the quick answers, @andrewtavis! All done in this PR now 🙂

  1. The light invalid / already-plural bar uses scribe_keyboard_background, so #D2D4DA → #D3D6DD.
  2. Letter keys (and the key preview) use scribe_key, so dark goes #444444 → #434343. Light was already #FFFFFF.
  3. Agreed, suggestions matching the key characters feels right! Autosuggestions and autocomplete now use the same color as the key labels (scribe_text), so light goes #1E1E1E → black. Dark stays white.
  4. We already had scribe_key_special from Add named Scribe colors without changing how the app looks #788, but nothing used it yet, so I gave it the Figma values (#ADB3BD light, #2D2D2D dark) instead of adding a second name. Enter, delete, shift and the mode key all use it now, and the fraction calculation in KeyboardView is gone. Enter looks the same as before, and delete/shift move one shade to match it. Happy to split it into a separate scribe_special_key if you'd prefer!
  5. On the smaller ones:
    • The page dots aren't list bullets. They're the page indicators in the little info panel you get from the ⓘ on an invalid command, the one where you flip through the Wikidata explanations with the arrows. I've left them as they are for now. Maybe the active dot could be the key text color and the inactive one scribe_caption? Happy to do that if it sounds good.
    • scribe_outline turned out to be our orange button outline, so I went with your grey idea: a new scribe_keyboard_border that keeps today's #40888888, which isn't used anywhere else on the keyboard.
    • Clipboard clear-all now uses a new scribe_delete with the reds from add delete data option #772: #E4572E light and #D11149 dark. Since add delete data option #772 isn't merged yet, I took the values from its diff. It could switch to scribe_delete once this is in.

I also added a small cache for the color lookups so suggestions don't rebuild them on every keystroke.

The PR description lists every old → new value. I don't have before/after screenshots yet, but tests check all of these against both the Scribe setting and the phone's mode. Thanks again! 🚀

@Roniscend
Roniscend self-requested a review November 26, 2026 11:23
dark: Boolean,
): Int {
val key = (id.toLong() shl 1) or (if (dark) 1L else 0L)
return scribeColorCache.getOrPut(key) { ContextCompat.getColor(scribeNightContext(dark), id) }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The Long key and Int value get boxed on every lookup, so this still allocates per keystroke. Would a SparseIntArray per mode work here?

android:padding="@dimen/small_margin"
android:src="@drawable/ic_delete_vector"
android:tint="#E53935" />
android:tint="@color/scribe_delete" />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since KeyboardUIManager already sets this tint in code, could we drop the XML android:tint? It follows the device night mode rather than Scribe's setting, so its a bit misleading

@bhanu-dev82

Copy link
Copy Markdown
Collaborator Author

Thanks for the review, @Roniscend! Both fixed 🙂 The color cache now uses a SparseIntArray per mode, so nothing gets boxed, and I dropped the XML tint since the code already sets it from Scribe's setting. I also went through the rest of the PR and added tests for the color paths that weren't covered yet. The one red check was a Maven Central rate limit (429), so I pushed an empty commit to re-run CI.

@andrewtavis

Copy link
Copy Markdown
Member

Maybe the active dot could be the key text color and the inactive one scribe_caption? Happy to do that if it sounds good.

This sounds right to me, @bhanu-dev82! Sounds like we can make this small change and then merge :) We can then do a color update in the delete PR!

@andrewtavis andrewtavis added the -priority- High priority label Nov 28, 2026
@bhanu-dev82

Copy link
Copy Markdown
Collaborator Author

Thanks @andrewtavis! I've made that small change 🙂 The active Wikidata info-panel dot now uses the key text color (scribe_text), and the inactive ones use scribe_caption. Both follow Scribe's own dark mode setting, not the phone's. Tests cover light and dark, and they also check that the active color moves when you go to the next page. CI is all green, so this should be ready to merge.

Sounds good to me that the delete color can be updated in #772!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

-priority- High priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove one-off hex colors from the keyboard

3 participants