Skip to content

fix: 对齐计算/对比按钮并强制补齐对比数据 - #5

Merged
OldCoderIsMe merged 1 commit into
mainfrom
feature/requirement-2-20261118-0323
Nov 18, 2026
Merged

OldCoderIsMe merged 1 commit into
mainfrom
feature/requirement-2-20261118-0323

Conversation

@OldCoderIsMe

Copy link
Copy Markdown
Owner

需求

  • “计算心率区间”与“对比三种方法”两个按钮不在同一水平线,需要对齐。
  • 使用对比功能时必须提示补齐年龄、最大心率、静息心率、乳酸阈值心率,不能使用默认数据。

变更

  • styles.css: .action-row 统一 margin-top:27px 与 align-items:stretch,.primary-button 改为 margin-top:0,两个按钮同一基线且等高。
  • index.html: 移除年龄/最大心率/静息心率/乳酸阈值心率四项默认值,改为 placeholder。
  • calculations.mjs: 新增 missingComparisonFields,统一判定对比所需字段。
  • app.js: 对比前校验四项数据;缺失时提示“请先填写…”,展开全部输入组并阻止渲染,避免用默认值对比。
  • tests/: 新增按钮对齐、默认值移除、缺失字段提示、输入面板展开覆盖。

验证

  • node --check app.js / node --check calculations.mjs 通过
  • npm test → 18/18 通过(0 失败)

说明

仓库未配置 Pipeline;目标分支 main。

- Move the 27px offset from .primary-button to .action-row and stretch
  both buttons so 计算我的训练区间 and 对比三种方法 share one baseline.
- Remove the four prefilled values (age/max HR/resting HR/LTHR) and use
  placeholders instead.
- Add missingComparisonFields and block comparison until age, max HR,
  resting HR and LTHR are all provided; reveal every input group so the
  missing fields can actually be filled.
- Cover alignment, default removal and missing-data prompting in tests.
@OldCoderIsMe
OldCoderIsMe merged commit e6c27b6 into main Nov 18, 2026
2 checks passed
@OldCoderIsMe
OldCoderIsMe deleted the feature/requirement-2-20261118-0323 branch November 18, 2026 11:56
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.

1 participant