Dev tool#1606
Open
LGG686 wants to merge 6 commits into
Open
Conversation
added 6 commits
June 1, 2026 22:41
- 浏览器输入url:port/tool/annotator访问 - 在app.py中添加了tool_router模块导入和路由注册 - 配置了标注器静态资源目录挂载到/tool/annotator/static路径 - 更新assets_extract.py优化规则资产提取逻辑,避免空数据处理 - 修改assets_test.py增加图像尺寸检查选项和详细检测功能 - 新增base.css和center-panel.css样式文件实现标注器界面
- 实现组件任务特定的 assets.py 提取路径解析功能 - 根据生成状态动态显示保存结果消息 - 添加 assets.py 文件路径信息到保存成功提示 - 在生成失败时显示目标文件路径信息 - 改进日志记录以包含资产文件路径详情
- 调整了模块导入顺序以提高代码可读性 - 将相关依赖按功能分组整理 - 优化了 starlette 和 fastapi 模块的导入位置 - 统一了配置和路由模块的引入顺序 - 移动了静态文件服务模块到合适位置 - 更新了状态管理器的导入路径
- 移除硬编码的规则类型常量,改为动态加载规则模式 - 添加规则架构定义文件,支持可配置的字段类型和验证 - 实现动态表单渲染,根据规则类型显示相应字段 - 创建字段默认值管理系统和字段类型验证 - 添加API端点用于获取规则架构信息 - 实现规则类型切换时的动态表单更新 - 重构规则编辑界面,使用动态字段替换静态HTML - 添加列表元数据的动态字段支持 - 实现规则字段的运行时验证和默认值填充 - 更新后端工具类以使用新的规则架构系统
- 搜索对大小写不敏感, 支持模糊搜索 - 在状态管理中添加 ruleSearchKeyword 属性用于存储搜索关键词 - 添加 ruleSearchBox 和 ruleSearchInput DOM 元素引用 - 修改 buildRuleItem 函数支持显示序号参数 - 添加 buildRuleListEmptyState 函数创建空状态提示 - 实现 getVisibleRuleEntries 函数过滤可见规则项 - 更新 renderRuleList 函数支持搜索过滤和重新排序 - 添加 hasLoadedRuleSource 和 getNormalizedRuleSearchKeyword 辅助函数 - 实现 resetRuleSearch 和 updateRuleSearchVisibility 控制搜索框显隐 - 为搜索输入框添加事件监听器实现实时搜索 - 添加 rule-search-box 和 rule-list-empty 样式类 - 在 HTML 中添加搜索框结构并默认隐藏 - 移除 tool.py 中的日志配置代码
- 修改script_router.py中的WebSocket消息发送方式,使用send_json替代broadcast_state - 在script_router.py中添加异常处理,捕获WebSocket连接过程中的异常 - 重构script_websocket.py中的连接管理逻辑,增加连接状态检查和安全断开机制 - 实现统一的消息发送和广播方法,提高代码复用性 - 在config/utils.py中将print语句替换为logger调试信息 - 统一配置文件读写的日志记录方式,使用logger替代print输出
There was a problem hiding this comment.
Sorry @LGG686, your pull request is larger than the review limit of 150000 diff characters
Findings
Warning
|
Change Summary
Reconstructed Intent点击此处展开- 这次改动最可能是为了把原先分散/手工的规则标注流程收敛成一个可视化开发工具,并直接接入现有 `tasks/*` 规则文件与 `assets.py` 生成链路。 - 次级 intent 看起来是提升调试闭环效率:在同一 UI 内完成“取图 -> 画 ROI -> 测试匹配 -> 保存规则 -> 生成资产”。 - 对 websocket 与日志的改动更像是为该工具运行过程提供更稳定的连接行为和更可控的日志输出,而非业务功能变更本身。Observed Constraints点击此处展开- 路径安全强依赖:所有写入都要求在 `tasks/` 与会话目录内,且 `json_relpath` 必须相对路径、后缀必须 `.json`。 - 数据模型约束强依赖:`rule_type`/`mode`/`direction`/`type` 必须命中 schema 选项;ROI 必须是 `x,y,w,h` 且宽高>0。 - 会话模型有隐含边界:`create_session` 会替换并清理其他 active session 与目录,工具语义更接近“单活会话”。 - 资产生成是“保存后的副作用”:规则保存成功不代表资产生成一定成功(返回 `partial_success`),发布侧需接受“规则已写入但资产未更新”的中间态。 - 前端运行依赖新增静态挂载 `/tool/annotator/static` 与按顺序加载 `layout-ui.js -> app.js`。Intent Alignment
Release Risk
Validation Gaps点击此处展开- 未看到针对 `/tool/annotator` 关键 API 的系统化验证证据(尤其是 session 生命周期、异常码、路径校验失败分支)。 - 未看到“保存成功但资产生成失败(partial_success)”在前端交互层的明确回归验证(是否能阻断发布或给出可执行修复路径)。 - 未看到多会话/多页面并发场景验证:创建新会话是否会意外清理正在工作的旧会话。 - 未看到对 `list` 类型规则(`list_meta` + item 列表)完整 round-trip(加载->编辑->测试->保存->再加载)验证记录。Warning
|
Contributor
Author
Owner
|
可以,明天有空看看 |
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
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.
@AzurTian 开发的非常好用的工具
部署后浏览器输入url:port/tool/annotator访问