Skip to content

Conversation

@Chapoly1305
Copy link
Contributor

This pull request introduces a new user preference to hide unconfigured translation services from the service selection dropdown menu in the item pane. It adds the necessary UI elements, localization strings, default preference value, and logic to filter out services that require configuration but have not been set up by the user.

Preference UI and Localization:

  • Added a new checkbox (hideUnconfiguredServices) to the preferences UI (preferences.xhtml) allowing users to enable or disable hiding of unconfigured services.
  • Added corresponding localization strings for the new preference in English, Italian, and Chinese localization files. [1] [2] [3]

Preference Logic and Behavior:

  • Introduced a new default preference value hideUnconfiguredServices (default: false) in prefs.js.
  • Implemented the _filterUnconfiguredServices method in panel.ts to hide menu items for services that require configuration but are not set up, based on the new preference. The method checks for required secrets and validates them if necessary.
  • Ensured the filter is applied when rendering the panel and hooked up the preference UI to refresh the relevant panel when toggled. [1] [2]

@Chapoly1305
Copy link
Contributor Author

- Add getUnconfiguredServiceIds() to TranslationServices class
- Simplify _filterUnconfiguredServices() in panel.ts to use new method
- Parse secrets JSON once instead of per-service for better performance
- Remove unused getPrefJSON import
@windingwind windingwind merged commit cb87afd into windingwind:main Dec 6, 2025
1 check passed
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

🚀 This ticket has been resolved in v2.4.0-beta.4. See Release v2.4.0-beta.4 for release notes.

windingwind pushed a commit that referenced this pull request Dec 6, 2025
* feat: add preference to hide unconfigured services from the menu

* feat: update pannel without Zotero restart

* refactor: move service configuration check logic to services module

- Add getUnconfiguredServiceIds() to TranslationServices class
- Simplify _filterUnconfiguredServices() in panel.ts to use new method
- Parse secrets JSON once instead of per-service for better performance
- Remove unused getPrefJSON import
@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

🚀 This ticket has been resolved in v2.4.0-beta.4. See Release v2.4.0-beta.4 for release notes.

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