Skip to content

fix(dashboard): add mobile adaptation for persona selection interface#5907

Open
letr007 wants to merge 1 commit intoAstrBotDevs:masterfrom
letr007:fix/default-persona-selector-mobile-layout
Open

fix(dashboard): add mobile adaptation for persona selection interface#5907
letr007 wants to merge 1 commit intoAstrBotDevs:masterfrom
letr007:fix/default-persona-selector-mobile-layout

Conversation

@letr007
Copy link
Contributor

@letr007 letr007 commented Mar 8, 2026

Modifications / 改动点

  • 仅修改 dashboard/src/components/folder/BaseFolderItemSelector.vue,解决“配置 -> 默认人格 -> 选择人格”弹窗在移动端超宽的问题。

  • 对话框宽度改为小屏自适应:小屏限制 max-width,并取消小屏下固定 min-width=800px,避免横向溢出。

  • 将内容区内联高度样式提取为类并补充小屏滚动约束,确保内容可浏览且按钮区可操作。

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

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

修复前:
image
修复后:
image


Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ 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.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

改进角色选择对话框的布局,使其在小屏幕上具有响应式表现,并避免出现水平溢出。

Bug Fixes:

  • 通过调整对话框的宽度和内容布局以适配紧凑显示,修复角色选择对话框在移动端视口中的溢出问题。

Enhancements:

  • 根据 Vuetify 的断点调整对话框的尺寸和间距,以更好地适配紧凑布局,同时保持桌面端行为不变。
  • 引入更适合移动设备的文件夹导航栏和滚动约束,确保在小屏幕上文件夹列表和操作按钮始终可访问。
Original summary in English

Summary by Sourcery

Improve the persona selection dialog layout to be responsive on smaller screens and avoid horizontal overflow.

Bug Fixes:

  • Fix mobile viewport overflow of the persona selection dialog by adapting its width and content layout for compact displays.

Enhancements:

  • Adjust dialog sizing and spacing based on Vuetify breakpoint to better fit compact layouts while keeping desktop behaviour unchanged.
  • Introduce a mobile-friendly folder navigation bar and scrolling constraints so folder lists and action buttons remain accessible on small screens.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 8, 2026
@gemini-code-assist
Copy link
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!

此拉取请求旨在增强仪表盘中人格选择界面的移动端适配性。通过调整对话框的宽度逻辑、优化内容区域的滚动行为以及引入专门的移动端导航元素,确保了在小屏幕设备上,用户能够流畅地选择人格,避免了界面元素溢出和操作不便的问题,显著提升了移动端的用户体验。

Highlights

  • 移动端适配: 解决了“配置 -> 默认人格 -> 选择人格”弹窗在移动端显示过宽的问题,优化了用户体验。
  • 对话框宽度自适应: 对话框宽度现在能根据屏幕大小自适应,小屏设备上限制了最大宽度并移除了固定最小宽度,以避免内容横向溢出。
  • 内容区样式优化: 将内容区的内联高度样式提取为独立类,并增加了小屏滚动约束,确保内容在小屏设备上可滚动浏览且交互按钮可用。
  • 移动端文件夹导航: 为紧凑布局(移动端)新增了移动端文件夹导航栏,包含返回上一级和返回根目录的按钮,并显示当前文件夹名称。
Changelog
  • dashboard/src/components/folder/BaseFolderItemSelector.vue
    • 调整了 v-dialog 组件的 max-widthmin-width 属性,使其在紧凑布局下能够自适应屏幕宽度。
    • 更新了 v-card-title 的内边距,以适应紧凑布局。
    • 在紧凑布局下,隐藏了左侧的文件夹侧边栏。
    • 为紧凑布局添加了新的移动端文件夹导航栏,包括返回按钮、根目录按钮和当前文件夹标签。
    • 新增了 isCompactLayout 计算属性,用于判断当前是否为紧凑布局(小屏幕)。
    • 新增了 currentFolderLabel 计算属性,用于获取当前文件夹的显示名称。
    • 新增了 navigateToParentFolder 方法,用于在文件夹层级中向上导航。
    • 将内容区的内联高度样式提取到 .selector-content 类中,并增加了 min-width: 0.selector-layout.items-content
    • 更新了媒体查询的断点从 600px960px,并调整了 selector-layoutselector-contentitems-list 的样式。
    • breadcrumb-bar 添加了 overflow-x: autoflex-wrap: nowrap,以优化移动端面包屑导航的显示。
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.

