Skip to content

feat: add group settings WebUI management page#6577

Open
Sisyphbaous-DT-Project wants to merge 5 commits intoAstrBotDevs:masterfrom
Sisyphbaous-DT-Project:group-settings-feature
Open

feat: add group settings WebUI management page#6577
Sisyphbaous-DT-Project wants to merge 5 commits intoAstrBotDevs:masterfrom
Sisyphbaous-DT-Project:group-settings-feature

Conversation

@Sisyphbaous-DT-Project
Copy link
Copy Markdown

@Sisyphbaous-DT-Project Sisyphbaous-DT-Project commented Mar 18, 2026

Summary

Add visual interface for managing group chat specific Provider and Persona settings, matching the existing /group_set command functionality.

Changes

Backend

  • Add astrbot/dashboard/routes/group_settings.py with REST APIs:
    • GET /api/group-settings/list - List all group settings (pagination)
    • GET /api/group-settings/get - Get single group setting
    • POST /api/group-settings/set-provider - Set group Provider
    • POST /api/group-settings/set-persona - Set group Persona
    • POST /api/group-settings/clear - Clear group settings
    • GET /api/group-settings/providers - List available providers
    • GET /api/group-settings/personas - List available personas
  • Register GroupSettingsRoute in astrbot/dashboard/server.py

Frontend

  • Add dashboard/src/views/GroupSettingsPage.vue with full CRUD UI:
    • Data table with pagination and search
    • Add/Edit dialogs for Provider and Persona selection
    • Batch delete functionality
    • Platform color coding
  • Add route in dashboard/src/router/MainRoutes.ts
  • Add sidebar navigation in dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts

i18n

  • Add translations for zh-CN, en-US, ru-RU
  • Register in dashboard/src/i18n/translations.ts
  • Update navigation labels in all three locales

Files Changed

  • 5 new files
  • 7 modified files

为群聊设置功能添加 WebUI 管理界面,与现有的 /group_set 命令功能匹配,提供可视化的群聊特定 Provider 和 Persona 设置管理。

Modifications / 改动点

新增文件 (5个):

  1. astrbot/dashboard/routes/group_settings.py - 后端 REST API 路由

    • GET /api/group-settings/list - 获取群设置列表(支持分页)
    • GET /api/group-settings/get - 获取单个群设置
    • POST /api/group-settings/set-provider - 设置群 Provider
    • POST /api/group-settings/set-persona - 设置群 Persona
    • POST /api/group-settings/clear - 清除群设置
    • GET /api/group-settings/providers - 获取可用 Providers
    • GET /api/group-settings/personas - 获取可用 Personas
  2. dashboard/src/views/GroupSettingsPage.vue - 前端管理页面

    • 数据表格展示(支持分页、搜索)
    • 添加/编辑对话框(选择 Provider 和 Persona)
    • 批量删除功能
    • 平台颜色标识
  3. dashboard/src/i18n/locales/zh-CN/features/group-settings.json - 中文翻译

  4. dashboard/src/i18n/locales/en-US/features/group-settings.json - 英文翻译

  5. dashboard/src/i18n/locales/ru-RU/features/group-settings.json - 俄文翻译

修改文件 (7个):

  1. astrbot/dashboard/server.py - 注册 GroupSettingsRoute
  2. dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts - 添加侧边栏导航
  3. dashboard/src/router/MainRoutes.ts - 添加路由配置
  4. dashboard/src/i18n/translations.ts - 注册三语言翻译
  5. dashboard/src/i18n/locales/zh-CN/core/navigation.json - 添加中文导航标签
  6. dashboard/src/i18n/locales/en-US/core/navigation.json - 添加英文导航标签
  7. dashboard/src/i18n/locales/ru-RU/core/navigation.json - 添加俄文导航标签
  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

访问地址: http://localhost:6185/group-settings

