Skip to content

Commit 97e2b33

Browse files
committed
feat: add review challenge file browser
1 parent 5b807ae commit 97e2b33

4 files changed

Lines changed: 386 additions & 167 deletions

File tree

src/app/challenges/review/[slug]/page.tsx

Lines changed: 8 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
22
import Link from "next/link";
33
import { notFound } from "next/navigation";
44

5+
import { ReviewFileBrowser } from "@/components/challenges/ReviewFileBrowser";
56
import { ReviewSubmissionForm } from "@/components/challenges/ReviewSubmissionForm";
67
import { AppShell } from "@/components/layout/AppShell";
78
import { Badge } from "@/components/ui/Badge";
@@ -39,7 +40,7 @@ export default async function ReviewChallengePage({ params }: ReviewChallengePag
3940
notFound();
4041
}
4142

42-
const { metadata, diff } = challenge;
43+
const { metadata, files } = challenge;
4344
const displayId = metadata.order.toString().padStart(3, "0");
4445

4546
return (
@@ -55,8 +56,8 @@ export default async function ReviewChallengePage({ params }: ReviewChallengePag
5556
<a className="active" href="#review">
5657
Review {displayId}
5758
</a>
58-
<a href="#review-flow">审核流程</a>
59-
<a href="#diff">AI 补丁</a>
59+
<a href="#files">题目文件</a>
60+
<a href="#checks">审查清单</a>
6061
<a href="#submit">提交 Review</a>
6162
<a href="#rubric">评分</a>
6263
</nav>
@@ -102,26 +103,13 @@ export default async function ReviewChallengePage({ params }: ReviewChallengePag
102103
</div>
103104
<div className="section-body">
104105
<p>
105-
阅读下面的 AI PR diff,判断它是否可以 merge。如果不能,需要指出具体问题、影响和修复建议。你不需要掌握完整项目,
106-
只需要围绕本页给出的行为规则、来源背景和 diff 做判断。
106+
打开题目文件,重点审查 AI PR diff 是否可以 merge。如果不能,需要指出具体问题、影响、反例测试和修复建议。
107107
</p>
108-
<div className="review-template">
109-
<pre>{`是否可以合并:可以 / 不可以 / 需要更多信息
110-
111-
总体结论:
112-
113-
Blocking finding:
114-
- 严重程度:
115-
- 问题描述:
116-
- 影响说明:
117-
- 修复建议:
118-
119-
测试评价:
120-
- 应该补充的反例或边界测试:`}</pre>
121-
</div>
122108
</div>
123109
</section>
124110

111+
<ReviewFileBrowser files={files} defaultFileName={metadata.reviewTarget.file} />
112+
125113
<section className="challenge-section card">
126114
<div className="card-head">
127115
<h2>题目上下文</h2>
@@ -134,37 +122,7 @@ Blocking finding:
134122
</div>
135123
</section>
136124

137-
<section className="challenge-section card">
138-
<div className="card-head">
139-
<h2>术语速查</h2>
140-
<span className="mono">review vocabulary</span>
141-
</div>
142-
<div className="term-grid">
143-
{metadata.terms.map((item) => (
144-
<div className="term-item" key={item.term}>
145-
<strong>{item.term}</strong>
146-
<p>{item.description}</p>
147-
</div>
148-
))}
149-
</div>
150-
</section>
151-
152-
<section className="challenge-section card" id="review-flow">
153-
<div className="card-head">
154-
<h2>推荐审核流程</h2>
155-
<span className="mono">review path</span>
156-
</div>
157-
<ol className="review-flow">
158-
{metadata.reviewFocus.map((item) => (
159-
<li key={item}>
160-
<strong>{item}</strong>
161-
<span>把这个点和 diff、测试、原有约束对照起来,判断它是否足以阻塞合并。</span>
162-
</li>
163-
))}
164-
</ol>
165-
</section>
166-
167-
<section className="challenge-section card">
125+
<section className="challenge-section card" id="checks">
168126
<div className="card-head">
169127
<h2>审查清单</h2>
170128
<span className="mono">不要只看 happy path</span>
@@ -191,14 +149,6 @@ Blocking finding:
191149
</div>
192150
</section>
193151

194-
<section className="challenge-section card" id="diff">
195-
<div className="card-head">
196-
<h2>AI PR 变更</h2>
197-
<span className="mono">{metadata.reviewTarget.file}</span>
198-
</div>
199-
<pre className="diff-block">{diff}</pre>
200-
</section>
201-
202152
<ReviewSubmissionForm
203153
challengeId={metadata.id}
204154
referenceLinks={metadata.source.references}
@@ -218,18 +168,6 @@ Blocking finding:
218168
</div>
219169
</section>
220170

221-
<section className="card">
222-
<div className="card-head">
223-
<h2>审核顺序</h2>
224-
</div>
225-
<div className="section-body compact">
226-
<p>1. 看 AI 改了哪一处判断或配置。</p>
227-
<p>2. 检查新增测试是否只覆盖正向场景。</p>
228-
<p>3. 对照原有安全、兼容性或数据语义约束。</p>
229-
<p>4. 写出能阻止 merge 的 finding。</p>
230-
</div>
231-
</section>
232-
233171
<section className="card" id="rubric">
234172
<div className="card-head">
235173
<h2>评分重点</h2>

0 commit comments

Comments
 (0)