Skip to content

fix(earthquake): localize and align report day headers - #575

Open
PiscesXD wants to merge 1 commit into
mainfrom
fix/earthquake-report-header
Open

PiscesXD wants to merge 1 commit into
mainfrom
fix/earthquake-report-header

Conversation

@PiscesXD

@PiscesXD PiscesXD commented Sep 14, 2026

Copy link
Copy Markdown
Member

這個 PR 做了什麼

  • 地震報告日期標題顯示完整日期、星期,以及「今天/昨天」相對標籤。
  • 日期標題禁止換行;中間分隔線會填滿剩餘寬度,當日筆數固定靠右對齊,避免不同手機寬度造成跑版。

怎麼驗

  • tool/dev/test.sh test/features/earthquake/report_day_group_test.dart
  • tool/dev/analyze.sh
  • tool/commit.sh(完整測試 1835 passed)
  • tool/check/commits.sh origin/main..HEAD
  • 確認使用 AppLocalizationsintl locale,沒有新增硬編碼語系文字

檢查清單

  • 一個 commit 一件事
  • 新的使用者可見文字支援 i18n
  • 使用既有 AppSpacing / AppRadius,並處理窄螢幕與寬螢幕排版

Fix(zh-Hant): 地震報告日期與筆數固定對齊
Fix(en-US): align earthquake report dates and counts consistently
@PiscesXD PiscesXD changed the title fix(earthquake): align report day headers fix(earthquake): localize and align report day headers Sep 14, 2026
@github-actions

github-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown

🔍 OpenCodeReview found 4 issue(s) in this PR.

  • ✅ Successfully posted inline: 4 comment(s)

Comment on lines +256 to 269
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

other · medium
佈局邏輯變動可能導致 UI 呈現不符合預期。原本使用 Flexible 搭配 Expanded (Divider),可以讓 Label 佔用所需空間並讓 Divider 填滿剩餘空間。現在將 Label 改為 Expanded,會導致 Label 與 Divider 平分剩餘空間,使得 Divider 的位置不再位於右側,而是移至畫面中間。若要兼顧防止溢出與正確佈局,建議改回 Flexible 並保留 FittedBox

Suggestion:

Suggested change
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),
Flexible(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),

Comment on lines +256 to 277
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),
),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
),
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

bug · medium
佈局邏輯變動:將原本用於標籤的 Flexible 改為 Expanded 會導致標籤與分隔線 (Divider) 平分剩餘空間,這會使分隔線不再位於右側,而是變成在畫面中間,這與原本「標籤 + 填充式分隔線」的 UI 設計不符。

Suggestion:

Suggested change
Expanded(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),
),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
),
),
Flexible(
child: FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
_dayLabel(day, l10n, locale),
softWrap: false,
style: theme.textTheme.titleSmall?.copyWith(
color: colors.primary,
fontWeight: FontWeight.w700,
),
),
),
),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: Divider(
height: 1,
thickness: 1,
color: colors.outlineVariant.withValues(alpha: 0.55),
),
),

Comment on lines +321 to +324
final date = _dayFormats
.putIfAbsent(locale, () => DateFormat.yMMMEd(locale))
.format(day);
return relative == null ? date : '$date ($relative)';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

other · medium
日期顯示順序與格式發生了變動:

  1. 顯示順序從 '$relative ($date)' (例如: 昨天 (9月13日)) 變更為 '$date ($relative)' (例如: 9月13日 (昨天))。
  2. 日期格式從 yMMMd 統一變更為 yMMMEd
    這屬於 UI/UX 邏輯的重大變更,請確認是否符合產品設計規範或使用者習慣。

Comment on lines +321 to +324
final date = _dayFormats
.putIfAbsent(locale, () => DateFormat.yMMMEd(locale))
.format(day);
return relative == null ? date : '$date ($relative)';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

other · low
日期顯示邏輯變動:相對日期的顯示順序從 '$relative ($date)' (例如: Yesterday (Jan 1, 2023)) 改為 '$date ($relative)' (例如: Jan 1, 2023 (Yesterday)),且日期格式由 yMMMd 變更為 yMMMEd。請確認此變更是否符合產品設計規格。

@lowrt lowrt added this to the v26.3 milestone Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants