Skip to content

Comments

Add object names for all keys#44

Merged
AndreaRicchi merged 3 commits intoamarula:mainfrom
frogarian:feature/object-names
Feb 19, 2026
Merged

Add object names for all keys#44
AndreaRicchi merged 3 commits intoamarula:mainfrom
frogarian:feature/object-names

Conversation

@frogarian
Copy link
Contributor

  • added object names to all keys to necessary for automated UI tests
  • disable dummy key only used as placeholder

@gemini-code-assist
Copy link

Summary of Changes

Hello @frogarian, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the testability of the keyboard application by systematically assigning unique identifiers to all interactive key elements. This change facilitates the development and maintenance of automated UI tests, ensuring the application's stability and functionality. Additionally, it refines the behavior of non-interactive layout elements by explicitly disabling them.

Highlights

  • Automated UI Testing Support: Introduced objectName properties to all key components across various keyboard layouts, enabling better identification and interaction for automated UI tests.
  • Dummy Key Management: Disabled invisible placeholder keys in several layouts by setting enabled: false and assigning an empty objectName, preventing unintended interactions.
  • Centralized Object Name Generation: Implemented a dynamic objectName generation logic within the base Key.qml component, ensuring consistent naming conventions for keys.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/qml/BackspaceKey.qml
    • Added objectName property to the Backspace key.
  • src/qml/CsLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/CySrBsLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/DeLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/ElLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/EnLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/EnterKey.qml
    • Added objectName property to the Enter key.
  • src/qml/EsLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/FrLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/HideKey.qml
    • Added objectName property to the Hide key.
  • src/qml/ItLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/Key.qml
    • Implemented dynamic objectName generation based on inputPanelRef and key text.
    • Removed extraneous closing brace.
  • src/qml/LanguageKey.qml
    • Added objectName property to the Language key.
  • src/qml/LtSrHrBsLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/NlLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/PtLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/QwertyLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/RuLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/ShiftKey.qml
    • Added objectName property to the Shift key.
  • src/qml/SpaceKey.qml
    • Added objectName property to the Space key.
  • src/qml/SvLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
  • src/qml/SymbolKey.qml
    • Added objectName property to the Symbol key.
  • src/qml/SymbolLayout.qml
    • Added objectName and enabled: false to invisible dummy keys.
    • Added inputPanelRef property to various function keys (page navigation, Symbol, Hide).
  • src/qml/UkLayout.qml
    • Added objectName and enabled: false to the invisible dummy key.
    • Assigned objectName to left and right Shift keys.
    • Added inputPanelRef property to Symbol, Language, and Hide keys.
Activity
  • The author, frogarian, initiated this pull request with the stated goal of adding object names to all keys, which is necessary for automated UI tests.
  • The author also noted the disabling of dummy keys that were previously used as placeholders.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds objectName properties to various keyboard components to facilitate UI testing, which is a valuable addition. The changes are mostly correct and follow a consistent pattern. However, I've found a significant issue regarding the usage of ShiftKey components in layout files. They are missing the inputPanelRef property, which makes them fragile and inconsistent with other keys. I've left a comment with a suggestion to fix this. I also found a minor opportunity for code simplification in Key.qml. Please review my comments.

src/qml/Key.qml Outdated
Comment on lines 9 to 15
objectName: {
var prefix = inputPanelRef.objectName + "Key_"
if (btnDisplayedText) {
return prefix + btnDisplayedText
}
return prefix + btnText
}

Choose a reason for hiding this comment

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

medium

This logic for determining the objectName can be expressed more concisely using a single line with a ternary operator.

    objectName: inputPanelRef.objectName + "Key_" + (btnDisplayedText ? btnDisplayedText : btnText)

Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This logic for determining the objectName can be expressed more concisely using a single line with a ternary operator.

    objectName: inputPanelRef.objectName + "Key_" + (btnDisplayedText ? btnDisplayedText : btnText)

@frogarian, I would apply this suggestion for better code quality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AndreaRicchi good point, before my logic was a little more involved which would have caused multiple ternary, but for this version I agree - Fixed it

@AndreaRicchi
Copy link
Contributor

Hi @frogarian, thanks for your contribution.

Can you rewrite the commit messages to be capitalised in the subject and, more importantly, to describe the what and why in the commit body to better understand the needs for these changes?

Most layouts use a dummy placeholder key for better alignment.
Since this in not an actual key it should be disabled to not have a
clickable space which looks like background.
Improves consistency and enables using its object name as prefix for
each keys object name
@frogarian frogarian force-pushed the feature/object-names branch from 828d450 to 5c56588 Compare February 18, 2026 14:44
@frogarian
Copy link
Contributor Author

frogarian commented Feb 18, 2026

Hi @frogarian, thanks for your contribution.

Can you rewrite the commit messages to be capitalised in the subject and, more importantly, to describe the what and why in the commit body to better understand the needs for these changes?

@AndreaRicchi Sure, no problem. Updated my commit messages and added a bit of context.

It is necessary for automated UI tests to have a unique object name for
every qml element you want to access.
@frogarian frogarian force-pushed the feature/object-names branch from 5c56588 to 05075ff Compare February 19, 2026 09:01
Copy link
Contributor

@EddyTheCo EddyTheCo left a comment

Choose a reason for hiding this comment

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

It seems this PR gives a unique value to the objectName property of each key on the keyboard.
It seems the latter is done because UI testing wants to be performed on screens where the keyboard is used.

An issue describing the why of this PR and how this object name will be used for UI testing would be nice.
I find the changes implemented correctly, but I wonder if assigning a unique value for all the keys is required, maybe setting the same objectName for all the keys, iterate over all the objects, and then querying the btnText property will be enough.
The way is done give you more granularity, but it could be difficult to maintain in the future.

Copy link
Contributor

@AndreaRicchi AndreaRicchi left a comment

Choose a reason for hiding this comment

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

LGTM

@AndreaRicchi AndreaRicchi merged commit f7b302d into amarula:main Feb 19, 2026
2 checks passed
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