Skip to content

Conversation

@SYM01
Copy link
Collaborator

@SYM01 SYM01 commented Mar 16, 2025

This pull request includes several updates to improve the build process, enhance error messaging, and introduce new features for browser compatibility and profile management.

Build Process Improvements:

  • Added SENTRY_AUTH_TOKEN to the environment variables in .github/workflows/build.yml.
  • Introduced SENTRY_RELEASE environment variable for Chrome and Firefox build jobs.
  • Added a new job to publish the extension on the Chrome Web Store.

Dependency Updates:

  • Updated various dependencies in package.json, including @vitest/coverage-v8, vite, and vue-tsc.

Error Messaging Enhancements:

  • Added new error messages for malformed URLs and CIDR in public/_locales/en/messages.json. [1] [2]

Browser Compatibility:

  • Introduced a BrowserFlavor enum and updated BaseAdapter, Chrome, and WebBrowser classes to include the flavor property. [1] [2] [3] [4] [5]

Profile Management:

  • Replaced saveProfile with saveManyProfiles in PreferencePage.vue to handle multiple profiles more efficiently. [1] [2]
  • Added saveManyProfiles function to profile.ts for saving multiple profiles at once.

These changes collectively improve the build automation, enhance user feedback with better error messages, and add support for different browser flavors, while also optimizing profile management.

