UX improvement: surface user file issues - #742
Conversation
Summary of ChangesHello @lukhnos, 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 improves the user experience by introducing robust mechanisms for detecting and reporting issues within user-defined phrase files. It provides immediate feedback through temporary notifications and offers a dedicated menu option to inspect a comprehensive list of problems, thereby empowering users to maintain accurate and functional custom dictionaries with greater ease. Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a great user experience improvement by surfacing issues found in user-provided phrase files. A notification is shown, and a new menu item allows users to inspect the details. The implementation spans both Swift and Objective-C++ and is generally well-executed. My review includes a few suggestions to enhance code clarity, maintainability, and robustness. These include using modern Swift syntax for string construction, improving variable naming for better readability, using a more direct API for path manipulation in Objective-C++, and ensuring that non-issues are not erroneously reported to the user.
5e030c2 to
5500a55
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR improves UX by surfacing user file parsing issues to the user. When user phrase files contain errors (missing columns, NULL characters), the input method now shows a 5-second notification and adds a menu item that allows users to inspect the issues by writing them to a temporary file and opening it.
- Added
collectUserFileIssues()bridge method in KeyHandler to translate C++ UserFileIssue objects to localized NSString messages - Added static property to track latest issues and prevent duplicate notifications
- Implemented
showUserFileIssues()to write issue report to temporary file and open it - Added menu item (with alert emoji) that appears only when issues exist
- Added localized strings in English, Traditional Chinese, and Base localizations
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/KeyHandler.h | Declares new collectUserFileIssues method to retrieve user file parsing issues |
| Source/KeyHandler.mm | Implements issue collection, translating C++ UserFileIssue structs to localized NSString messages |
| Source/InputMethodController.swift | Adds static property for tracking issues, menu item with emoji, notification logic, and file writing/opening functionality |
| Source/Base.lproj/Localizable.strings | Adds base localized strings for file types, issue descriptions, and UI text (including emoji) |
| Source/en.lproj/Localizable.strings | Adds English localized strings for file types, issue descriptions, and UI text (including emoji) |
| Source/zh-Hant.lproj/Localizable.strings | Adds Traditional Chinese localized strings for file types, issue descriptions, and UI text (including emoji) |
5500a55 to
7e24da6
Compare
A long-staying (5 seconds) notification is shown upon any user file issues. A menu item is added to allow the user to inspect those issues.
A long-staying (5 seconds) notification is shown upon any user file issues found when
activateServeris called or when the user reloads the files manually from the menu.A menu item is added to allow the user to inspect those issues—when there are such issues. I tried to set an SF Symbol to the
NSMenuItembut it doesn't work, and so the alert emoji is used in the menu (it is not supposed to be shown often, and so I'm fine with making this glaring).