Skip to content

Commit 5c1c5ef

Browse files
committed
added collections, environment variables, test runner UI, and some UI polish
1 parent 7b08099 commit 5c1c5ef

26 files changed

+2964
-336
lines changed

.cursorrules

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
You are an expert developer working on LitePost, a modern API client application built with Tauri and React. The tech stack includes:
2+
3+
Frontend:
4+
- React 18 with TypeScript
5+
- Vite as the build tool
6+
- Tailwind CSS for styling
7+
- shadcn/ui components (based on Radix UI)
8+
- Zustand for state management
9+
- React Router for navigation
10+
- React Syntax Highlighter for code display
11+
- React Resizable Panels for UI layout
12+
13+
Backend (Tauri):
14+
- Rust-based desktop framework
15+
- Tauri plugins: fs, http, opener
16+
- Cross-platform desktop capabilities
17+
18+
Project Structure:
19+
- /src: React frontend code
20+
- /components: React components including UI elements
21+
- /hooks: Custom React hooks
22+
- /store: Zustand state management
23+
- /utils: Utility functions
24+
- /src-tauri: Rust backend code
25+
26+
Key Features:
27+
- API request management
28+
- Response visualization
29+
- Authentication configuration
30+
- Settings management
31+
- Modern, responsive UI
32+
33+
Development Guidelines:
34+
1. Follow TypeScript best practices with strict type checking
35+
2. Use Tailwind CSS for styling, following the project's design system
36+
3. Implement proper error handling for both frontend and Rust operations
37+
4. Maintain consistent component structure using shadcn/ui patterns
38+
5. Ensure cross-platform compatibility (Windows, macOS, Linux)

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"tauri": "tauri"
1111
},
1212
"dependencies": {
13+
"@radix-ui/react-alert-dialog": "^1.1.5",
14+
"@radix-ui/react-context-menu": "^2.2.5",
1315
"@radix-ui/react-dialog": "^1.1.5",
1416
"@radix-ui/react-dropdown-menu": "^2.1.4",
1517
"@radix-ui/react-label": "^2.1.1",
@@ -20,6 +22,7 @@
2022
"@radix-ui/react-slot": "^1.1.1",
2123
"@radix-ui/react-switch": "^1.1.2",
2224
"@radix-ui/react-tabs": "^1.1.2",
25+
"@radix-ui/react-tooltip": "^1.1.7",
2326
"@tauri-apps/api": "^2.2.0",
2427
"@tauri-apps/plugin-fs": "~2",
2528
"@tauri-apps/plugin-http": "^2.2.0",

pnpm-lock.yaml

Lines changed: 135 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.tsx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,7 @@ import { useHistory } from "./hooks/useHistory"
1212
import { HistoryItem, Tab, AuthConfig } from "./types"
1313
import { Panel, PanelGroup, PanelResizeHandle } from "react-resizable-panels"
1414
import { Toaster } from "sonner"
15-
16-
// Utility function to get clean tab name from URL
17-
const getCleanTabName = (url: string): string => {
18-
try {
19-
// Remove query parameters
20-
const urlWithoutQuery = url.split('?')[0]
21-
// Get last part of path
22-
const lastPart = urlWithoutQuery.split('/').pop()
23-
return lastPart || "New Request"
24-
} catch (error) {
25-
return "New Request"
26-
}
27-
}
15+
import { getRequestNameFromUrl } from "./utils/url"
2816

2917
const defaultAuth: AuthConfig = {
3018
type: 'none',
@@ -101,7 +89,7 @@ function App() {
10189

10290
const handleHistorySelect = (item: HistoryItem) => {
10391
const newTab = createNewTab({
104-
name: getCleanTabName(item.url),
92+
name: getRequestNameFromUrl(item.url),
10593
method: item.method,
10694
url: item.url,
10795
rawUrl: item.rawUrl,
@@ -119,7 +107,13 @@ function App() {
119107
<div className="dark h-screen overflow-hidden">
120108
<Toaster theme="dark" position="bottom-right" />
121109
<div className="h-full flex flex-col bg-background text-foreground min-w-0">
122-
<TitleBar />
110+
<TitleBar
111+
currentRequest={currentTab}
112+
onRequestSelect={(request) => {
113+
setTabs((prev: Tab[]) => [...prev, request])
114+
setActiveTab(request.id)
115+
}}
116+
/>
123117
<div className="flex-1 min-h-0 min-w-0">
124118
<PanelGroup direction="horizontal">
125119
<Panel defaultSize={20} minSize={15}>
@@ -160,17 +154,27 @@ function App() {
160154
contentType={currentTab.contentType}
161155
auth={currentTab.auth}
162156
cookies={currentTab.cookies}
157+
response={currentTab.response}
158+
testScripts={currentTab.testScripts}
159+
testAssertions={currentTab.testAssertions}
160+
testResults={currentTab.testResults}
163161
onMethodChange={(method) => updateTab(currentTab.id, { method })}
164162
onUrlChange={(rawUrl) => {
165-
const name = getCleanTabName(rawUrl)
166-
updateTab(currentTab.id, { rawUrl, url: rawUrl, name })
163+
updateTab(currentTab.id, {
164+
rawUrl,
165+
url: rawUrl,
166+
name: getRequestNameFromUrl(rawUrl)
167+
})
167168
}}
168169
onParamsChange={(params) => updateTab(currentTab.id, { params })}
169170
onHeadersChange={(headers) => updateTab(currentTab.id, { headers })}
170171
onBodyChange={(body) => updateTab(currentTab.id, { body })}
171172
onContentTypeChange={(contentType) => updateTab(currentTab.id, { contentType })}
172173
onAuthChange={(auth) => updateTab(currentTab.id, { auth })}
173174
onCookiesChange={(cookies) => updateTab(currentTab.id, { cookies })}
175+
onTestScriptsChange={(testScripts) => updateTab(currentTab.id, { testScripts })}
176+
onTestAssertionsChange={(testAssertions) => updateTab(currentTab.id, { testAssertions })}
177+
onTestResultsChange={(testResults) => updateTab(currentTab.id, { testResults })}
174178
onSend={() => handleSend(currentTab.id)}
175179
/>
176180
</Panel>

0 commit comments

Comments
 (0)