Skip to content

Commit 3aab86f

Browse files
committed
feat(frontend): link docs and show example report
1 parent 358c649 commit 3aab86f

2 files changed

Lines changed: 67 additions & 6 deletions

File tree

apps/frontend/src/app/globals.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,16 @@ body {
115115
.primary-button,
116116
.secondary-button,
117117
.ghost-button {
118+
display: inline-flex;
119+
align-items: center;
120+
justify-content: center;
118121
border: none;
119122
border-radius: 999px;
120123
padding: 12px 20px;
121124
font-size: 14px;
122125
font-weight: 600;
123126
cursor: pointer;
127+
text-decoration: none;
124128
transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
125129
}
126130

apps/frontend/src/app/page.tsx

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,51 @@ export default function Home() {
1010
const [rawResult, setRawResult] = useState<string | null>(null);
1111
const [isUploading, setIsUploading] = useState(false);
1212

13+
const examplePayload = {
14+
report: {
15+
ruleset_version: "0.8.1",
16+
generated_at_unix: 0,
17+
total_duration_ms: 842,
18+
cache_stats: {
19+
nested_bundles: { hits: 1, misses: 0 },
20+
usage_scan: { hits: 2, misses: 0 },
21+
private_api_scan: { hits: 0, misses: 1 },
22+
},
23+
results: [
24+
{
25+
rule_id: "RULE_PRIVACY_MANIFEST",
26+
rule_name: "Missing Privacy Manifest",
27+
category: "Privacy",
28+
severity: "Error",
29+
status: "Fail",
30+
message: "Missing PrivacyInfo.xcprivacy",
31+
recommendation: "Add a PrivacyInfo.xcprivacy manifest to the bundle.",
32+
duration_ms: 12,
33+
},
34+
{
35+
rule_id: "RULE_USAGE_DESCRIPTIONS",
36+
rule_name: "Missing Usage Description Keys",
37+
category: "Privacy",
38+
severity: "Warning",
39+
status: "Fail",
40+
message: "Missing required usage description keys",
41+
recommendation: "Add NS*UsageDescription keys to Info.plist.",
42+
duration_ms: 9,
43+
},
44+
{
45+
rule_id: "RULE_ATS_GRANULARITY",
46+
rule_name: "ATS Exceptions Too Broad",
47+
category: "Ats",
48+
severity: "Warning",
49+
status: "Fail",
50+
message: "AllowsArbitraryLoads is enabled",
51+
recommendation: "Scope ATS exceptions to specific domains.",
52+
duration_ms: 8,
53+
},
54+
],
55+
},
56+
};
57+
1358
const handleChooseFile = () => {
1459
fileRef.current?.click();
1560
};
@@ -79,6 +124,13 @@ export default function Home() {
79124
}
80125
};
81126

127+
const handleExampleReport = () => {
128+
setStatus("Loaded example report");
129+
setSelectedFile(null);
130+
setResult(examplePayload as Record<string, unknown>);
131+
setRawResult(JSON.stringify(examplePayload, null, 2));
132+
};
133+
82134
const summary = useMemo(() => {
83135
const report = result?.report as
84136
| { results?: Array<Record<string, unknown>>; total_duration_ms?: number }
@@ -120,12 +172,17 @@ export default function Home() {
120172
</div>
121173
</div>
122174
<div className="nav-actions">
123-
<button className="ghost-button" type="button">
175+
<a
176+
className="ghost-button"
177+
href="https://github.com/0xBoji/verifyOS#readme"
178+
target="_blank"
179+
rel="noreferrer"
180+
>
124181
Docs
125-
</button>
126-
<button className="primary-button" type="button">
182+
</a>
183+
<a className="primary-button" href="#quick-scan">
127184
New Scan
128-
</button>
185+
</a>
129186
</div>
130187
</header>
131188

@@ -147,7 +204,7 @@ export default function Home() {
147204
<button className="primary-button" type="button" onClick={handleChooseFile}>
148205
Choose bundle
149206
</button>
150-
<button className="secondary-button" type="button">
207+
<button className="secondary-button" type="button" onClick={handleExampleReport}>
151208
View example report
152209
</button>
153210
</div>
@@ -194,7 +251,7 @@ export default function Home() {
194251
</div>
195252
</section>
196253

197-
<section className="scan-panel">
254+
<section className="scan-panel" id="quick-scan">
198255
<div className="hero-card">
199256
<div className="card-header">
200257
<div>

0 commit comments

Comments
 (0)