Skip to content

Commit 9dfa835

Browse files
authored
Fix overflow and breadcrumb, add doc link (#6)
* fix certificate overflow scroll * fix breadcrumb and overlflow app * fix react hook deps * add tsc script * fine tune charts width * fix hook unmount * add documentation link * fix overflow chat * add bold on selected prompt
1 parent 8571435 commit 9dfa835

17 files changed

+300
-317
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ dist
1212
dist-ssr
1313
*.local
1414

15+
# typescript
16+
*.tsbuildinfo
17+
next-env.d.ts
18+
1519
# Editor directories and files
1620
.vscode/*
1721
!.vscode/extensions.json

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"dev": "vite",
88
"build": "tsc -b && vite build",
99
"lint": "eslint .",
10-
"preview": "vite preview"
10+
"preview": "vite preview",
11+
"type-check": "tsc --noEmit -p ./tsconfig.app.json"
1112
},
1213
"dependencies": {
1314
"@radix-ui/react-avatar": "^1.1.1",
@@ -55,4 +56,4 @@
5556
"typescript-eslint": "^8.15.0",
5657
"vite": "^6.0.1"
5758
}
58-
}
59+
}

public/help/copilot-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ settings (Ctrl+Shift+P) + "Preferences: Open User Settings (JSON)":
3737
"debug.testOverrideProxyUrl": "https://localhost:8990",
3838
"debug.overrideProxyUrl": "https://localhost:8990",
3939
}
40+
}
4041
```
4142

4243
> **_NOTE:_** CoPilot may need a refresh after creating the proxy config. Restart VS-Code or open the command palate (Ctrl+Shift+P) and select "Developer: Reload Window".
@@ -54,4 +55,3 @@ If there is any sort of failure, you will see the following:
5455

5556
If you experience a failure, click on the CoPilot avatar and select "Show Diagnostics"
5657
, copy the text and post it to the CoPilot [CodeGate Discussions](https://github.com/stacklok/codegate/discussions/categories/copilot)
57-

src/App.tsx

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,74 @@ import { Header } from "./components/Header";
22
import { PromptList } from "./components/PromptList";
33
import { useEffect } from "react";
44
import { Dashboard } from "./components/Dashboard";
5-
import { Routes, Route } from "react-router-dom";
5+
import { Routes, Route, Link } from "react-router-dom";
66
import { Chat } from "./components/Chat";
77
import { usePromptsStore } from "./hooks/usePromptsStore";
88
import { Sidebar } from "./components/Sidebar";
99
import { useSse } from "./hooks/useSse";
1010
import { Help } from "./components/Help";
1111
import { Certificates } from "./components/Certificates";
1212
import { CertificateSecurity } from "./components/CertificateSecurity";
13+
import {
14+
Breadcrumb,
15+
BreadcrumbList,
16+
BreadcrumbItem,
17+
BreadcrumbSeparator,
18+
BreadcrumbPage,
19+
} from "./components/ui/breadcrumb";
20+
import { useBreadcrumb } from "./hooks/useBreadcrumb";
1321

1422
function App() {
1523
const { prompts, loading, fetchPrompts } = usePromptsStore();
1624
useSse();
25+
const breadcrumb = useBreadcrumb();
1726

1827
useEffect(() => {
1928
fetchPrompts();
2029
}, [fetchPrompts]);
2130

2231
return (
23-
<>
24-
<div className="w-full">
25-
<div className="flex">
26-
<Sidebar loading={loading}>
27-
<PromptList prompts={prompts} />
28-
</Sidebar>
29-
<div className="w-screen h-screen">
30-
<Header />
31-
<div className="p-6">
32-
<Routes>
33-
<Route path="/" element={<Dashboard />} />
34-
<Route path="/prompt/:id" element={<Chat />} />
35-
<Route path="/help/:section" element={<Help />} />
36-
<Route path="/certificates" element={<Certificates />} />
37-
<Route path="/certificates/security" element={<CertificateSecurity />} />
38-
</Routes>
39-
</div>
40-
</div>
32+
<div className="flex w-screen h-screen">
33+
<Sidebar loading={loading}>
34+
<PromptList prompts={prompts} />
35+
</Sidebar>
36+
<div className="flex-1 flex flex-col overflow-hidden">
37+
<Header />
38+
39+
<div className="px-6 py-3">
40+
<Breadcrumb>
41+
<BreadcrumbList>
42+
<BreadcrumbItem>
43+
<Link to="/">Dashboard</Link>
44+
</BreadcrumbItem>
45+
{breadcrumb && (
46+
<>
47+
<BreadcrumbSeparator />
48+
<BreadcrumbItem>
49+
<BreadcrumbPage className="w-96 truncate">
50+
{breadcrumb}
51+
</BreadcrumbPage>
52+
</BreadcrumbItem>
53+
</>
54+
)}
55+
</BreadcrumbList>
56+
</Breadcrumb>
57+
</div>
58+
59+
<div className="flex-1 overflow-y-auto p-6">
60+
<Routes>
61+
<Route path="/" element={<Dashboard />} />
62+
<Route path="/prompt/:id" element={<Chat />} />
63+
<Route path="/help/:section" element={<Help />} />
64+
<Route path="/certificates" element={<Certificates />} />
65+
<Route
66+
path="/certificates/security"
67+
element={<CertificateSecurity />}
68+
/>
69+
</Routes>
4170
</div>
4271
</div>
43-
</>
72+
</div>
4473
);
4574
}
4675

src/components/CertificateSecurity.tsx

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
import { Link } from "react-router-dom";
2-
import {
3-
Breadcrumb,
4-
BreadcrumbList,
5-
BreadcrumbItem,
6-
BreadcrumbSeparator,
7-
BreadcrumbPage,
8-
} from "./ui/breadcrumb";
91
import { Card } from "./ui/card";
102

113
const SecurityShieldIcon = () => (
@@ -67,23 +59,8 @@ const OpenSourceIcon = () => (
6759

6860
export function CertificateSecurity() {
6961
return (
70-
<>
71-
<div className="flex mb-3">
72-
<Breadcrumb>
73-
<BreadcrumbList>
74-
<BreadcrumbItem>
75-
<Link to="/">Dashboard</Link>
76-
</BreadcrumbItem>
77-
<BreadcrumbSeparator />
78-
<BreadcrumbItem>
79-
<BreadcrumbPage className="w-96 truncate">
80-
Certificate Security
81-
</BreadcrumbPage>
82-
</BreadcrumbItem>
83-
</BreadcrumbList>
84-
</Breadcrumb>
85-
</div>
86-
<div className="max-w-4xl mx-auto h-[calc(100vh-4rem)] overflow-y-auto px-4 pr-6 pb-12">
62+
<div className="flex flex-col h-full">
63+
<div className="max-w-4xl mx-auto mb-4">
8764
<h1 className="text-3xl font-bold mb-8">Certificate Security</h1>
8865

8966
<Card className="p-6 mb-8 bg-white shadow-lg border-2 border-gray-100">
@@ -209,6 +186,6 @@ export function CertificateSecurity() {
209186
</div>
210187
</Card>
211188
</div>
212-
</>
189+
</div>
213190
);
214191
}

0 commit comments

Comments
 (0)