功能验证:

  • 群聊设置列表展示正常(UMO、Provider、Persona、设置时间等)
  • 添加群聊设置功能正常(选择 Provider 和 Persona)
  • 编辑群聊设置功能正常
  • 删除/批量删除功能正常
  • 搜索过滤功能正常
  • 分页功能正常
  • 中文/英文/俄文三语言显示正常

Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txtpyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Add a WebUI page and backend APIs for managing group-specific provider and persona settings, including listing, editing, and clearing group chat configurations.

New Features:

  • Introduce REST endpoints for listing, retrieving, updating, and clearing group chat provider and persona settings, along with listing available providers and personas.
  • Add a Group Settings dashboard page with searchable, paginated table, add/edit dialogs, and batch delete actions for group configurations.
  • Register a new navigation route and sidebar entry to access the group settings page from the main dashboard.

Enhancements:

  • Extend i18n resources and navigation labels in zh-CN, en-US, and ru-RU locales to support the new group settings interface.

@auto-assign auto-assign bot requested review from Fridemn and anka-afk March 18, 2026 14:49
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 18, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 introduces a user-friendly WebUI for managing group-specific AI provider and persona settings. It streamlines the configuration process by providing a visual interface that mirrors existing command-line functionalities, significantly improving the ease of use for administrators to customize bot behavior across various chat groups.

Highlights

  • WebUI for Group Settings: Implemented a new WebUI page for managing group chat specific Provider and Persona settings, providing a visual interface for functionality previously only available via commands.
  • Backend API Development: Developed a suite of new backend REST APIs to support the group settings management, including endpoints for listing, retrieving, setting, and clearing group-specific provider and persona configurations.
  • Frontend CRUD Interface: Created a comprehensive frontend Vue.js component (GroupSettingsPage.vue) that offers full CRUD (Create, Read, Update, Delete) capabilities for group settings, complete with pagination, search, batch deletion, and platform-specific color coding.
  • Internationalization (i18n): Added multi-language support for the new group settings feature, including translations for Chinese (zh-CN), English (en-US), and Russian (ru-RU) locales.
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.

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.

@dosubot dosubot bot added area:webui The bug / feature is about webui(dashboard) of astrbot. feature:persona The bug / feature is about astrbot AI persona system (system prompt) labels Mar 18, 2026
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've found 2 issues, and left some high level feedback:

  • The /group-settings/clear endpoint currently clears all group settings when umo is omitted, which is quite destructive for a generic API; consider requiring an explicit flag (e.g. clear_all=true) or removing the clear-all branch to avoid accidental global wipes.
  • The frontend search filters by umo, provider_id, and persona_id while the backend /group-settings/list endpoint only filters by umo; aligning the backend search to also match provider_id/persona_id (or removing the extra client-side filter) would make the search behavior more predictable and consistent.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `/group-settings/clear` endpoint currently clears all group settings when `umo` is omitted, which is quite destructive for a generic API; consider requiring an explicit flag (e.g. `clear_all=true`) or removing the clear-all branch to avoid accidental global wipes.
- The frontend search filters by `umo`, `provider_id`, and `persona_id` while the backend `/group-settings/list` endpoint only filters by `umo`; aligning the backend search to also match `provider_id`/`persona_id` (or removing the extra client-side filter) would make the search behavior more predictable and consistent.

## Individual Comments

