Skip to content

fix: add touch device detection for menu interaction - #9782

Open
mantoujun12 wants to merge 3 commits into
AstrBotDevs:masterfrom
mantoujun12:fix/9781
Open

fix: add touch device detection for menu interaction#9782
mantoujun12 wants to merge 3 commits into
AstrBotDevs:masterfrom
mantoujun12:fix/9781

Conversation

@mantoujun12

@mantoujun12 mantoujun12 commented Aug 23, 2026

Copy link
Copy Markdown

Modifications / 改动点

Fixes #9781

AstrBot Web UIChat UI 的“通信传输模式” 和“语言”,添加了 open-on-click 的额外条件,通过 isTouchDevice 来判断是否启用
并添加了 isTouchDevice ,通过多重条件判断用户是否为移动设备 (可优化)

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

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

Before / 改动前

Screenshot_2026-08-23-11-52-30-071_mark via

After / 改动后

Screenshot_2026-08-23-11-52-21-095_mark via

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

Improve Chat UI menu accessibility across desktop and touch devices by supporting click-based expansion on touchscreens.

Bug Fixes:

  • Enable the Transport Mode and Language menus to open by click on touch devices, fixing inaccessible secondary menus on mobile.

Enhancements:

  • Preserve hover-based menu behavior while adding touch-device support for the Chat UI menus.

Summary by Sourcery

Improve Chat UI menu interaction across touch and desktop devices by enabling click-based expansion when touch input is detected.

Bug Fixes:

  • Enable the Chat UI’s Transport Mode and Language menus to open by click on touch devices, making their options accessible on mobile and touchscreen interfaces.

Enhancements:

  • Preserve hover-based menu interaction while adding touch-device detection for click-based expansion.

Removed the open-on-hover of the Chat UI part of the AstrBot Web UI, and fixed the issue that the mobile end could not open the secondary menu of Transport Mode and Language.
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. area:webui The bug / feature is about webui(dashboard) of astrbot. feature:chatui The bug / feature is about astrbot's chatui, webchat labels Aug 23, 2026

@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 reviewed your changes and they look great!

Sourcery assessment

Approved.


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 size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Aug 24, 2026
@mantoujun12

Copy link
Copy Markdown
Author

@sourcery-ai review

@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 reviewed your changes and they look great!

Sourcery assessment

Approved.


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.

@mantoujun12 mantoujun12 changed the title fix: remove open-on-hover attribute from menu components fix: add touch device detection for menu interaction Aug 24, 2026
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Aug 24, 2026
@mantoujun12

Copy link
Copy Markdown
Author

@sourcery-ai review

@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 reviewed your changes and they look great!

Sourcery assessment

Approved.


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.

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:chatui The bug / feature is about astrbot's chatui, webchat size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 移动端 Web UI 打开 Chat UI ,选项无法正常弹出二级菜单

1 participant