Skip to content

支持动态增删天体输入行#14

Merged
cheanus merged 1 commit into
mainfrom
drag_upload
May 8, 2026
Merged

支持动态增删天体输入行#14
cheanus merged 1 commit into
mainfrom
drag_upload

Conversation

@wlbksy

@wlbksy wlbksy commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • 支持天体输入表格动态添加、删除和重新编号,保留至少 3 行输入。
  • 增加天体标记数量提示,并在不足 3 个标记时禁用识别按钮状态提示。
  • 保留坐标与时角/赤纬原始精度,同时优化表格、信息栏和自动补全键盘交互。

@wlbksy wlbksy requested a review from Copilot May 7, 2026 05:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread src/interface/init.js
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');
@cheanus cheanus merged commit c77b130 into main May 8, 2026
1 check passed
@wlbksy wlbksy deleted the drag_upload branch May 9, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants