Skip to content

Conversation

@imoscarz
Copy link
Contributor

  1. 功能:添加四年成绩显示逻辑与标签,优化成绩卡片展示(commit ad6b896
    1. 四年总分在四年数据不完整(sportScore.value.list.length < 4)时不显示“不合格”而是显示“未知”
    2. 更新了体育成绩卡片的UI展示。
  2. 文档:修复了README.md错误对齐的问题(commit c37009c
image

Copilot AI review requested due to automatic review settings January 18, 2026 09:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the sports score query interface with improved UI presentation and conditional logic for incomplete data. The changes focus on making the score display more informative and visually polished.

Changes:

  • Added logic to display "Unknown" rank instead of "Unqualified" when four-year score data is incomplete (less than 4 records)
  • Redesigned score card UI with labeled containers for total score and rank using color-coded backgrounds
  • Added i18n support for new "Total Score" and "Rank" labels across three languages (English, Simplified Chinese, Traditional Chinese)
  • Fixed formatting issues in README.md and configuration files

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/page/sport/sport_score_window.dart Core logic and UI changes for sports score display, including new helper methods and restructured card layouts
assets/flutter_i18n/zh_CN.yaml Added Simplified Chinese translations for "total_score_label" and "rank_label"
assets/flutter_i18n/zh_TW.yaml Added Traditional Chinese translations for "total_score_label" and "rank_label"
assets/flutter_i18n/en_US.yaml Added English translations for "total_score_label" and "rank_label"
README.md Removed misaligned align="middle" attributes and added missing closing </div> tag
.vscode/settings.json Removed trailing comma in JSON configuration
.gitignore Changed .fvm/flutter_sdk to .fvm/ to ignore entire fvm directory

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

};
}

bool isQualified = !sportScore.value.rank.contains("不");
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

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

The logic for determining if a score is qualified uses string matching with contains("不") (checking if the rank contains the Chinese character for "not"). This approach is fragile and not internationalized. If the application supports multiple languages (which it does based on the i18n files), this logic will break when the UI language is not Chinese. Consider using a more robust method such as checking against an enum or constant value, or parsing the rank field in a language-independent way.

Copilot uses AI. Check for mistakes.
Comment on lines 230 to 232
/// 获取单年成绩的显示颜色和背景
Map<String, dynamic> _getScoreDisplayInfo() {
bool isQualified = !toUse.rank.contains("不");
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

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

The same internationalization issue exists here. The logic uses contains("不") to determine qualification status, which will fail when the application is in English or Traditional Chinese mode. This duplicates the same problematic pattern from the total score method. Consider extracting this logic into a shared helper method that uses a language-independent approach.

Suggested change
/// 获取单年成绩的显示颜色和背景
Map<String, dynamic> _getScoreDisplayInfo() {
bool isQualified = !toUse.rank.contains("不");
/// 判断成绩是否合格(语言无关的辅助方法)
bool _isQualifiedRank(String rank) {
final normalized = rank.toLowerCase();
// Keywords indicating an unqualified / failed result in various locales.
const unqualifiedKeywords = <String>[
'不', // Simplified/Traditional Chinese "not" as in "不合格"
'fail',
'failed',
'unqualified',
];
for (final keyword in unqualifiedKeywords) {
if (normalized.contains(keyword)) {
return false;
}
}
return true;
}
/// 获取单年成绩的显示颜色和背景
Map<String, dynamic> _getScoreDisplayInfo() {
bool isQualified = _isQualifiedRank(toUse.rank);

Copilot uses AI. Check for mistakes.
@BenderBlog
Copy link
Owner

卡片最上面,成绩总体信息请重新设计一下。当前设计不太紧凑。

@imoscarz
Copy link
Contributor Author

卡片最上面,成绩总体信息请重新设计一下。当前设计不太紧凑。

将分学期展示的调整为了在标题栏中的样式,四年总分将label和数据放在了同一行

此外,为Windows平台设置了最小宽度像素和最小高度像素以防止过度压缩导致布局崩溃。

image

@BenderBlog
Copy link
Owner

可以了,我等写完一个功能后合并。

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.

2 participants