SYM01 and others added 19 commits October 21, 2024 01:47
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.7 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](ai/nanoid@3.3.7...3.3.8)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix 401 issue (#22)

* enablle github action on develop branch
* Adapt firefox
* support firefore auto publish
* support firefox, and optimized UX
* [i18n] Translate messages.json in pt_BR

100% reviewed source file: 'messages.json'
on 'pt_BR'.

* [i18n] Translate messages.json in zh_CN

100% reviewed source file: 'messages.json'
on 'zh_CN'.

* [i18n] Translate messages.json in zh_TW

100% reviewed source file: 'messages.json'
on 'zh_TW'.

* [i18n] Translate messages.json in pt_BR

100% reviewed source file: 'messages.json'
on 'pt_BR'.

* update English i18n msg

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: SYM01 <[email protected]>
* implemented an utility to export/import settings
* [i18n] Translate messages.json in pt_BR

100% reviewed source file: 'messages.json'
on 'pt_BR'.

* [i18n] Translate messages.json in zh_TW

100% reviewed source file: 'messages.json'
on 'zh_TW'.

* [i18n] Translate messages.json in zh_CN

100% reviewed source file: 'messages.json'
on 'zh_CN'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
* [WIP] support chrome auto deploy

* finalize Chrome auto deploy

* npm audit fix

* npm audit fix
* minor bug fixed

* improve UX and close #28

* use the same CIDR validator as PAC script
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.

Hello @SYM01, 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!

Summary of Changes

This pull request focuses on enhancing the user experience and improving error reporting within the application. It includes build process improvements, dependency updates, error messaging enhancements, browser compatibility adjustments, and profile management optimizations. The changes span across workflow configurations, package dependencies, locale messages, adapter classes, and Vue components.

Highlights

  • Build Process: The build process is improved by adding SENTRY_AUTH_TOKEN and SENTRY_RELEASE environment variables to the build workflow, and introducing a new job to publish the extension on the Chrome Web Store.
  • Dependency Updates: Several dependencies in package.json have been updated, including @vitest/coverage-v8, vite, and vue-tsc, ensuring the project uses the latest versions of these tools.
  • Error Messaging: New error messages have been added for malformed URLs and CIDR notations in public/_locales/en/messages.json, providing users with more informative feedback.
  • Browser Compatibility: A BrowserFlavor enum is introduced, and BaseAdapter, Chrome, and WebBrowser classes are updated to include a flavor property, enhancing browser compatibility.
  • Profile Management: The saveProfile function in PreferencePage.vue is replaced with saveManyProfiles to handle multiple profiles more efficiently, and a corresponding saveManyProfiles function is added to profile.ts.

Changelog

Click here to see the changelog
  • .github/workflows/build.yml
    • Added SENTRY_AUTH_TOKEN to environment variables.
    • Introduced SENTRY_RELEASE environment variable for Chrome and Firefox build jobs.
    • Added a new job to publish the extension on the Chrome Web Store.
  • package-lock.json
    • Updated @vitest/coverage-v8 from 2.1.8 to 3.0.6.
    • Updated vite from 6.0.7 to 6.1.0.
    • Updated vue-tsc from 2.2.0 to 2.2.2.
    • Updated various esbuild dependencies from 0.24.2 to 0.25.0
    • Updated various vitest dependencies from 2.1.8 to 3.0.6
  • package.json
    • Updated @vitest/coverage-v8 from 2.1.8 to 3.0.6.
    • Updated vite from 6.0.7 to 6.1.0.
    • Updated vue-tsc from 2.2.0 to 2.2.2.
  • public/_locales/en/messages.json
    • Added new error messages for malformed URLs (config_section_auto_switch_type_url_malformed and config_section_auto_switch_type_url_malformed_chrome).
    • Added new error message for invalid CIDR format (config_section_auto_switch_type_cidr_malformed).
  • src/adapters/base.ts
    • Introduced BrowserFlavor enum with Unknown, Web, and Chrome values.
    • Added flavor property to the BaseAdapter class.
  • src/adapters/chrome.ts
    • Set the flavor property to BrowserFlavor.Chrome.
  • src/adapters/web.ts
    • Set the flavor property to BrowserFlavor.Web.
  • src/components/PreferencePage.vue
    • Replaced saveProfile with saveManyProfiles to handle multiple profiles efficiently.
  • src/components/configs/AutoSwitchInput.vue
    • Added form validation rules for URL and CIDR inputs.
    • Added getConditionInputRule function to return the correct validation rule based on the type of input.
    • Added form layout to the component.
  • src/components/configs/ProfileSelector.vue
    • Made the profileID a required property.
    • Disabled the System Profile if it is the current profile.
  • src/components/configs/ProxyServerInput.vue
    • Added type assertion to proxyType v-model.
  • src/services/profile.ts
    • Added saveManyProfiles function to save multiple profiles at once.
    • Added documentation to saveProfile to indicate it is not promise-safe and to use saveManyProfiles instead.
  • vite.config.ts
    • Added sentry release injection.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.


In realms of code, where proxies roam,
Profiles switch, finding their home.
From Chrome's domain to web's embrace,
Compatibility sets the pace.
Errors whisper, messages clear,
Enhancing trust, dispelling fear.

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

The pull request introduces several improvements, including build process enhancements, dependency updates, error messaging, browser compatibility, and profile management. The changes are well-structured and address the described issues. However, there are a few areas that could be improved to enhance security and maintainability.

Summary of Findings

  • Potential vulnerability: Hardcoded extension ID: The Chrome Web Store extension ID is hardcoded in .github/workflows/build.yml. While this might be acceptable for a private extension, it's generally better to use environment variables or configuration files to manage such sensitive information, especially if the workflow is ever made public or if you plan to manage multiple environments.
  • Missing input validation in AutoSwitchInput.vue: The getConditionInputRule function in AutoSwitchInput.vue lacks input validation for the 'domain' type. While the 'url' and 'cidr' types have validation, the 'domain' type does not, which could lead to unexpected behavior or security vulnerabilities if the input is not properly sanitized.

Merge Readiness

The pull request is almost ready for merging. However, the hardcoded extension ID in the workflow file and the missing input validation for the 'domain' type in AutoSwitchInput.vue should be addressed before merging. I am unable to approve this pull request, and recommend that these issues be addressed before merging. Users should have others review and approve this code before merging.

* [i18n] Translate messages.json in pt_BR

100% reviewed source file: 'messages.json'
on 'pt_BR'.

* [i18n] Translate messages.json in zh_TW

100% reviewed source file: 'messages.json'
on 'zh_TW'.

* [i18n] Translate messages.json in zh_CN

100% reviewed source file: 'messages.json'
on 'zh_CN'.

---------

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
@SYM01 SYM01 merged commit 82ea90e into main Mar 16, 2025
6 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.

2 participants