Skip to content

Commit a4ce715

Browse files
committed
feat(web): implement redirects and update internal links for improved navigation
- Added redirects for `/reports` to `/vibes`, `/reports/:jobId` to `/analysis/:jobId`, and `/repos` to `/settings/repos` in `next.config.ts`. - Updated internal links in `AnalysisListClient` to point to the new `/settings/repos` path, enhancing user navigation. - Expanded protected prefixes in `proxy.ts` to include new routes, ensuring proper access control. This update streamlines user experience by consolidating navigation paths and implementing necessary redirects.
1 parent ef3b589 commit a4ce715

4 files changed

Lines changed: 29 additions & 10 deletions

File tree

apps/web/next.config.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ const nextConfig: NextConfig = {
1313
},
1414
],
1515
},
16+
async redirects() {
17+
return [
18+
{
19+
source: "/reports",
20+
destination: "/vibes",
21+
permanent: true,
22+
},
23+
{
24+
source: "/reports/:jobId",
25+
destination: "/analysis/:jobId",
26+
permanent: true,
27+
},
28+
{
29+
source: "/repos",
30+
destination: "/settings/repos",
31+
permanent: true,
32+
},
33+
];
34+
},
1635
};
1736

1837
export default nextConfig;

apps/web/src/app/analysis/AnalysisListClient.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export default function AnalysisListClient({ initialReports, initialJobs }: Anal
157157
<p className="text-sm text-zinc-600">
158158
No completed reports yet. Run your first vibe check.
159159
</p>
160-
<Link className={`${wrappedTheme.primaryButtonSm} mx-auto`} href="/repos">
160+
<Link className={`${wrappedTheme.primaryButtonSm} mx-auto`} href="/settings/repos">
161161
Pick a repo
162162
</Link>
163163
</div>
@@ -243,7 +243,7 @@ export default function AnalysisListClient({ initialReports, initialJobs }: Anal
243243
<p className="text-sm text-zinc-600">
244244
No analysis jobs yet.
245245
</p>
246-
<Link className={`${wrappedTheme.primaryButtonSm} mx-auto`} href="/repos">
246+
<Link className={`${wrappedTheme.primaryButtonSm} mx-auto`} href="/settings/repos">
247247
Start an analysis
248248
</Link>
249249
</div>

apps/web/src/proxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export async function proxy(request: NextRequest) {
5050
}
5151

5252
const path = request.nextUrl.pathname;
53-
const protectedPrefixes = ["/repos", "/repo", "/analysis", "/profile"];
53+
const protectedPrefixes = ["/repos", "/repo", "/analysis", "/profile", "/vibes", "/settings"];
5454

5555
const isProtected = protectedPrefixes.some(
5656
(p) => path === p || path.startsWith(`${p}/`)

docs/implementation-trackers/information-architecture-restructure.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,16 @@ This tracker covers all implementation work for the Information Architecture Res
288288

289289
### X1. Migration & Redirects
290290

291-
**Status:** `[ ] Not Started`
291+
**Status:** `[~] In Progress`
292292
**Depends on:** P2
293293
**Blocks:** X2
294294

295295
| Task | Status | File(s) |
296296
|------|--------|---------|
297-
| Add redirect: `/reports``/vibes` | `[ ]` | `next.config.js` or middleware |
298-
| Add redirect: `/reports/[id]``/vibes/.../[id]` | `[ ]` | `next.config.js` or middleware |
299-
| Add redirect: `/repos``/settings/repos` | `[ ]` | `next.config.js` or middleware |
300-
| Update all internal links | `[ ]` | Various |
297+
| Add redirect: `/reports``/vibes` | `[x]` | `next.config.ts` |
298+
| Add redirect: `/reports/[id]``/analysis/[id]` | `[x]` | `next.config.ts` |
299+
| Add redirect: `/repos``/settings/repos` | `[x]` | `next.config.ts` |
300+
| Update all internal links | `[x]` | `app/analysis/AnalysisListClient.tsx` |
301301
| Update email templates (if any) | `[ ]` ||
302302

303303
**Success Criteria:**
@@ -364,10 +364,10 @@ This tracker covers all implementation work for the Information Architecture Res
364364
| P4: Notification System | 6 | 6 | `[x] Complete` |
365365
| P5: Vertical Stories ShareCard | 7 | 6 | `[~] In Progress` |
366366
| P6: LLM Tagline Generation | 5 | 5 | `[x] Complete` |
367-
| X1: Migration & Redirects | 5 | 0 | `[ ] Not Started` |
367+
| X1: Migration & Redirects | 5 | 4 | `[~] In Progress` |
368368
| X2: Polish & Testing | 7 | 0 | `[ ] Not Started` |
369369
| X3: Documentation | 5 | 0 | `[ ] Not Started` |
370-
| **Total** | **91** | **64** | **70%** |
370+
| **Total** | **91** | **68** | **75%** |
371371

372372
---
373373

0 commit comments

Comments
 (0)