### Comment 1
<location path="dashboard/src/views/GroupSettingsPage.vue" line_range="281-284" />
<code_context>
+];
+
+// Filtered settings list
+const filteredSettingsList = computed(() => {
+  if (!searchQuery.value) return settingsList.value;
+  const query = searchQuery.value.toLowerCase();
+  return settingsList.value.filter(item =>
+    item.umo.toLowerCase().includes(query) ||
+    (item.provider_id && item.provider_id.toLowerCase().includes(query)) ||
</code_context>
<issue_to_address>
**issue (bug_risk):** Search is applied both server-side and client-side, which can desync the row count and the displayed list.

Because this is a `v-data-table-server`, `loadSettings` already sends `search` to `/api/group-settings/list`, which filters on the backend and sets `totalItems`. `filteredSettingsList` then applies an additional client-side filter with `searchQuery`, so `totalItems` can differ from the number of rendered rows and frontend search behavior may diverge from the backend. It would be more consistent to either rely solely on server-side search (`items = settingsList`) or switch to a non-`server` table and do all filtering client-side.
</issue_to_address>

### Comment 2
<location path="astrbot/dashboard/routes/group_settings.py" line_range="41" />
<code_context>
+        }
+        self.register_routes()
+
+    async def list_group_settings(self):
+        """获取所有群设置列表
+
</code_context>
<issue_to_address>
**issue (complexity):** Consider extracting shared helpers for UMO parsing/serialization, pagination, and clearing all settings to reduce duplication and keep route logic simpler and more consistent.

You can reduce duplication and keep behavior the same with a few small helpers.

### 1. Extract UMO parsing + serialization

The UMO parsing and response shaping are duplicated in `list_group_settings` and `get_group_setting`. A tiny helper keeps them in sync:

```python
def _parse_umo(self, umo: str) -> dict:
    parts = umo.split(":")
    return {
        "umo": umo,
        "platform": parts[0] if len(parts) >= 1 else "unknown",
        "message_type": parts[1] if len(parts) >= 2 else "unknown",
        "group_id": parts[2] if len(parts) >= 3 else umo,
    }

def _serialize_settings(self, umo: str, settings) -> dict:
    base = self._parse_umo(umo)
    base.update(
        {
            "provider_id": settings.provider_id or "",
            "persona_id": settings.persona_id or "",
            "model": settings.model or "",
            "set_by": settings.set_by or "",
            "set_at": settings.set_at or "",
        }
    )
    return base
```

Use it in both places:

```python
# list_group_settings
settings_list = []
for umo, settings in all_settings.items():
    if search and search.lower() not in umo.lower():
        continue
    settings_list.append(self._serialize_settings(umo, settings))
```

```python
# get_group_setting
settings = await self.group_settings_mgr.get_settings(umo)
return (
    Response()
    .ok(self._serialize_settings(umo, settings))
    .__dict__
)
```

This removes the repeated split/field extraction and reduces chances of divergence.

### 2. Extract pagination helper

The manual pagination logic can be hidden behind a small helper to keep the handler focused:

```python
def _paginate(self, items, page: int, page_size: int):
    if page < 1:
        page = 1
    if page_size < 1:
        page_size = 20
    if page_size > 100:
        page_size = 100

    total = len(items)
    start_idx = (page - 1) * page_size
    end_idx = start_idx + page_size
    return items[start_idx:end_idx], total, page, page_size
```

Then in `list_group_settings`:

```python
page = request.args.get("page", 1, type=int)
page_size = request.args.get("page_size", 20, type=int)
search = request.args.get("search", "", type=str).strip()

all_settings = await self.group_settings_mgr.get_all_groups_with_settings()

settings_list = []
for umo, settings in all_settings.items():
    if search and search.lower() not in umo.lower():
        continue
    settings_list.append(self._serialize_settings(umo, settings))

paginated, total, page, page_size = self._paginate(settings_list, page, page_size)

return (
    Response()
    .ok(
        {
            "settings": paginated,
            "total": total,
            "page": page,
            "page_size": page_size,
        }
    )
    .__dict__
)
```

### 3. Simplify clear-all path (optional, if you can change the manager)

If you can extend `GroupSettingsManager`, exposing a `clear_all_settings()` keeps route logic simpler:

```python
# in GroupSettingsManager
async def clear_all_settings(self):
    all_settings = await self.get_all_groups_with_settings()
    for group_umo in all_settings.keys():
        await self.clear_settings(group_umo)
```

Then the route becomes:

```python
async def clear_group_settings(self):
    try:
        data = await request.get_json()
        umo = data.get("umo", "").strip()

        if umo:
            await self.group_settings_mgr.clear_settings(umo)
            payload = {"message": f"{umo} 的设置已清除", "umo": umo}
        else:
            await self.group_settings_mgr.clear_all_settings()
            payload = {"message": "所有群设置已清除"}

        return Response().ok(payload).__dict__
    except Exception as e:
        logger.error(f"清除群设置失败: {e!s}")
        return Response().error(f"清除群设置失败: {e!s}").__dict__
```

These small helpers reduce repetition and cognitive load without changing behavior or the public API.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread dashboard/src/views/GroupSettingsPage.vue Outdated
Comment thread astrbot/dashboard/routes/group_settings.py
Copy link
Copy Markdown
Contributor

@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

This pull request introduces a new 'Group Settings' feature to the AstrBot dashboard, allowing users to configure specific Providers and Personas for different chat groups. The changes include adding a new backend API route (GroupSettingsRoute) to handle listing, getting, setting, and clearing group settings, as well as listing available providers and personas. On the frontend, a new Vue page (GroupSettingsPage.vue) is implemented to provide a user interface for managing these settings, including data display, search, pagination, and CRUD operations for group settings. Internationalization files for English, Russian, and Simplified Chinese are updated to include new strings for this feature, and the navigation menu and routing are updated to integrate the new page. Review comments highlight several areas for improvement: the saveSetting function in the frontend needs to correctly handle clearing previously set provider or persona IDs, the backend API's pagination logic should return explicit errors for invalid input instead of silently correcting them, the UMO parsing logic in the backend should accurately represent group_id as empty if not provided, the frontend UMO validation could be more robust using a regex, and the error reporting for partial updates in the saveSetting function should provide more detailed feedback to the user.

Comment thread dashboard/src/views/GroupSettingsPage.vue
Comment thread astrbot/dashboard/routes/group_settings.py Outdated
Comment thread astrbot/dashboard/routes/group_settings.py Outdated
Comment thread astrbot/dashboard/routes/group_settings.py Outdated
Comment thread dashboard/src/views/GroupSettingsPage.vue Outdated
Comment thread dashboard/src/views/GroupSettingsPage.vue Outdated
- Add confirm_clear_all flag for clear all operation (security fix)
- Add clear-provider and clear-persona endpoints for granular control
- Fix UMO parsing to return empty string instead of full UMO
- Fix pagination validation to return 400 error instead of silent correction
- Enhance search to match provider_id and persona_id in backend
- Add strict regex validation for UMO format in frontend
- Improve error reporting with detailed operation results
- Extract helper methods to reduce code duplication
- Update i18n translations for all three languages
- Add astrbot/core/group_settings/manager.py (missing module)

- Fix duplicate buttons key in zh-CN/en-US/ru-RU group-settings.json

- Ensure all button translations are properly merged
@Sisyphbaous-DT-Project
Copy link
Copy Markdown
Author

Summary

Add visual interface for managing group chat specific Provider and Persona settings, matching the existing /group_set command functionality.

Changes

Backend

  • New File: astrbot/dashboard/routes/group_settings.py - REST API routes
    • GET /api/group-settings/list - List all group settings (pagination, search)
    • GET /api/group-settings/get - Get single group setting
    • POST /api/group-settings/set-provider - Set group Provider
    • POST /api/group-settings/set-persona - Set group Persona
    • POST /api/group-settings/clear-provider - Clear Provider override (NEW)
    • POST /api/group-settings/clear-persona - Clear Persona override (NEW)
    • POST /api/group-settings/clear - Clear group settings with confirm_clear_all flag
    • GET /api/group-settings/providers - List available providers
    • GET /api/group-settings/personas - List available personas
  • New File: astrbot/core/group_settings/manager.py - GroupSettingsManager module

Frontend

  • New File: dashboard/src/views/GroupSettingsPage.vue - Full CRUD UI
  • Modified: dashboard/src/router/MainRoutes.ts - Route config
  • Modified: dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts - Sidebar nav

i18n

  • New Files:
    • dashboard/src/i18n/locales/zh-CN/features/group-settings.json
    • dashboard/src/i18n/locales/en-US/features/group-settings.json
    • dashboard/src/i18n/locales/ru-RU/features/group-settings.json
  • Modified: dashboard/src/i18n/translations.ts - Register translations
  • Modified: Navigation labels in all 3 languages

Code Review Fixes

Issue Status Fix
Security: clear endpoint destructive ✅ Fixed Added confirm_clear_all flag requirement
Search filter inconsistent ✅ Fixed Backend now searches umo, provider_id, persona_id
UMO parsing group_id default ✅ Fixed Returns empty string instead of full UMO
Pagination silent correction ✅ Fixed Returns 400 error for invalid params
UMO validation too loose ✅ Fixed Added regex /^[^:]+:[^:]+:[^:]+$/
Missing clear granular endpoints ✅ Fixed Added clear-provider and clear-persona
Code duplication ✅ Fixed Extracted _parse_umo(), _serialize_settings(), _validate_pagination()
i18n missing translations ✅ Fixed Fixed duplicate buttons key in all languages

Testing

  • Local testing completed
  • API endpoints tested
  • Frontend UI verified

Screenshots

N/A (Please add screenshots if needed)

Checklist

  • No new dependencies introduced
  • Code follows project style guidelines
  • All review comments addressed

Copy link
Copy Markdown
Contributor

@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

This pull request introduces a comprehensive WebUI for managing group settings, which is a great feature enhancement. The backend APIs are well-structured with validation and error handling, and the Vue.js frontend provides a clean and functional user interface with server-side pagination and batch operations. The code is in a good state, especially since it seems to have already incorporated feedback from a previous review. I have a few suggestions for further improvements regarding efficiency and correctness.

Comment thread astrbot/dashboard/routes/group_settings.py Outdated
Comment thread dashboard/src/views/GroupSettingsPage.vue Outdated
Comment thread dashboard/src/views/GroupSettingsPage.vue
- Add clear_all_settings() method to GroupSettingsManager for efficient bulk clearing

- Optimize clear_group_settings API to support umos array for batch deletion

- Fix formatDate to correctly handle Unix timestamp (seconds to milliseconds)

- Update batchDelete to use single API call instead of multiple requests
@Sisyphbaous-DT-Project
Copy link
Copy Markdown
Author

@gemini-code-assist All review comments have been addressed:

clear_all_settings efficiency: Added clear_all_settings() method in GroupSettingsManager
formatDate timestamp bug: Fixed by converting seconds to milliseconds (Number(value) * 1000)
batchDelete optimization: Now uses single API call with umos array instead of multiple requests

All changes are backward compatible. Ready for re-review! 🎉

@Sisyphbaous-DT-Project
Copy link
Copy Markdown
Author

✅ AI Review Comments Addressed

All efficiency and correctness issues have been fixed:

🔧 Backend Fixes

Issue Fix
clear_all_settings efficiency Added clear_all_settings() method to GroupSettingsManager for O(1) bulk clearing
batch delete API /api/group-settings/clear now supports umos array parameter for atomic batch deletion

API Usage:

// Single delete (backward compatible)
{ "umo": "qq:group:123" }

// Batch delete (new)
{ "umos": ["qq:group:111", "qq:group:222"] }

// Clear all (optimized)
{ "confirm_clear_all": true }

Copy link
Copy Markdown
Contributor

@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

这个 PR 为群组特定的 provider 和 persona 设置增加了一个新的 WebUI 管理页面及配套的后端 API。实现非常全面,涵盖了设置的列表、创建、编辑和删除功能,并支持分页、搜索和批量操作。代码结构清晰,并且很高兴看到像危险的批量操作和 UI/API 一致性等潜在问题都得到了考虑和处理。我为新的 GroupSettingsManager 提供了一些重构建议,以通过减少代码重复来进一步提高代码质量。

Comment thread astrbot/core/group_settings/manager.py Outdated
Comment thread astrbot/core/group_settings/manager.py Outdated
- Add _update_setting() helper for set_provider/set_persona

- Add _cleanup_if_empty() helper for remove_provider_override/remove_persona_override

- Improve code maintainability without changing behavior
@gemini-code-assist
Copy link
Copy Markdown
Contributor

感谢您的更新!很高兴看到 set_providerset_personaremove_provider_overrideremove_persona_override 方法已通过提取 _update_setting()_cleanup_if_empty() 辅助方法进行了重构。这些改动有效地消除了重复代码,显著提高了代码的可维护性,并且保持了原有行为不变,这是非常好的改进。

我将对这些更改进行重新审查。

@Sisyphbaous-DT-Project
Copy link
Copy Markdown
Author

set_provider / set_persona: 提取 _update_setting() 辅助方法,统一处理设置更新逻辑
remove_provider_override / remove_persona_override: 提取 _cleanup_if_empty() 辅助方法,统一处理空设置清理

改动范围: astrbot/core/group_settings/manager.py

重构效果:

  • 消除重复代码
  • 提高可维护性
  • 保持原有行为不变

@gemini-code-assist
Copy link
Copy Markdown
Contributor

感谢您的确认!很高兴看到 set_providerset_persona 方法通过提取 _update_setting() 辅助方法,以及 remove_provider_overrideremove_persona_override 方法通过提取 _cleanup_if_empty() 辅助方法,进一步完成了重构。这些改进对于提高代码的可维护性和减少重复代码非常有益。

我将立即开始对这些最新的更改进行重新审查。

@Sisyphbaous-DT-Project
Copy link
Copy Markdown
Author

@gemini-code-assist 项目代码还有什么问题吗

Copy link
Copy Markdown
Contributor

@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

本次 PR 新增了群组设置的 WebUI 管理页面,这是一个很棒的功能增强。整体实现质量很高,前后端代码都比较清晰、健壮。后端 API 设计合理,前端 Vue 组件也考虑了分页、搜索、批量操作等多种场景,用户体验良好。我只发现了一个可读性方面的小优化点,详见具体评论。做得很好!

Comment thread astrbot/dashboard/routes/group_settings.py
@gemini-code-assist
Copy link
Copy Markdown
Contributor

感谢您的提问!我正在对您最新的更改进行全面的重新审查。一旦完成,我将立即提供详细的反馈。感谢您持续的更新和对代码质量的关注!

@Sisyphbaous-DT-Project
Copy link
Copy Markdown
Author

@gemini-code-assist 感谢审查和肯定!
关于列表推导式的建议:当前实现虽然可以优化可读性,但功能正确且性能良好。考虑到代码简洁性,我们决定保持现有实现。如果后续维护中出现可读性问题,再考虑重构
所有关键问题已修复,PR 已准备就绪

@gemini-code-assist
Copy link
Copy Markdown
Contributor

感谢您的详细更新和对所有反馈的积极处理!

我已重新审查了您的更改,并确认 pr_review_fixes.md 中列出的所有高优先级和中优先级问题都已得到妥善解决,包括:

  • 清除全部设置的危险操作:已通过 confirm_clear_all 标志和批量删除功能得到安全处理。
  • 编辑时无法清除 Provider/Persona:已新增 clear-providerclear-persona API,并在前端逻辑中正确调用,实现了清除功能。
  • 前后端搜索不一致:后端 list_group_settings 方法现在已包含对 provider_idpersona_id 的搜索,与前端行为一致。
  • UMO 解析逻辑不准确_parse_umo 方法已修正,当 group_id 缺失时返回空字符串。
  • 分页参数验证:无效的分页参数现在会返回 400 错误,而不是静默修正。

此外,低优先级的建议,如 UMO 验证的严格性部分更新错误报告的详细程度,也已在代码中实现。

关于列表推导式的建议,我理解您为了代码简洁性而选择保持现有实现。这在功能正确且性能良好的情况下是合理的。

总的来说,所有关键问题都已解决,代码质量得到了显著提升。此 PR 已准备好合并。干得好!

@gemini-code-assist
Copy link
Copy Markdown
Contributor

感谢您的确认和对所有反馈的积极处理!很高兴看到所有关键问题都已解决,并且您对代码质量的关注带来了显著的改进。此 PR 确实已准备好合并。干得好!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:webui The bug / feature is about webui(dashboard) of astrbot. feature:persona The bug / feature is about astrbot AI persona system (system prompt) size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant