Skip to content

fix: 重建 WuHan-2020 新冠救援信息平台前台页面以开放数据存档 - #103

Open
42104 wants to merge 1 commit into
Open-Source-Bazaar:mainfrom
42104:fix/issue-99
Open

fix: 重建 WuHan-2020 新冠救援信息平台前台页面以开放数据存档#103
42104 wants to merge 1 commit into
Open-Source-Bazaar:mainfrom
42104:fix/issue-99

Conversation

@42104

@42104 42104 commented Jul 31, 2026

Copy link
Copy Markdown

PR-103 PR-103 PR-103 Powered by Pull Request Badge

修复 Issue #99

Issue 标题: 重建 WuHan-2020 新冠救援信息平台前台页面以开放数据存档
平台: GITHUB
仓库: Open-Source-Bazaar/Open-Source-Bazaar.github.io

修复方案:
Inspect the existing Next.js pages/components and the referenced Wuhan-2020 WebApp. Implement a focused archival frontend page inside this repository using the existing design system, reuse available public/open data sources or clearly documented local archival data fixtures, add navigation, responsive states, and the most relevant tests/build validation. Keep scope to a coherent MVP that directly addresses issue #99 and does not replace unrelated site sections.

修改文件:

  • components/Navigator/MainNavigator.tsx
  • translation/en-US.ts
  • translation/zh-CN.ts
  • translation/zh-TW.ts
  • models/Wuhan2020.ts
  • pages/wuhan2020.tsx
  • styles/Wuhan2020.module.less

自动化流水线:

  • Writer: Claude Code
  • Verifier/Committer: claude_code(测试与审核通过后提交)
  • AI 分析模型: manual-canary-selection
  • 置信度: 72.0%

此 PR 由 Bounty Hunter 自动生成

Summary by CodeRabbit

  • 新功能
    • 新增“武汉2020”专题页面,并可从顶部导航进入。
    • 展示救援记录、分类统计和事件时间线,支持按类别筛选及关键词搜索。
    • 救援卡片提供地点、电话、链接、创建时间和验证标记等信息。
    • 无搜索结果时提供清晰提示及重置筛选选项,并适配不同屏幕尺寸。

@dosubot

dosubot Bot commented Jul 31, 2026

Copy link
Copy Markdown

📄 Knowledge review

Dosu skipped reviewing this PR because your organization has used its 200 included credits for the month. Your usage will reset on 2026-08-01. To have Dosu review this PR before then, ask your organization admin to upgrade to a pro account.


Leave Feedback Ask Dosu about Open-Source-Bazaar.github.io Add Dosu to your team

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

武汉2020救援信息归档

Layer / File(s) Summary
救援数据模型与查询函数
models/Wuhan2020.ts
定义六类救援记录、类别元数据和标签映射,并提供分类筛选、省份提取及统计计算函数。
归档页面筛选与内容渲染
pages/wuhan2020.tsx
新增响应式归档页面,展示统计卡片、救援记录、搜索和分类筛选、空结果状态及事件时间线。
顶部导航路由接入
components/Navigator/MainNavigator.tsx
新增 /wuhan2020 导航入口,并通过 t('wuhan2020') 获取标题。

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • #99:本次变更实现了该问题所述的武汉2020救援信息归档前端,包括数据模型、页面和导航路由。
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题准确概括了新增武汉2020救援信息存档前台页面及相关导航、数据模型的主要变更。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Warning