Copy link
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 - 我发现了 1 个问题,并留下了一些整体性的反馈:

  • selector 内容仍然使用了硬编码的高度(例如 600px、80vh、76vh);建议仅依赖响应式的最大高度(max-height)和元素自身尺寸,从而避免在某些边缘视口尺寸或横屏手机上出现尴尬的裁切效果。
  • 你在混用 Vuetify 的 smAndDown 断点逻辑和原生的 @media (max-width: 960px) 媒体查询;为了在断点发生变化时避免出现细微的布局不一致,可能更可维护的做法是让所有响应式行为都基于同一个断点来源来派生。
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The selector content still uses hard-coded heights (e.g. 600px, 80vh, 76vh); consider relying solely on responsive max-heights and intrinsic sizing to avoid awkward clipping on edge-case viewport sizes or landscape mobile.
- You’re mixing Vuetify’s `smAndDown` breakpoint logic with a raw `@media (max-width: 960px)` query; it might be more maintainable to derive all responsive behavior from the same breakpoint source to avoid subtle layout mismatches if breakpoints change.

## Individual Comments

### Comment 1
<location path="dashboard/src/components/folder/BaseFolderItemSelector.vue" line_range="266-267" />
<code_context>
         };
     },
     computed: {
+        isCompactLayout(): boolean {
+            return this.$vuetify.display.smAndDown;
+        },
+
</code_context>
<issue_to_address>
**issue (bug_risk):** Align the JS `isCompactLayout` breakpoint with the CSS media query to avoid inconsistent layouts.

`isCompactLayout` uses `this.$vuetify.display.smAndDown` (~600px), but the CSS compact styles start at `@media (max-width: 960px)`. Between 600–960px, compact CSS applies while `isCompactLayout` is `false`, so the template still renders the desktop variant. Please align the breakpoint (e.g. use `mdAndDown` or change the media query to 600px) so template logic and styles stay in sync.
</issue_to_address>

Sourcery 对开源项目是免费的 —— 如果你觉得我们的评审有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈改进后续评审。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • The selector content still uses hard-coded heights (e.g. 600px, 80vh, 76vh); consider relying solely on responsive max-heights and intrinsic sizing to avoid awkward clipping on edge-case viewport sizes or landscape mobile.
  • You’re mixing Vuetify’s smAndDown breakpoint logic with a raw @media (max-width: 960px) query; it might be more maintainable to derive all responsive behavior from the same breakpoint source to avoid subtle layout mismatches if breakpoints change.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The selector content still uses hard-coded heights (e.g. 600px, 80vh, 76vh); consider relying solely on responsive max-heights and intrinsic sizing to avoid awkward clipping on edge-case viewport sizes or landscape mobile.
- You’re mixing Vuetify’s `smAndDown` breakpoint logic with a raw `@media (max-width: 960px)` query; it might be more maintainable to derive all responsive behavior from the same breakpoint source to avoid subtle layout mismatches if breakpoints change.

## Individual Comments

### Comment 1
<location path="dashboard/src/components/folder/BaseFolderItemSelector.vue" line_range="266-267" />
<code_context>
         };
     },
     computed: {
+        isCompactLayout(): boolean {
+            return this.$vuetify.display.smAndDown;
+        },
+
</code_context>
<issue_to_address>
**issue (bug_risk):** Align the JS `isCompactLayout` breakpoint with the CSS media query to avoid inconsistent layouts.

`isCompactLayout` uses `this.$vuetify.display.smAndDown` (~600px), but the CSS compact styles start at `@media (max-width: 960px)`. Between 600–960px, compact CSS applies while `isCompactLayout` is `false`, so the template still renders the desktop variant. Please align the breakpoint (e.g. use `mdAndDown` or change the media query to 600px) so template logic and styles stay in sync.
</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.

@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 8, 2026
Copy link
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 旨在为角色选择界面添加移动端适配,解决其在小屏幕上的显示问题。整体改动实现良好,通过使用 isCompactLayout 计算属性和动态绑定 Vuetify 组件的 props,成功实现了响应式布局。将内联样式提取到 CSS 类中也提升了代码的可维护性。

我提出了一些关于代码简化和遵循 DRY 原则的建议,以进一步提高代码质量。除此之外,代码改动方向正确,有效地解决了移动端适配的问题。

@letr007
Copy link
Contributor Author

letr007 commented Mar 8, 2026

感谢 Sourcery 的整体建议。关于固定高度(600px/80vh/76vh)这一点,我们认可其优化价值,但当前实现用于保证列表滚动和底部操作区可达,且本次优先处理已复现的移动端超宽问题。后续我们会单独评估进一步弱化固定高度、改为更纯粹的自适应高度策略。

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: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