Skip to content

Commit bbcc483

Browse files
author
Marvin Zhang
committed
refactor: streamline Devlog components by removing unnecessary wrappers and improving loading states
1 parent 81d5cc3 commit bbcc483

File tree

8 files changed

+15
-106
lines changed

8 files changed

+15
-106
lines changed

packages/web/NAMING_CONVENTIONS.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ This document outlines the standardized file naming conventions for the web pack
99
- **Pattern**: `PascalCase.tsx` or `page.tsx` (Next.js convention)
1010
- **Examples**:
1111
- `ProjectDetailsPage.tsx`
12-
- `DashboardPage.tsx`
1312
- `page.tsx` (Next.js route files)
1413

1514
### Layout Components
1615

1716
- **Pattern**: `PascalCase.tsx`
1817
- **Examples**:
1918
- `AppLayout.tsx`
20-
- `PageLayout.tsx`
2119
- `NavigationSidebar.tsx`
2220

2321
### Feature Components

packages/web/ROUTING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ The web package uses Next.js 14 App Router with hierarchical routing structure t
5454
app/
5555
├── layout.tsx - Root layout with AppLayout wrapper
5656
├── page.tsx - Homepage (redirects to /projects)
57-
├── DashboardPage.tsx - Dashboard component (no longer used at root)
5857
├── AppLayout.tsx - Shared layout with sidebar, header, and navigation
5958
├── projects/
6059
│ ├── page.tsx - Project list page (/projects) - NEW MAIN ENTRY
@@ -102,7 +101,6 @@ app/
102101
app/
103102
├── layout.tsx - Root layout with AppLayout wrapper
104103
├── page.tsx - Dashboard page (/)
105-
├── DashboardPage.tsx - Dashboard component
106104
├── AppLayout.tsx - Shared layout with sidebar, header, and navigation
107105
├── projects/
108106
│ ├── page.tsx - Project management page (/projects)

packages/web/app/DashboardPage.tsx

Lines changed: 0 additions & 27 deletions
This file was deleted.

packages/web/app/components/layout/NavigationSidebar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
SidebarTrigger,
1414
useSidebar,
1515
} from '@/components/ui/sidebar';
16-
import { Home, SquareKanban } from 'lucide-react';
16+
import { Boxes, Home, SquareKanban } from 'lucide-react';
1717

1818
interface SidebarItem {
1919
key: string;
@@ -43,9 +43,9 @@ export function NavigationSidebar() {
4343

4444
const projectsMenuItems = [
4545
{
46-
key: 'overview',
47-
label: 'Overview',
48-
icon: <Home />,
46+
key: 'projects',
47+
label: 'Projects',
48+
icon: <Boxes />,
4949
onClick: () => router.push('/projects'),
5050
},
5151
];

packages/web/app/components/layout/PageLayout.tsx

Lines changed: 0 additions & 56 deletions
This file was deleted.

packages/web/app/components/layout/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export { PageLayout } from './PageLayout';
21
export { NavigationSidebar } from './NavigationSidebar';
32
export { NavigationBreadcrumb } from './NavigationBreadcrumb';
43
export { AppLayoutSkeleton } from './AppLayoutSkeleton';

packages/web/app/projects/ProjectManagementPage.tsx

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import React, { useEffect, useState } from 'react';
44
import { useProjectStore } from '@/stores';
55
import { useRouter } from 'next/navigation';
6-
import { PageLayout } from '@/components/layout/PageLayout';
76
import { ProjectGridSkeleton } from '@/components/common';
87
import { Button } from '@/components/ui/button';
98
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
@@ -89,21 +88,19 @@ export function ProjectManagementPage() {
8988

9089
if (projectsContext.error) {
9190
return (
92-
<PageLayout>
93-
<Alert variant="destructive" className="m-5 flex items-center gap-2">
94-
<AlertTriangleIcon size={16} />
95-
<div>
96-
<div className="font-semibold">Error Loading Projects</div>
97-
<AlertDescription>{projectsContext.error}</AlertDescription>
98-
</div>
99-
</Alert>
100-
</PageLayout>
91+
<Alert variant="destructive" className="m-5 flex items-center gap-2">
92+
<AlertTriangleIcon size={16} />
93+
<div>
94+
<div className="font-semibold">Error Loading Projects</div>
95+
<AlertDescription>{projectsContext.error}</AlertDescription>
96+
</div>
97+
</Alert>
10198
);
10299
}
103100

104101
return (
105-
<PageLayout>
106-
<div className="w-full max-w-full">
102+
<>
103+
<div className="w-full max-w-full p-6">
107104
<div className="max-w-7xl mx-auto">
108105
<div className="flex items-center gap-4 mb-6">
109106
<Button className="bg-primary">New Project</Button>
@@ -229,6 +226,6 @@ export function ProjectManagementPage() {
229226
</form>
230227
</DialogContent>
231228
</Dialog>
232-
</PageLayout>
229+
</>
233230
);
234231
}

packages/web/app/projects/[id]/ProjectDetailsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22

33
import React, { useEffect } from 'react';
4-
import { Dashboard, PageLayout } from '@/components';
4+
import { Dashboard } from '@/components';
55
import { useDevlogStore, useProjectStore } from '@/stores';
66
import { DevlogEntry } from '@codervisor/devlog-core';
77
import { useRouter } from 'next/navigation';

0 commit comments

Comments
 (0)