⚠️ This pull request shows signs of AI-generated slop (redundant_comments, description_diff_mismatch). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@models/Wuhan2020.ts`:
- Around line 1-8: 在 models/Wuhan2020.ts 的模型定义顶部补充对 ./Base 的导入,遵循 models/**/*.ts
统一初始化 GitHub 客户端的约定;保持现有 RescueCategory 等类型定义不变。

In `@pages/wuhan2020.tsx`:
- Around line 140-147: 将统计筛选项的 Card 改为 React Bootstrap Button,保留 activeCategory
切换逻辑并确保支持键盘激活;在搜索区域使用 Form.Control 和 Button 替换原生 input/button。为清除按钮添加
aria-label={t('wuhan2020_clear_search')} 等本地化可访问名称,并确保所有用户可见文本均通过 t() 提供。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bbcf82a-d9f7-4696-a631-c5a6ebf96e44

📥 Commits

Reviewing files that changed from the base of the PR and between d143245 and baa7c9e.

⛔ Files ignored due to path filters (4)
  • styles/Wuhan2020.module.less is excluded by none and included by none
  • translation/en-US.ts is excluded by none and included by none
  • translation/zh-CN.ts is excluded by none and included by none
  • translation/zh-TW.ts is excluded by none and included by none
📒 Files selected for processing (3)
  • components/Navigator/MainNavigator.tsx
  • models/Wuhan2020.ts
  • pages/wuhan2020.tsx

Comment thread models/Wuhan2020.ts
Comment on lines +1 to +8
/**
* WuHan-2020 新冠救援信息平台 — 归档数据模型
*
* 数据来源:https://github.com/nicedoc/wuhan2020
* 最后更新时间:2020 年春季
*/

export type RescueCategory =

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

补充模型层的 Base 初始化导入。

该模型文件缺少 ./Base 导入,未遵循模型层统一初始化 GitHub 客户端的约定。

建议修改
+import './Base';
+
 /**
  * WuHan-2020 新冠救援信息平台 — 归档数据模型

As per coding guidelines, models/**/*.ts 中的模型文件必须导入 ./Base

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* WuHan-2020 新冠救援信息平台 归档数据模型
*
* 数据来源:https://github.com/nicedoc/wuhan2020
* 最后更新时间:2020 年春季
*/
export type RescueCategory =
import './Base';
/**
* WuHan-2020 新冠救援信息平台 归档数据模型
*
* 数据来源:https://github.com/nicedoc/wuhan2020
* 最后更新时间:2020 年春季
*/
export type RescueCategory =
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@models/Wuhan2020.ts` around lines 1 - 8, 在 models/Wuhan2020.ts 的模型定义顶部补充对
./Base 的导入,遵循 models/**/*.ts 统一初始化 GitHub 客户端的约定;保持现有 RescueCategory 等类型定义不变。

Source: Coding guidelines

Comment thread pages/wuhan2020.tsx
Comment on lines +140 to +147
<Card
className={`text-center p-3 ${styles.statCard} ${activeCategory === key ? styles.active : ''}`}
onClick={() => setActiveCategory(activeCategory === key ? null : key)}
>
<div className={styles.statIcon}>{icon}</div>
<div className={styles.statCount}>{count}</div>
<div className={styles.statLabel}>{t(`wuhan2020_cat_${key}`)}</div>
</Card>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

将筛选交互改为可访问的 React Bootstrap 控件。

统计卡片仅绑定 onClick,不支持键盘激活;搜索区仍使用原生 input/button,且清除按钮只有 ,屏幕阅读器没有可识别名称。请以 Button 承载可点击筛选项,使用 Form.ControlButton 替换原生控件,并为清除按钮添加如 aria-label={t('wuhan2020_clear_search')} 的本地化名称。

搜索控件示例
-            <input
-              type="text"
+            <Form.Control
+              type="search"
+              size="sm"
               className="form-control form-control-sm border-0 bg-transparent"
               placeholder={t('wuhan2020_search_placeholder')}
+              aria-label={t('wuhan2020_search_placeholder')}
               value={searchTerm}
               onChange={e => setSearchTerm(e.target.value)}
               style={{ maxWidth: 220 }}
             />
-            <button
-              className="btn btn-sm btn-outline-secondary"
+            <Button
+              variant="outline-secondary"
+              size="sm"
+              aria-label={t('wuhan2020_clear_search')}
               onClick={() => setSearchTerm('')}
             >
               ✕
-            </button>
+            </Button>

As per coding guidelines, UI 交互应使用 React Bootstrap,且所有用户可见及可访问文本必须使用 t()

Also applies to: 163-180

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pages/wuhan2020.tsx` around lines 140 - 147, 将统计筛选项的 Card 改为 React Bootstrap
Button,保留 activeCategory 切换逻辑并确保支持键盘激活;在搜索区域使用 Form.Control 和 Button 替换原生
input/button。为清除按钮添加 aria-label={t('wuhan2020_clear_search')}
等本地化可访问名称,并确保所有用户可见文本均通过 t() 提供。

Source: Coding guidelines

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