Skip to content

Commit

Permalink
Move the top bar to the bottom, icon overhauls, simplify URLs, and ot…
Browse files Browse the repository at this point in the history
…her nice things (#250)

* update the version state

* kill all of the /requestor URLs

* update webhonc badge to be a bit more chill

* initial move to the bottom

* Formatting

* add radix menubar

* remove unnecessary

* add settings menubar

* Formatting

* add bottom toolbar icons and use store for panel state

* formatting

* some more attempts at making the side panel not suck

* formatting

* remove unused items

* remove branding temporarily

* icon hover/active states

* make routes panel even more chill

* formatting

* fix up the key sequence to not cause massive re-renders (spoiler: it was the useState inside)

* formatting

* simplify nav panel and fix overflow issues

* remove ArrowUp/Down key navigation as scoping is currently difficult to implement and interferes too much with browser-native things

* simplify keySequence hook

* fit RoutesItem

* formatting

* remove unused

* re-add branding

* formatting

* bump canary version
  • Loading branch information
keturiosakys authored Sep 13, 2024
1 parent 5baa430 commit 35bdf32
Show file tree
Hide file tree
Showing 24 changed files with 571 additions and 468 deletions.
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.8.0-beta.11",
"version": "0.8.1-canary.3",
"name": "@fiberplane/studio",
"description": "Local development debugging interface for Hono apps",
"author": "Fiberplane<[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fiberplane/fpx-types",
"description": "Shared types and schemas for fpx",
"version": "0.0.5",
"version": "0.0.6",
"type": "module",
"exports": {
".": "./dist/index.js"
Expand Down
34 changes: 34 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@radix-ui/react-hover-card": "^1.1.1",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-menubar": "^1.1.1",
"@radix-ui/react-popover": "^1.0.7",
"@radix-ui/react-radio-group": "^1.1.3",
"@radix-ui/react-separator": "^1.0.3",
Expand Down
25 changes: 3 additions & 22 deletions studio/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { QueryClientProvider, queryClient } from "@/queries";
import { TooltipProvider } from "@radix-ui/react-tooltip";
import { type ReactNode, useEffect } from "react";
import {
Route,
BrowserRouter as Router,
Routes,
useNavigate,
} from "react-router-dom";
import { Route, BrowserRouter as Router, Routes } from "react-router-dom";
import { Layout } from "./Layout";
import { Toaster } from "./components/ui/toaster";
import { RequestDetailsPage } from "./pages/RequestDetailsPage/RequestDetailsPage";
Expand All @@ -20,7 +14,6 @@ export function App() {
<TooltipProvider>
<Layout>
<Routes>
<Route path="/" element={<Redirect />} />
<Route path="/requests" element={<RequestsPage />} />
<Route
path="/requests/otel/:traceId"
Expand All @@ -30,11 +23,8 @@ export function App() {
path="/requests/:traceId"
element={<RequestDetailsPage />}
/>
<Route path="/requestor" element={<RequestorPage />} />
<Route
path="/requestor/:requestType/:id"
element={<RequestorPage />}
/>
<Route path="/" element={<RequestorPage />} />
<Route path="/:requestType/:id" element={<RequestorPage />} />
</Routes>
</Layout>
<Toaster />
Expand All @@ -45,12 +35,3 @@ export function App() {
}

export default App;

function Redirect({ to = "/requestor" }: { to?: string }): ReactNode {
const navigate = useNavigate();
useEffect(() => {
navigate(to);
}, [to, navigate]);

return null;
}
11 changes: 7 additions & 4 deletions studio/src/Layout/FloatingSidePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,20 @@ import { useRequestorStore } from "../pages/RequestorPage/store";
import { cn } from "../utils";

export function FloatingSidePanel() {
const { sidePanelOpen, setSidePanelOpen } = useRequestorStore(
"sidePanelOpen",
"setSidePanelOpen",
const { sidePanel, togglePanel } = useRequestorStore(
"sidePanel",
"togglePanel",
"path",
);

const isLgScreen = useIsLgScreen();

return (
<aside>
<Root open={!isLgScreen && sidePanelOpen} onOpenChange={setSidePanelOpen}>
<Root
open={!isLgScreen && sidePanel === "open"}
onOpenChange={() => togglePanel("sidePanel")}
>
<DialogPortal>
<DialogOverlay className="fixed top-0 left-0 w-full h-full bg-black/40" />
<DialogContent
Expand Down
Loading

0 comments on commit 35bdf32

Please sign in to comment.