-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
style(ui): 美化机器人卡片,优化响应式布局 #4199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ocetars
wants to merge
3
commits into
AstrBotDevs:master
Choose a base branch
from
ocetars:feature/ui
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - 我发现了 1 个问题,并且给出了一些整体性的反馈:
- 重新设计的 ItemCard 使用了多处行内样式(例如 opacity、gaps、min-width),这些可以考虑迁移到局部作用域的 CSS 类中,方便主题定制和后续维护,尤其是在其他卡片也会采用类似布局模式的情况下。
- 当前对左侧内容区域整体使用透明度变化来表示条目被禁用,这可能会影响文本可读性;可以考虑使用更有针对性的视觉标识(例如只弱化 logo,或使用更柔和的背景)来在保留文本对比度的同时体现禁用状态。
- 新的 item-grid 为卡片使用了硬编码的边框颜色和最小宽度;可以考虑引用 Vuetify/主题变量或共享布局 token,这样在整体设计系统调整时,卡片的外观仍能保持一致。
给 AI 代理的提示
Please address the comments from this code review:
## Overall Comments
- The redesigned ItemCard uses several inline styles (e.g., opacity, gaps, min-width) that could be moved into scoped CSS classes for easier theming and maintenance, especially if other cards will adopt similar layout patterns.
- The opacity change applied to the entire left content area when an item is disabled may impact text readability; consider using a more targeted visual indicator (e.g., dimming only the logo or using a subtle background) to preserve contrast for text.
- The new item-grid uses a hard-coded border color and min-width for cards; consider referencing Vuetify/theme variables or shared layout tokens so card appearance stays consistent if the overall design system changes.
## Individual Comments
### Comment 1
<location> `dashboard/src/components/shared/ItemCard.vue:5` </location>
<code_context>
+ <v-card class="item-card hover-elevation pa-4" elevation="0">
+ <div class="d-flex flex-row fill-height">
+ <!-- Left Content -->
+ <div class="d-flex flex-column flex-grow-1" :style="{ position: 'relative', overflow: 'hidden', opacity: getItemEnabled() ? 1 : 0.6 }">
+ <div class="text-h4 font-weight-bold mb-2" :title="getItemTitle()">
+ {{ getItemTitle() }}
</code_context>
<issue_to_address>
**issue (bug_risk):** Applying opacity to the entire left column may create low-contrast text for disabled items.
`opacity: 0.6` on the entire column will reduce contrast for all text and controls and can drop below accessibility guidelines, especially for smaller fonts. Prefer a more targeted disabled styling (e.g., use different text color tokens or only dim decorative elements like the logo) so primary text stays high contrast while still indicating the disabled state.
</issue_to_address>帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码评审。
Original comment in English
Hey - I've found 1 issue, and left some high level feedback:
- The redesigned ItemCard uses several inline styles (e.g., opacity, gaps, min-width) that could be moved into scoped CSS classes for easier theming and maintenance, especially if other cards will adopt similar layout patterns.
- The opacity change applied to the entire left content area when an item is disabled may impact text readability; consider using a more targeted visual indicator (e.g., dimming only the logo or using a subtle background) to preserve contrast for text.
- The new item-grid uses a hard-coded border color and min-width for cards; consider referencing Vuetify/theme variables or shared layout tokens so card appearance stays consistent if the overall design system changes.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The redesigned ItemCard uses several inline styles (e.g., opacity, gaps, min-width) that could be moved into scoped CSS classes for easier theming and maintenance, especially if other cards will adopt similar layout patterns.
- The opacity change applied to the entire left content area when an item is disabled may impact text readability; consider using a more targeted visual indicator (e.g., dimming only the logo or using a subtle background) to preserve contrast for text.
- The new item-grid uses a hard-coded border color and min-width for cards; consider referencing Vuetify/theme variables or shared layout tokens so card appearance stays consistent if the overall design system changes.
## Individual Comments
### Comment 1
<location> `dashboard/src/components/shared/ItemCard.vue:5` </location>
<code_context>
+ <v-card class="item-card hover-elevation pa-4" elevation="0">
+ <div class="d-flex flex-row fill-height">
+ <!-- Left Content -->
+ <div class="d-flex flex-column flex-grow-1" :style="{ position: 'relative', overflow: 'hidden', opacity: getItemEnabled() ? 1 : 0.6 }">
+ <div class="text-h4 font-weight-bold mb-2" :title="getItemTitle()">
+ {{ getItemTitle() }}
</code_context>
<issue_to_address>
**issue (bug_risk):** Applying opacity to the entire left column may create low-contrast text for disabled items.
`opacity: 0.6` on the entire column will reduce contrast for all text and controls and can drop below accessibility guidelines, especially for smaller fonts. Prefer a more targeted disabled styling (e.g., use different text color tokens or only dim decorative elements like the logo) so primary text stays high contrast while still indicating the disabled state.
</issue_to_address>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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
先前的机器人适配器卡片视觉利用率较低,多数情况下留白过多
Modifications / 改动点
重构机器人卡片 ItemCard 布局并实现响应式网格显示
Screenshots or Test Results / 运行截图或测试结果
正常状态 UI
2025-12-25.17-41-12.mp4
异常状态 UI
2025-12-26.17-36-31.mp4
Checklist / 检查清单
requirements.txt和pyproject.toml文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations inrequirements.txtandpyproject.toml.Summary by Sourcery
重构共享的 ItemCard 组件布局,并将平台列表页面更新为更紧凑的网格卡片布局。
增强内容:
Original summary in English
Summary by Sourcery
Refactor the shared ItemCard component layout and update the platform listing page to use a denser, grid-based card layout.
Enhancements:
增强内容:
Original summary in English
Summary by Sourcery
重构共享的 ItemCard 组件布局,并将平台列表页面更新为更紧凑的网格卡片布局。
增强内容:
Original summary in English
Summary by Sourcery
Refactor the shared ItemCard component layout and update the platform listing page to use a denser, grid-based card layout.
Enhancements: