Skip to content

Fix/dashboard react migration regressions - #161

Merged
Fridemn merged 10 commits into
mainfrom
fix/dashboard-react-migration-regressions
Jul 31, 2026
Merged

Fix/dashboard react migration regressions#161
Fridemn merged 10 commits into
mainfrom
fix/dashboard-react-migration-regressions

Conversation

@Fridemn

@Fridemn Fridemn commented Jul 31, 2026

Copy link
Copy Markdown
Member

本 PR 集中修复 Dashboard 从 Vue 迁移到 React 后出现的一系列回归问题,包括聊天流生命周期、提供商校验、公共控件样式、页面布局、加载反馈及桌面窗口交互。
修复 AstrBotDevs/AstrBot#9433
修复 #154

Summary / 改动概述

Chat streaming and session state / 聊天流与会话状态

  • Preserve active chat streams when navigating between Dashboard routes.
  • Move active stream controllers and message caches into a shared registry so unmounting the chat page no longer interrupts the WebSocket response.
  • Restore the latest cached streaming content when returning to a running conversation.
  • Keep conversation-list loading indicators synchronized with the actual stream state.
  • Validate persisted provider and model selections before sending the first message in a new conversation.
  • Automatically fall back to the first available provider when a previously selected provider no longer exists.
  • Prevent invalid provider IDs from being included in send, regenerate, retry, and checkpoint requests.

Shared dropdown controls / 统一下拉控件

  • Introduce shared SelectControl and SelectMenu components.
  • Replace inconsistent native selects across configuration, chat, monitoring, knowledge base, extension, pagination, and welcome pages.
  • Apply consistent borders, focus states, selected states, icons, spacing, and theme-aware colors.
  • Render expanded menus through a portal to prevent clipping by dialogs, cards, and scroll containers.
  • Automatically position menus above or below their trigger according to available viewport space.
  • Refine the page-size selector on the behavior management page.

Layout and visual feedback / 布局与视觉反馈

  • Enlarge the welcome-page model and platform onboarding dialogs with responsive viewport sizing.
  • Refine chat thinking and loading indicators to match the legacy Dashboard behavior.
  • Improve running indicators in both the active message area and conversation list.
  • Introduce shared portaled floating-action components.
  • Reuse the same floating-action implementation across:
    • Knowledge base
    • Installed AstrBot plugins
    • Plugin marketplace
    • MCP
    • Skills
  • Prevent floating buttons from shifting during entrance animations or being positioned relative to scrolling content.

Desktop window behavior / 桌面窗口行为

  • Keep the minimize button’s native behavior, minimizing the application to the taskbar.
  • Make the close button consistently hide the main window to the system tray.
  • Preserve explicit application exit through the tray menu.
  • Remove the obsolete configurable closeToTray behavior and related runtime branches.

Verification / 验证方式

Automated coverage was added or updated for:

  • Preserving active chat streams across route navigation.
  • Restoring cached streaming messages after returning to a conversation.
  • Falling back from stale persisted provider selections.
  • Chat loading and conversation-list indicators.
  • Shared select rendering and interaction behavior.
  • Portaled dropdown positioning and clipping prevention.
  • Behavior-page pagination controls.
  • Shared floating-action portal rendering.
  • Knowledge-base and extension-page interactions.
  • Desktop close, minimize, and tray-exit event handling.

Local Dashboard verification included:

  • Targeted Vitest suites.
  • TypeScript project build with npx tsc -b.
  • ESLint checks.
  • Stylelint checks.
  • Git diff whitespace checks.

Manual verification included:

  1. Start a streaming response and navigate to another Dashboard route.
  2. Return to the conversation and confirm the stream continued without WebSocket interruption.
  3. Start a new conversation with a stale persisted provider and confirm a valid provider is selected.
  4. Open dropdowns inside dialogs, cards, pagination areas, and scroll containers.
  5. Confirm dropdowns are not clipped and remain visually consistent.
  6. Open the welcome-page model and platform configuration dialogs.
  7. Check floating buttons on the knowledge base, plugin, marketplace, MCP, and Skills pages.
  8. Minimize the desktop application and confirm it remains on the taskbar.
  9. Close the main window and confirm the application remains available from the system tray.

Checklist / 检查清单

  • This change is not a breaking change. / 此改动不是破坏性变更。
  • I have verified the change locally (and provided logs/screenshots above). / 我已在本地验证并在上方提供日志/截图。
  • If workflows are changed, I attached at least one related Actions run link. / 如果修改了工作流,我已附上至少一个相关 Actions 运行链接。
  • If dependencies are updated, lockfiles are updated accordingly (src-tauri/Cargo.lock, lockfiles under changed package dirs). / 如果引入或升级依赖,已同步更新相关 lock 文件(如 src-tauri/Cargo.lock、对应包目录中的 lock 文件)。
  • This PR does not include malicious code. / 此 PR 不包含恶意代码。

Summary by Sourcery

Address regressions from the Dashboard React migration by stabilizing chat streaming/session state, unifying dropdown and floating-action UI, refining loading/transition visuals, and simplifying desktop window/tray behavior.

New Features:

  • Introduce shared SelectMenu and SelectControl components for consistent dropdown behavior and portal-based positioning across Dashboard pages.
  • Add shared FloatingActions/FloatingActionButton components to provide reusable, portaled floating action stacks for resource and extension pages.
  • Add a centralized chatStreamRegistry to persist active chat streams and message caches across route navigation.

Bug Fixes:

  • Ensure persisted provider and model selections are validated and replaced when the previous provider has been removed before starting a new chat session.
  • Keep active chat streams alive and message content restored when navigating between Dashboard routes instead of aborting streams on unmount.
  • Align chat loading indicators and session list progress spinners with lightweight, text-based feedback that matches legacy behavior.

Enhancements:

  • Apply theme-aware baseline styles to native form controls and custom select menus for consistent appearance and accessibility.
  • Refine pagination, filters, and configuration editors to use the shared select primitives, simplifying markup and improving layout responsiveness.
  • Adjust onboarding and configuration dialogs’ layout and motion transitions to better fit the viewport and avoid lingering transform states.

Tests:

  • Expand unit and integration coverage for chat streaming registry behavior, provider fallback selection, shared select controls, floating actions, and motion transition styles.
  • Update existing tests to interact with the new select menu components and verify batch operations, object editors, and configuration flows remain functional.

Chores:

  • Remove the obsolete closeToTray desktop setting, its tray menu wiring, and related runtime branches so closing the main window consistently hides to tray while quit remains explicit from the tray menu.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @Fridemn, your pull request is larger than the review limit of 150000 diff characters

@Fridemn
Fridemn merged commit 49a173a into main Jul 31, 2026
5 checks passed
@Fridemn
Fridemn deleted the fix/dashboard-react-migration-regressions branch July 31, 2026 12:14
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.

1 participant