Skip to content

feat: add conversation shortcuts to statistics - #9847

Merged
Soulter merged 1 commit into
masterfrom
codex/conversation-shortcut
Aug 27, 2026
Merged

feat: add conversation shortcuts to statistics#9847
Soulter merged 1 commit into
masterfrom
codex/conversation-shortcut

Conversation

@Soulter

@Soulter Soulter commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

  • rename the data navigation entry to Data & Logs
  • add a conversation shortcut to each session usage ranking row
  • initialize the conversation UMO filter from the URL while preserving default exclusions
  • make the UMO filter reliably clearable and keep the URL in sync
  • prevent long UMO values from causing horizontal overflow on mobile

Validation

  • pnpm typecheck
  • pnpm build
  • verified desktop and mobile shortcut navigation, filtering, reload persistence, and clearing in the browser

Summary by Sourcery

Connect session usage statistics with filtered conversation views while improving UMO filter persistence, clearing, and mobile layout behavior.

New Features:

  • Add shortcuts from session usage rankings to the conversation workspace filtered by the selected UMO.

Bug Fixes:

  • Preserve default conversation exclusions when the UMO filter is empty and make clearing the filter reliably update the URL and results.
  • Prevent long UMO values from causing horizontal overflow on mobile.

Enhancements:

  • Initialize the conversation UMO filter from the URL and rename the data navigation entry to Data & Logs.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. labels Aug 27, 2026
@Soulter
Soulter merged commit d2d7e5a into master Aug 27, 2026
20 of 21 checks passed

@sourcery-ai sourcery-ai 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.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="dashboard/src/views/conversation/ConversationWorkspacePage.vue" line_range="421-423" />
<code_context>
+  if (umoQuery.value.trim()) {
+    params.umo = umoQuery.value.trim();
+  } else {
+    params.exclude_ids = "astrbot";
+    params.exclude_platforms = "webchat";
+  }
   if (selectedBotIds.value.length) {
     params.platforms = selectedBotIds.value.join(",");
</code_context>
<issue_to_address>
**issue (broader_impact):** When an UMO filter is present, `exclude_ids` and `exclude_platforms` are omitted, so the conversation shortcut can show the default `astrbot` and `webchat` entries that were previously excluded.

**Triggers:** When the selected UMO belongs to the excluded bot or platform.

**Suggested fix:** Always include the default exclusions and add `params.umo` independently when a UMO filter is set.
</issue_to_address>

### Comment 2
<location path="dashboard/src/views/conversation/ConversationWorkspacePage.vue" line_range="98-100" />
<code_context>
 const selectedBotIds = ref<string[]>([]);
 const selectedTypes = ref<string[]>([]);
-const umoQuery = ref("");
+const umoQuery = ref(
+  typeof initialUmoQuery === "string" ? initialUmoQuery : "",
+);
 const sortValue = ref("updated_at:desc");
 const groupBySession = ref(false);
</code_context>
<issue_to_address>
**issue (bug_risk):** The UMO value is copied from the URL only during component setup, while later edits to `umoQuery` never update the URL; reloading after typing or changing the filter loses the filter, and navigating between conversation shortcuts while the component is reused leaves the old filter active.

**Triggers:** When the user types a UMO into the filter or navigates from one statistics shortcut to another without remounting the conversation page.

**Suggested fix:** Watch `umoQuery` and synchronize `route.query.umo`, and watch route query changes to update `umoQuery` when the router reuses the page component.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: dashboard/src/views/conversation/ConversationWorkspacePage.vue:423, dashboard/src/views/conversation/ConversationWorkspacePage.vue:100


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 on lines +421 to +423
params.exclude_ids = "astrbot";
params.exclude_platforms = "webchat";
}

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.

issue (broader_impact): When an UMO filter is present, exclude_ids and exclude_platforms are omitted, so the conversation shortcut can show the default astrbot and webchat entries that were previously excluded.

Triggers: When the selected UMO belongs to the excluded bot or platform.

Suggested fix: Always include the default exclusions and add params.umo independently when a UMO filter is set.

Comment on lines +98 to +100
const umoQuery = ref(
typeof initialUmoQuery === "string" ? initialUmoQuery : "",
);

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.

issue (bug_risk): The UMO value is copied from the URL only during component setup, while later edits to umoQuery never update the URL; reloading after typing or changing the filter loses the filter, and navigating between conversation shortcuts while the component is reused leaves the old filter active.

Triggers: When the user types a UMO into the filter or navigates from one statistics shortcut to another without remounting the conversation page.

Suggested fix: Watch umoQuery and synchronize route.query.umo, and watch route query changes to update umoQuery when the router reuses the page component.

BegoniaHe pushed a commit to Xero-Team/AstrBot that referenced this pull request Aug 28, 2026
Link session token rankings to the conversation workspace with a UMO
query, and keep MDI icons instead of Lucide.

Upstream-Commit: d2d7e5a
Upstream-Author: Soulter <37870767+Soulter@users.noreply.github.com>
Upstream-PR: AstrBotDevs#9847
Sync-Disposition: adapt
Fork-Adaptation: Keep the Playwright T2I card and DataFilesPage /data route. Use MDI for the conversation shortcut and omit ru-RU locales.
Tested: cd dashboard && pnpm exec vue-tsc --noEmit && pnpm exec vitest run --config vitest.config.ts tests/statsPage.vitest.ts tests/viewDialogLayouts.vitest.ts
BegoniaHe added a commit to Xero-Team/AstrBot that referenced this pull request Aug 28, 2026
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:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant