Skip to content

Update sub-menu settings options to include their current value (#751) - #756

Merged
andrewtavis merged 2 commits into
scribe-org:mainfrom
prince-0408:feature/submenu-current-values-751
Nov 7, 2026
Merged

andrewtavis merged 2 commits into
scribe-org:mainfrom
prince-0408:feature/submenu-current-values-751

Conversation

@prince-0408

Copy link
Copy Markdown
Collaborator

Contributor checklist


Description

This PR updates the keyboard settings sub-menu options in LanguageSettingsScreen to display their current values next to the navigation chevron, aligning the UI with Figma designs.

Summary of Changes:

  1. ScribeItem.kt & ClickableItemComp.kt:

    • Added an optional val value: String? = null parameter to ScribeItem.ClickableItem.
    • Updated ClickableItemComp to render value in MaterialTheme.colorScheme.onSurfaceVariant (style typography.bodyMedium) positioned directly before the right navigation chevron icon.
    • Forwarded item.value through ItemsCardContainer.
  2. ScribeLanguage.kt & PreferencesHelper.kt:

    • Added defaultLayout property to ScribeLanguage representing each language's default layout ("QWERTY", "AZERTY", "QWERTZ", "ЙЦУКЕН").
    • Added PreferencesHelper.getDefaultKeyboardLayout(context, language) and PreferencesHelper.setDefaultKeyboardLayout(context, language, layout) using language-specific preference keys with fallback to ScribeLanguage.defaultLayout.
  3. LanguageSettingsScreen.kt:

    • Introduced state for translationSourceLanguage, defaultLayout, and defaultCurrencySymbol.
    • Added a DisposableEffect with LifecycleEventObserver listening to Lifecycle.Event.ON_RESUME so displayed values update immediately when returning from sub-screens.
    • Populated value on "Select language", "Default keyboard", and "Default currency symbol" menu items.
  4. Tests & Documentation:

    • Added ScribeLanguageTest verifying default layout resolution across all languages.
    • Added PreferencesHelperTest case verifying language-specific preference keys.
    • Added UI test displaysClickableItemWithValue in ScribeItemListTest.
    • Updated CHANGELOG.md under ### 🎨 Design.

UI Preview

Keyboard sub-menu settings options displaying current values

Related issue

@ashb155

ashb155 commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

i guess few of the tests are failing, could you have a look @prince-0408

@andrewtavis andrewtavis 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.

praise: All of this is looking great, @prince-0408! Thanks for the quick work here!

@andrewtavis
andrewtavis merged commit 3109f94 into scribe-org:main Nov 7, 2026
7 checks passed

@ashb155 ashb155 left a comment •

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.

LGTM as well @prince-0408 ! Thanks for all the work here!

@andrewtavis andrewtavis mentioned this pull request Nov 8, 2026
2 tasks done
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.

Update all sub-menu settings options to include their current value

3 participants