selenium-ide
selenium-ide copied to clipboard
moving intl deeper into the toolkit
User description
@fernandozw - I am reworking the i18n stuff a bit for the following tweaks:
-
I am moving some of the command map translations into side-model. I want that stuff really low down so we can reuse your translations cleanly in both the IDE and the side runner. I am assuming if you're enjoying the IDE, you'll probably want correctly translated strings for your CI too.
-
I am moving the app translation hooks to just use react-intl and a single typed master translation document. This way we get a few more errors about missing translations, and whenever I add a new english string, the compiler will kick my ass until I add a chinese equivalent. It will help me keep language support going forward. Also, react-intl has good support for template strings and variable injection w/r/t localization and doing numbers and dates and all that stuff too.
-
Rather than manually specifying language and storing that in the electron-store, I'm just going to use the system locale data so the app starts in the users language of choice.
-
I am looking at combining metadata from custom commands into the language map in the browser at runtime. Right now, custom commands (provided via plugin) crash the app UX.
Type
enhancement
Description
- Refactored various components to use dynamic command maps and localized language maps from
@seleniumhq/side-model. - Enhanced internationalization support across the application by integrating
IntlProviderand updating components to useFormattedMessage. - Added comprehensive language support files for English and Chinese, including UI labels and command descriptions.
- Improved code quality and maintainability by updating components to use modern React hooks and patterns.
Changes walkthrough
| Relevant files | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Enhancement | 11 files
|
✨ PR-Agent usage: Comment
/helpon the PR to get a list of all available PR-Agent tools and their descriptions
CI Failure Feedback
|
Action: test |
|
Failed stage: Build side-runner and selenium-ide [❌] |
|
Failure summary: The action failed due to multiple TypeScript compilation errors across various packages. Key issues packages/side-runtime/src/plugins.ts and packages/side-migrate/src/migrations/implicit-locators.ts.errors in paths like /home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-commons/node_modules/.bin/side-code-export.packages/side-code-export could not be built due to errors in its dependency packages/side-runtime, which cascaded and affected other dependent projects. |
Relevant error logs:
|
✨ CI feedback usage guide:
The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
The tool analyzes the failed checks and provides several feedbacks:
- Failed stage
- Failed test name
- Failure summary
- Relevant error logs
In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:
/checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.
Configuration options
enable_auto_checks_feedback- if set to true, the tool will automatically provide feedback when a check is failed. Default is true.excluded_checks_list- a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.enable_help_text- if set to true, the tool will provide a help message with the feedback. Default is true.persistent_comment- if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.final_update_message- ifpersistent_commentis true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.
See more information about the checks tool in the docs.
PR Description updated to latest commit (https://github.com/SeleniumHQ/selenium-ide/commit/f825e0b484c82f82f9c064232583fff6a379fd28)
- [ ] Copy walkthrough table to "Files Changed" Tab
PR Review
| ⏱️ Estimated effort to review [1-5] |
4, because the PR involves significant changes across multiple files, including refactoring and internationalization efforts. The changes affect core functionalities such as command handling and UI text rendering, which require careful review to ensure functionality and consistency across different languages. |
| 🧪 Relevant tests |
No |
| 🔍 Possible issues |
Possible Bug: The refactoring introduces changes to how commands and language maps are handled. If not properly tested, this could lead to runtime errors or incorrect command executions. |
|
Localization Issues: The introduction of new language support (Chinese) needs to be thoroughly tested to ensure all text is displayed correctly and that there are no missing translations. | |
| 🔒 Security concerns |
No |
✨ Review tool usage guide:
Overview:
The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.
The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
- When commenting, to edit configurations related to the review tool (
pr_reviewersection), use the following template:
/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
- With a configuration file, use the following template:
[pr_reviewer]
some_config1=...
some_config2=...
See the review usage page for a comprehensive guide on using this tool.
PR Code Suggestions
| Category | Suggestions | |||||||||||||||||||
| Best practice |
Convert the import of
| |||||||||||||||||||
Use template literals for multi-line strings to enhance readability.Use template literals for multi-line strings to improve readability and maintainability of packages/selenium-ide/src/browser/I18N/zh/index.ts [65-69]
| Specify a more precise version range for the
| |||||||||||||||||||
| Maintainability |
Correct a typo in the variable name for better consistency and readability.Ensure consistency in object property naming by changing packages/selenium-ide/src/browser/I18N/zh/index.ts [52]
| Use enums for repeated string values to centralize control and ease modifications.Introduce enums for repeated string values such as menu names and error messages to packages/selenium-ide/src/browser/I18N/zh/index.ts [6-11]
| Remove duplicate imports to clean up the code.Remove the duplicate import statements for packages/selenium-ide/src/browser/components/AppBar/AppBarTabs.tsx [4-5]
| Align the
| ||||||||||||||||
| Enhancement |
Refactor menu configurations into a single nested object for improved manageability.Refactor the individual menu configuration objects into a single object with nested packages/selenium-ide/src/browser/I18N/zh/index.ts [6-21]
| Improve type safety and IntelliSense by defining a specific interface for
| ||||||||||||||||||
Pass a dynamic locale to
| ||||||||||||||||||||
Update
| ||||||||||||||||||||
| Possible issue |
Add conditional rendering to handle potential null or undefined
| |||||||||||||||||||
| Performance |
Move the loading URL check to the top of the component to improve performance and readability.Move the conditional rendering check for packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Project/ProjectSettings.tsx [25]
| Remove redundant
| ||||||||||||||||||
| Security |
Ensure the integrity hashes for new packages are correct to enhance security.Verify and ensure that the integrity hashes for all newly added packages are correct to
|
✨ Improve tool usage guide:
Overview:
The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.
- When commenting, to edit configurations related to the improve tool (
pr_code_suggestionssection), use the following template:
/improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
- With a configuration file, use the following template:
[pr_code_suggestions]
some_config1=...
some_config2=...
See the improve usage page for a comprehensive guide on using this tool.
@toddtarsi Your idea is right, using react-intl for translation eliminates the need for developers to maintain it themselves, which is great!
@fernandozw - I think it's good here, and I'm going to merge to the latest on trunk. What I'd really appreciate from your side is to test the latest on trunk in the next few days, and if it looks good as a release candidate, we'll send it out! I figure by merging it to trunk, even if it's 90% right and 10% wrong, it will be an easier workflow for you to do fixes there before we increment and truly release, even if the latest tag is updated.