Skip to content

perf: improve ui#7178

Merged
Soulter merged 2 commits intomasterfrom
perf/improve-ui
Mar 30, 2026
Merged

perf: improve ui#7178
Soulter merged 2 commits intomasterfrom
perf/improve-ui

Conversation

@Soulter
Copy link
Copy Markdown
Member

@Soulter Soulter commented Mar 30, 2026

  • perf: enhance layout responsiveness and text handling in stats page
  • perf: enhance subagent, future task UI

Modifications / 改动点

  • This is NOT a breaking change. / 这不是一个破坏性变更。

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


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

Revamp several dashboard views with a new shared shell layout, improve responsiveness and text handling, and add quality-of-life controls for subagents, scheduled tasks, and conversations.

New Features:

  • Track and warn about unsaved changes on the SubAgent configuration page, including reload/navigation confirmations.
  • Allow switching between parsed and raw UMO display and copying the UMO source in the conversations table.
  • Show high-level statistics cards for cron jobs, including total and enabled task counts.

Bug Fixes:

  • Prevent layout overflow and truncation issues in stats and configuration views by tightening wrapping and column behavior.

Enhancements:

  • Redesign the SubAgent and CronJob pages to use a unified dashboard shell with improved layout, dark-mode support, and more informative empty and loading states.
  • Refine the cron jobs list into a custom, more readable table with better scheduling and session information and sensible sorting.
  • Improve stats page typography and token-related layout to handle long text and values more gracefully across screen sizes.
  • Extract shared dashboard layout and card styles into a reusable stylesheet to standardize page structure and responsiveness across views.

Soulter added 2 commits March 30, 2026 14:05
- Updated the overall structure of the SubAgentPage component for better readability and maintainability.
- Introduced a new dashboard layout with improved header and action buttons.
- Replaced the old settings card with a more visually appealing setting card design.
- Enhanced the agent list section with a more user-friendly display and added empty state handling.
- Implemented unsaved changes notification and confirmation dialogs for better user interaction.
- Refactored code for better clarity and organization, including the use of computed properties for state management.
@auto-assign auto-assign bot requested review from Fridemn and LIghtJUNction March 30, 2026 07:02
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 30, 2026
@Soulter Soulter changed the title perf/improve ui perf: improve ui Mar 30, 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 reviewed your changes and they look great!


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.

@dosubot dosubot bot added the area:webui The bug / feature is about webui(dashboard) of astrbot. label Mar 30, 2026
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 implements a significant UI overhaul for the dashboard, introducing a standardized layout system via the new dashboard-shell.css. The Cron Job and SubAgent pages have been refactored to use this system, with the SubAgent page also gaining unsaved changes detection and navigation guards. Additionally, the Conversation page was updated to consolidate session details into a single "UMO" column with toggleable display modes and copy functionality. Feedback identifies a regression in the Cron Job page where the switch to a custom table removed interactive sorting and suggests including several calculated but unused statistics in the new overview cards.

Comment on lines +91 to +157
<div v-else class="task-table-wrap">
<table class="task-table">
<colgroup>
<col class="col-name" />
<col class="col-type" />
<col class="col-cron" />
<col class="col-session" />
<col class="col-next-run" />
<col class="col-last-run" />
<col class="col-actions" />
</colgroup>
<thead>
<tr>
<th>{{ tm('table.headers.name') }}</th>
<th>{{ tm('table.headers.type') }}</th>
<th>{{ tm('table.headers.cron') }}</th>
<th>{{ tm('table.headers.session') }}</th>
<th>{{ tm('table.headers.nextRun') }}</th>
<th>{{ tm('table.headers.lastRun') }}</th>
<th class="actions-col">{{ tm('table.headers.actions') }}</th>
</tr>
</thead>
<tbody>
<tr v-for="item in sortedJobs" :key="item.job_id">
<td class="name-col">
<div class="task-name">{{ item.name || tm('table.notAvailable') }}</div>
<div class="task-subline">{{ item.description || item.job_id }}</div>
</td>
<td>
<v-chip size="small" :color="item.run_once ? 'orange' : 'primary'" variant="tonal">
{{ jobTypeLabel(item) }}
</v-chip>
</td>
<td>
<div class="task-text">{{ scheduleLabel(item) }}</div>
<div class="task-subline">{{ scheduleMeta(item) }}</div>
</td>
<td>
<div class="task-session">{{ item.session || tm('table.notAvailable') }}</div>
</td>
<td>
<div class="task-text">{{ formatTime(item.next_run_time) }}</div>
</td>
<td>
<div class="task-text">{{ formatTime(item.last_run_at) }}</div>
</td>
<td class="actions-col">
<div class="table-actions">
<v-switch
v-model="item.enabled"
inset
density="compact"
hide-details
color="primary"
class="mt-0"
@change="toggleJob(item)"
/>
<v-btn size="small" variant="text" color="error" @click="deleteJob(item)">
{{ tm('actions.delete') }}
</v-btn>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
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

The replacement of v-data-table with a custom <table> has led to a regression in functionality. The previous implementation allowed users to sort data by clicking on column headers, but this feature is now missing. The current implementation provides a fixed sorting order through the sortedJobs computed property.

While the new table aligns with the updated UI design, losing interactive sorting diminishes user experience.

Consider either:

  1. Re-implementing interactive sorting for the new table.
  2. Styling the v-data-table component to match the new design, thereby retaining its built-in features like sorting and filtering. v-data-table is highly customizable via slots and CSS.

Comment on lines +274 to 287
const overviewCards = computed(() => [
{
label: tm('overview.totalTasks'),
value: String(jobs.value.length),
note: tm('overview.totalTasksNote'),
icon: 'mdi-calendar-multiple'
},
{
label: tm('overview.enabledTasks'),
value: String(enabledJobsCount.value),
note: tm('overview.enabledTasksNote'),
icon: 'mdi-check-circle-outline'
}
])
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

The new overview cards are a great enhancement to the UI. However, it seems that some planned statistics are not being displayed. The i18n files include translations for "One-off Tasks", "Recurring Tasks", and "Proactive Platforms", and the script computes runOnceCount and recurringCount, but these are not used in the overviewCards.

Displaying these additional stats would provide a more complete overview. For instance, you could add cards for one-off tasks and proactive platforms. The note for the one-off tasks card could also display the count of recurring tasks as a complementary statistic.

Here is a suggestion to implement four cards:

Note that the page currently overrides the overview grid to have 2 columns. You may want to adjust this to repeat(4, minmax(0, 1fr)) or let it wrap to accommodate the additional cards.

const overviewCards = computed(() => [
  {
    label: tm('overview.totalTasks'),
    value: String(jobs.value.length),
    note: tm('overview.totalTasksNote'),
    icon: 'mdi-calendar-multiple'
  },
  {
    label: tm('overview.enabledTasks'),
    value: String(enabledJobsCount.value),
    note: tm('overview.enabledTasksNote'),
    icon: 'mdi-check-circle-outline'
  },
  {
    label: tm('overview.oneOffTasks'),
    value: String(runOnceCount.value),
    note: tm('overview.recurringTasksNote', { count: recurringCount.value }),
    icon: 'mdi-calendar-clock-outline'
  },
  {
    label: tm('overview.proactivePlatforms'),
    value: String(proactivePlatforms.value.length),
    note: tm('overview.proactivePlatformsNote'),
    icon: 'mdi-send-clock-outline'
  }
])

@Soulter Soulter merged commit 410f30b into master Mar 30, 2026
7 checks passed
@Soulter Soulter deleted the perf/improve-ui branch March 30, 2026 15:53
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. 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