docs: add pre-commit setup guide to AGENTS.md#7838
docs: add pre-commit setup guide to AGENTS.md#7838Soulter merged 2 commits intoAstrBotDevs:masterfrom
Conversation
…n WebUI - CommandTable.vue: add :title binding to description div - ToolTable.vue: add :title binding to description and origin_name divs Fixes AstrBotDevs#7583 - Webui中超出显示长度的指令描述无法以任何方式看到
Extract the pre-commit and ruff setup instructions from README.md into AGENTS.md so AI agents have a complete reference for setting up the development environment.
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- When binding
:titletoitem.description/item.origin_name, consider falling back to an empty string (or the same'-'placeholder) to avoid showingundefined/nullin the tooltip when these fields are missing.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- When binding `:title` to `item.description` / `item.origin_name`, consider falling back to an empty string (or the same `'-'` placeholder) to avoid showing `undefined`/`null` in the tooltip when these fields are missing.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request adds documentation for setting up pre-commit hooks using Ruff and improves the dashboard UI by adding title attributes for tooltips on truncated text. The review feedback suggests using uv for tool installation and execution to maintain consistency with the project's environment management. Furthermore, it is recommended to utilize the Vuetify text-truncate utility class instead of manual CSS styles for text overflow handling in the Vue components.
| pip install pre-commit | ||
| pre-commit install |
There was a problem hiding this comment.
Since the project uses uv for environment management (as seen in the Setup commands section), it is more consistent to use uv for tool installation. This ensures that tools are managed in a way that's compatible with the rest of the setup and avoids potential conflicts with system-wide pip installations.
| pip install pre-commit | |
| pre-commit install | |
| uv tool install pre-commit | |
| pre-commit install |
| ruff format . | ||
| ruff check . |
|
|
||
| <template v-slot:item.description="{ item }"> | ||
| <div class="text-body-2 text-medium-emphasis" style="max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> | ||
| <div class="text-body-2 text-medium-emphasis" style="max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" :title="item.description"> |
There was a problem hiding this comment.
Vuetify provides a utility class text-truncate that handles overflow, text-overflow, and white-space properties. Using it makes the code cleaner and adheres to the principle of avoiding duplicated logic/styles.
<div class="text-body-2 text-medium-emphasis text-truncate" style="max-width: 280px;" :title="item.description">
References
- When implementing similar functionality for different cases, refactor the logic into a shared helper (or in this case, a shared CSS class) to avoid code duplication.
|
|
||
| <template #item.description="{ item }"> | ||
| <div class="text-body-2 text-medium-emphasis" style="max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> | ||
| <div class="text-body-2 text-medium-emphasis" style="max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" :title="item.description"> |
There was a problem hiding this comment.
Consider using the Vuetify utility class text-truncate instead of hardcoding the ellipsis styles. This improves maintainability by using shared framework utilities.
<div class="text-body-2 text-medium-emphasis text-truncate" style="max-width: 320px;" :title="item.description">
References
- Refactor similar logic/styles into shared utilities to avoid code duplication.
|
|
||
| <template #item.origin_name="{ item }"> | ||
| <div class="text-body-2 text-medium-emphasis" style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"> | ||
| <div class="text-body-2 text-medium-emphasis" style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" :title="item.origin_name"> |
There was a problem hiding this comment.
Consider using the Vuetify utility class text-truncate instead of hardcoding the ellipsis styles.
<div class="text-body-2 text-medium-emphasis text-truncate" style="max-width: 200px;" :title="item.origin_name">
References
- Refactor similar logic/styles into shared utilities to avoid code duplication.
* fix(dashboard): add tooltip for truncated command/tool descriptions in WebUI - CommandTable.vue: add :title binding to description div - ToolTable.vue: add :title binding to description and origin_name divs Fixes #7583 - Webui中超出显示长度的指令描述无法以任何方式看到 * docs: add pre-commit setup guide to AGENTS.md Extract the pre-commit and ruff setup instructions from README.md into AGENTS.md so AI agents have a complete reference for setting up the development environment. --------- Co-authored-by: AstrBot Fixer <astrbot@fix-bot.local> Co-authored-by: AstrBot Fixer <astrbot-fixer@users.noreply.github.com>
Summary
Extracts the pre-commit and ruff setup instructions from
README.mdintoAGENTS.mdso that AI agents have a complete reference for setting up the development environment without needing to read the full README.Changes
AGENTS.md## Pre-commit setupsection between## Setup commandsand## Dev environment tipsThe new section covers:
.pre-commit-config.yamlpip install pre-commit && pre-commit install)ruff format .andruff check .)Related
Content sourced from
README.md(Development Environment section) andCONTRIBUTING.md.Summary by Sourcery
Document pre-commit and Ruff setup for AI agents and improve dashboard tool/command tables usability by exposing full text via hover titles.
Enhancements:
Documentation: