Skip to content

fix(admin): improve provider management UX - #446

Merged
ding113 merged 3 commits into
ding113:devfrom
miraserver:fix/admin-ux
Dec 26, 2025
Merged

fix(admin): improve provider management UX#446
ding113 merged 3 commits into
ding113:devfrom
miraserver:fix/admin-ux

Conversation

@miraserver

@miraserver miraserver commented Dec 24, 2025

Copy link
Copy Markdown
Contributor

Summary

Improves the admin provider management UX by adding status and group filters, applying colored badges to provider groups, and making translations more compact in Russian.

Problem

When managing providers in the admin settings page, administrators lacked the ability to filter providers by status (active/inactive) or by group, making it difficult to manage large numbers of providers. Additionally, the Russian translations used overly long labels that cluttered the UI.

Solution

1. Status Filter

Added a dropdown filter to show providers by status:

  • "Any status" (all providers)
  • "Active" (enabled only)
  • "Inactive" (disabled only)

2. Group Filter with Multi-Select

Added a group filter with badge-style buttons:

  • "All" button to show all providers
  • Dynamically generated buttons for each unique group
  • Multi-select support (can filter by multiple groups)
  • "default" group created for providers without explicit group assignment
  • Groups sorted: "default" first, then alphabetically

3. Colored Group Badges

Applied consistent colored badges to provider groups in the list view:

  • Uses getGroupColor() utility for stable colors based on group name hash
  • Automatic contrast text color calculation for accessibility

4. Translation Improvements

Russian (compact labels for better UI fit):

  • "Первый байт" → "1 байт" (First byte)
  • "Интервал потока" → "поток" (Stream)
  • "Непотоковая" → "не поток" (Non-streaming)
  • "Использование сегодня" → "Сегодня" (Today)
  • "Множитель стоимости" → "Коэф цены" (Cost coefficient)
  • "Управление поставщиками" → "Поставщики" (Providers)

English:

  • Status filter uses "Any status" instead of "All"
  • Fixed hardcoded Chinese "新增服务商" → "Add server"

All locales (en, ja, ru, zh-CN, zh-TW):

  • Added filter translation keys
  • Added "default" group translation key

5. MCP Passthrough Configuration (i18n)

Added translations for the new MCP passthrough configuration feature across all locales:

  • Type selection (None, Minimax, GLM, Custom)
  • URL configuration and auto-extraction hints

Changes

Core Changes

  • provider-manager.tsx: Added status filter dropdown, group filter buttons with multi-select, filtering logic
  • provider-rich-list-item.tsx: Applied colored badges with contrast text colors using getGroupColor and getContrastTextColor utilities
  • add-provider-dialog.tsx: Fixed hardcoded Chinese text to use i18n

Supporting Changes

  • messages/en/settings.json: Filter translations, MCP passthrough i18n
  • messages/ja/settings.json: Filter translations, MCP passthrough i18n
  • messages/ru/settings.json: Compact labels, filter translations, MCP passthrough i18n
  • messages/zh-CN/settings.json: Filter translations
  • messages/zh-TW/settings.json: Filter translations, MCP passthrough i18n
  • CHANGELOG.md: Updated for v0.3.37 release

Related Issues & PRs

Testing

Automated

  • Build passes (bun run build)
  • TypeScript checks pass
  • All 5 locales have consistent translations

Manual Testing

  1. Navigate to Settings → Providers
  2. Test status filter dropdown (All/Active/Inactive)
  3. Test group filter buttons (multi-select)
  4. Verify colored badges appear for provider groups
  5. Verify Russian translations are compact and fit well
  6. Test adding new provider (button text should be localized)

Checklist

  • Code follows project conventions
  • Self-review completed
  • Tests pass locally
  • All 5 locales updated consistently

Description enhanced by Claude AI

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @miraserver, 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 user experience of the administrator's provider management section by introducing robust filtering capabilities for provider status and groups, improving the visual presentation of provider groups with dynamic coloring, and ensuring consistent and refined translations across multiple languages. These changes aim to make provider management more intuitive and efficient for administrators.

Highlights

  • UI Enhancements: Introduced a status filter (All, Active, Inactive) and a group filter with multiselect support in the provider management interface. Providers without assigned groups are now categorized under a 'default' group. Group badges are now colored dynamically with contrasting text for better visual distinction, and groups are sorted alphabetically with 'default' appearing first.
  • Translation Improvements: Updated Russian translations with more compact labels for 'First byte', 'Stream interval', 'Non-streaming', 'Usage today', and 'Cost multiplier'. English translations for the status filter ('All' to 'Any status') and the 'Add server' button were refined. Translations for the new filters and the 'default' group were added across all supported locales (en, ru, ja, zh-CN, zh-TW).
  • MCP Passthrough Configuration: Added new translation keys for 'MCP Passthrough Configuration' across English, Japanese, Russian, and Traditional Chinese locales, indicating support for configuring tool calls to specified AI providers like Minimax and GLM.
  • Code Refinements: The provider-manager.tsx file was updated to include the new filter UI and logic. provider-rich-list-item.tsx was modified to render colored group badges. add-provider-dialog.tsx was fixed to use translated text for the 'Add server' button instead of hardcoded Chinese.
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.

@github-actions github-actions Bot added enhancement New feature or request area:UI area:i18n area:provider size/S Small PR (< 200 lines) labels Dec 24, 2025

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

Copy link
Copy Markdown
Contributor

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 primarily focuses on enhancing the provider management section with new filtering capabilities and improved internationalization. Key changes include adding status and group filters to the provider list, allowing users to filter providers by their active/inactive status and assigned group tags. The group tags are now dynamically styled with unique background and contrasting text colors. Internationalization updates were made across English, Japanese, Russian, Simplified Chinese, and Traditional Chinese language files, introducing translations for the new 'MCP Passthrough Configuration' and the enhanced provider filtering options. The 'Add server' button was also internationalized. A review comment highlighted a code duplication issue in provider-manager.tsx concerning the parsing of groupTag and suggested refactoring it into a shared utility function for better maintainability.

Comment on lines +121 to +125
const providerGroups =
p.groupTag
?.split(",")
.map((t) => t.trim())
.filter(Boolean) || [];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Логика для разбора groupTag дублируется. Похожий код находится в useMemo для allGroups (строки 71-74). Рекомендую вынести эту логику в отдельную вспомогательную функцию, чтобы избежать дублирования и улучшить поддерживаемость кода. Например, можно создать функцию const getProviderGroups = (provider: ProviderDisplay) => provider.groupTag?.split(',').map(t => t.trim()).filter(Boolean) || []; и использовать её в обоих местах.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review Summary

No significant issues identified in this PR. The changes add well-implemented status and group filtering functionality to the provider management UI, with proper i18n support across all 5 locales.

PR Size: S

  • Lines changed: 417 (394 additions, 23 deletions)
  • Files changed: 9

Review Coverage

  • Logic and correctness - Clean
  • Security (OWASP Top 10) - Clean
  • Error handling - Clean
  • Type safety - Clean
  • Documentation accuracy - Clean
  • Test coverage - N/A (UI components, follows existing patterns)
  • Code clarity - Good

Notes

  • New filter implementation follows existing codebase patterns
  • Color utilities (getGroupColor, getContrastTextColor) reused from existing implementations
  • Translation keys consistently added across all 5 locales (en, ja, ru, zh-CN, zh-TW)
  • MCP passthrough translations added as part of this PR are consistent across locales

Automated review by Claude AI

@ding113

ding113 commented Dec 25, 2025

Copy link
Copy Markdown
Owner

The changes to CHANGELOG.md and package.json appear to be unrelated to this PR. Please address them.

John Doe and others added 3 commits December 25, 2025 11:37
Enhancements to settings/providers interface:

**Features:**
- Add status filter (All/Active/Inactive)
- Add group filter with multiselect
- Add "default" group for providers without assigned groups
- Apply colored badges to provider groups (using color utils)

**Translations:**
- Fix Russian translations (shorter labels for compact UI)
  - "Первый байт" → "1 байт"
  - "Интервал потока" → "поток"
  - "Непотоковая" → "не поток"
  - "Использование сегодня" → "Сегодня"
  - "Множитель стоимости" → "Коэф цены"
  - "Управление поставщиками" → "Поставщики"
- Update button translations (en: "Add server", ru: "Добавить")
- Change status filter "All" → "Any status" in English
- Add filter translations to all 5 locales (en, ru, ja, zh-CN, zh-TW)
- Add "default" group translation key

**Implementation:**
- provider-manager.tsx: Filter UI and logic
- provider-rich-list-item.tsx: Colored group badges
- add-provider-dialog.tsx: Fix hardcoded Chinese text
- Sort groups: "default" first, then alphabetically

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove unused Badge import from provider-manager.tsx
- Auto-fix line endings (CRLF -> LF) across 559 files
- Resolves lint check failures in CI
@miraserver

Copy link
Copy Markdown
Contributor Author

The changes to CHANGELOG.md and package.json appear to be unrelated to this PR. Please address them.

done

@ding113
ding113 merged commit 2cb6b7b into ding113:dev Dec 26, 2025
6 of 7 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Claude Code Hub Roadmap Dec 26, 2025
@github-actions github-actions Bot mentioned this pull request Dec 29, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:i18n area:provider area:UI enhancement New feature or request size/S Small PR (< 200 lines)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants