支持动态增删天体输入行#14
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
该 PR 主要为“天体输入表格”补齐动态增删/重编号能力,并在 UI 上提示当前标记数量与识别按钮可用状态,同时通过 data-raw-value 保留坐标与 HA/Dec 的原始精度与更顺畅的键盘交互。
Changes:
- 天体表格行支持动态添加/删除/重编号,并保留至少 3 行输入(含删除按钮与“添加天体”按钮)
- 增加“已标记天体数量”状态提示,且在不足 3 个时对识别按钮呈现禁用态提示
- 通过
dataset.rawValue保留输入与显示值的原始精度;优化自动补全对 Tab/Shift+Tab 的行为
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/interface/utils.js | 通过 dataset.rawValue 保留/还原 HA/Dec 与坐标的原始精度,新增格式化/比较辅助函数 |
| src/interface/init.js | 初始化事件时改为由 CeleArray 统一绑定表格行与自动补全,并新增“添加天体”按钮事件 |
| src/interface/functions/PickCele.js | 点击取点时不再强制将坐标四舍五入到两位小数(配合 rawValue 保真) |
| src/interface/functions/CeleRecognition.js | 识别流程改为可取消的 isRecognizing 状态,并在不足 3 个标记时给出提示 |
| src/interface/functions/AutoComplete.js | Tab/Shift+Tab 在天体名称输入框间切换焦点(不再在补全项中移动) |
| src/interface/elements/CelestialBody.js | CeleArray 接管表格行增删/绑定/重编号与数据迁移,最少保留 3 行 |
| src/interface/classes/interact.js | 新增天体数量提示与识别按钮禁用态更新逻辑 |
| src/index.html | 表格新增“操作”列、删除按钮和“添加天体”按钮;信息栏布局调整并新增 celeStatus |
| src/css/site.css | 新增表格列宽/按钮/信息栏布局样式及禁用态样式修正 |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+111
to
+116
| document.getElementById('addCeleRow').addEventListener('click', () => { | ||
| interactPhoto.CeleArray.addEmptyRow(); | ||
| }); | ||
|
|
||
| //为星体名称输入框启用自动补全 | ||
| for (let i = 1; i <= 5; i++) { | ||
| autoCompleteStarName(document.getElementById(`name${i}`)); | ||
| } | ||
| interactPhoto.CeleArray.initializeTableRows(); |
|
|
||
| removeTableRow(id) { | ||
| if (id <= this.num()) { | ||
| this.array[id - 1].remove(); |
Comment on lines
+77
to
+78
| recognizeButton.classList.toggle('is-disabled', count < 3); | ||
| recognizeButton.setAttribute('aria-disabled', count < 3 ? 'true' : 'false'); |
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.
Summary