Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reafactor: Pezzo Console to use shadcn/ui instead of ant design #260

Merged
merged 83 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
3da10eb
initial coliving
arielweinberger Oct 24, 2023
05f2354
unified css
arielweinberger Oct 24, 2023
ce2fd48
remove hack on LoginPage
arielweinberger Oct 24, 2023
20632b6
flatten folders
arielweinberger Oct 24, 2023
6959eff
use alias imports
arielweinberger Oct 24, 2023
705150e
refactor breadcrumbs
arielweinberger Oct 24, 2023
21dbb65
cleanup breadcrumbs
arielweinberger Oct 24, 2023
304d1b6
migrate timeframe selector to tailwind
arielweinberger Oct 24, 2023
69b3f16
refactor filters to use shadcn
arielweinberger Oct 25, 2023
4c67d48
fix breadcrumbs and remove daisyui
arielweinberger Oct 25, 2023
fe1c809
fix filters UI
arielweinberger Oct 25, 2023
635aeb1
refactor copy proejct button to use shadcn
arielweinberger Oct 25, 2023
5612ee8
refactor entire dashboard to shadcn ui
arielweinberger Oct 25, 2023
a7cfbe8
refactor environments page to shadcn ui
arielweinberger Oct 25, 2023
ff63960
refactor create environment model to use shadcn dialog
arielweinberger Oct 25, 2023
dea48bf
refactor prompts page and deletion modal to use shadcn ui
arielweinberger Oct 25, 2023
010c510
refactor prompt creation modal to use shadcn ui
arielweinberger Oct 25, 2023
f928ffd
rename field to avoid password manager interaction
arielweinberger Oct 25, 2023
bb809df
refactor projects page to shadcn ui
arielweinberger Oct 26, 2023
b3e8339
fix project card size
arielweinberger Oct 26, 2023
382323e
fix project card sizing
arielweinberger Oct 26, 2023
d9d2f40
fix visuals in members view
arielweinberger Oct 26, 2023
1b12aae
refactor members view
arielweinberger Oct 26, 2023
95cd5d7
fix formatting
arielweinberger Oct 26, 2023
3b3c35e
refactor members view to use shadcn ui
arielweinberger Oct 26, 2023
3c503bc
refactor memebrs and invitations to use shadcn ui
arielweinberger Oct 26, 2023
a671f2b
use generic destructive modals for all use cases
arielweinberger Oct 26, 2023
5d9c24e
refactor api keys to use shadcn ui
arielweinberger Oct 26, 2023
8c5b941
refactor API keys to use shadcn ui
arielweinberger Oct 27, 2023
f12bde8
fix key missing in breadcrumbs
arielweinberger Oct 27, 2023
bfe7877
fix spacing in api keys
arielweinberger Oct 27, 2023
a7ef7df
refactor org settings to use shadcn ui
arielweinberger Oct 27, 2023
b2404d3
temp
arielweinberger Oct 29, 2023
37315ee
lots of visual refactoring
arielweinberger Oct 30, 2023
870e605
tons of UI fixes in theming
arielweinberger Oct 31, 2023
5288dcf
ui fixes - set default border color
arielweinberger Oct 31, 2023
6888033
refactor requests page, table and details view to use shadcn ui
arielweinberger Nov 2, 2023
2a9901b
fix drawer overlapping with sidenav
arielweinberger Nov 2, 2023
b960b07
refactor prompt page and subpages
arielweinberger Nov 7, 2023
0a0ec36
remove old gettingstartedtutorial
arielweinberger Nov 7, 2023
034012e
remove unused containers containing antd reference
arielweinberger Nov 7, 2023
2fa9622
refactor prompt metrics view to use shadcn ui
arielweinberger Nov 7, 2023
6d4d71a
refactor RequiredProviderAPiKeyModalProvider to use shadcn ui
arielweinberger Nov 7, 2023
a6a95c9
refactor intiation accept page to use shadcn ui
arielweinberger Nov 7, 2023
5bb402a
refactor versions history to use shadcn ui
arielweinberger Nov 7, 2023
062c4b2
remove unused settings nav item
arielweinberger Nov 7, 2023
d4dc320
refactor onboarding to use shadcn ui
arielweinberger Nov 7, 2023
16c29be
rename console-new to console
arielweinberger Nov 7, 2023
76abff0
fix formatting
arielweinberger Nov 7, 2023
00b0213
fix linting errors
arielweinberger Nov 7, 2023
419830a
fix formatting
arielweinberger Nov 7, 2023
a04d9ef
add br branch to docker tag
arielweinberger Nov 7, 2023
affa63c
add missing key
arielweinberger Nov 7, 2023
4f3a10d
fix dashboard view stutter
arielweinberger Nov 7, 2023
b06592d
always push on PR
arielweinberger Nov 7, 2023
ba56bfe
fix formatting
arielweinberger Nov 7, 2023
f0a32fc
add full screen loader
arielweinberger Nov 8, 2023
8f71605
prettify tsconfig
arielweinberger Nov 8, 2023
2b34533
chore: update llm toolkit
arielweinberger Nov 8, 2023
8883292
remove heroicons
arielweinberger Nov 8, 2023
d83c4ba
fix entrypoint for docker container
arielweinberger Nov 8, 2023
8d00e63
remove redundant @antd dependencies
arielweinberger Nov 8, 2023
3541b57
remove breakpoint debugger
arielweinberger Nov 8, 2023
8a4deca
remove @emotion from repo
arielweinberger Nov 8, 2023
8b70dba
remove codemirror dependency
arielweinberger Nov 8, 2023
a6d2bf0
Fix formatting
arielweinberger Nov 8, 2023
280e835
remove hotjar dependency
arielweinberger Nov 8, 2023
53594cf
remove unused monaco editor
arielweinberger Nov 8, 2023
70714e4
Remove unused dependency @sentry/react
arielweinberger Nov 8, 2023
ffd1b1c
remove additional dependencies
arielweinberger Nov 8, 2023
ec0ff28
remove a bunch of other deps
arielweinberger Nov 8, 2023
aebcbff
fix formatting
arielweinberger Nov 8, 2023
df1b0b1
simplify layout
arielweinberger Nov 8, 2023
d4958ad
cleanup breadcrumb related code
arielweinberger Nov 8, 2023
146ac96
Temporarily remove close X on dialogs
arielweinberger Nov 8, 2023
3073687
fix org selector
arielweinberger Nov 8, 2023
cc7a196
add support for new models from November 6 2023
arielweinberger Nov 8, 2023
2718fa1
fix issue where slider input field is set as string rather than number
arielweinberger Nov 8, 2023
f5683ca
fix scrolling in project context when content is longer
arielweinberger Nov 8, 2023
785d6ef
update llm-toolkit to v0.5.0
arielweinberger Nov 8, 2023
1912733
fix(server): remove unused prompt execution model
arielweinberger Nov 8, 2023
3b0c24a
fix OpenAI types and build on console
arielweinberger Nov 8, 2023
806bc1a
add toasts
arielweinberger Nov 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
tags: |
type=raw,value=${{ github.run_id }},prefix=gh-
type=ref,event=branch,prefix=branch-
type=ref,event=pr,prefix=pr-
type=ref,event=tag
type=sha,format=short

Expand All @@ -128,5 +129,6 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
# only push if the branch is main or a release branch
push: ${{ startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/') }}
push: true
# push: ${{ startsWith(github.ref, 'refs/heads/main') || startsWith(github.ref, 'refs/heads/release/') }}
provenance: false
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"singleQuote": false
"singleQuote": false,
"plugins": ["prettier-plugin-tailwindcss"],
"tailwindConfig": "./apps/console/tailwind.config.js",
"tailwindFunctions": ["clsx", "cva"]
}
28 changes: 0 additions & 28 deletions .verdaccio/config.yml

This file was deleted.

5 changes: 2 additions & 3 deletions apps/console/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
[
"@nx/react/babel",
{
"runtime": "automatic",
"importSource": "@emotion/react"
"runtime": "automatic"
}
]
],
"plugins": ["@emotion/babel-plugin"]
"plugins": []
}
1 change: 1 addition & 0 deletions apps/console/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
NX_BASE_API_URL="http://localhost:3000"
NX_SUPERTOKENS_API_DOMAIN="http://localhost:3000"
NX_SUPERTOKENS_WEBSITE_DOMAIN="http://localhost:4200"
NX_DEBUG_MODE="true"
9 changes: 8 additions & 1 deletion apps/console/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"allowCircularSelfDependency": true
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
Expand Down
2 changes: 1 addition & 1 deletion apps/console/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StorybookConfig } from "@storybook/react-webpack5";

const config: StorybookConfig = {
stories: ["../src/app/**/*.stories.@(js|jsx|ts|tsx|mdx)"],
stories: ["../src/**/*.stories.@(js|jsx|ts|tsx|mdx)"],
addons: [
"@storybook/addon-essentials",
"@storybook/addon-interactions",
Expand Down
1 change: 0 additions & 1 deletion apps/console/postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const { join } = require("path");

module.exports = {
plugins: {
"postcss-nested": {},
tailwindcss: {
config: join(__dirname, "tailwind.config.js"),
},
Expand Down
213 changes: 213 additions & 0 deletions apps/console/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
import "./styles.css";
import { Route, Routes, Navigate, Outlet } from "react-router-dom";
import { hotjar } from "react-hotjar";
import { HOTJAR_SITE_ID, HOTJAR_VERSION } from "~/env";
import { Toaster } from "@pezzo/ui";

// Auth
import { QueryClientProvider } from "@tanstack/react-query";
import { SuperTokensWrapper } from "supertokens-auth-react";
import { SessionAuth } from "supertokens-auth-react/recipe/session";
import { initSuperTokens } from "./lib/auth/supertokens";

// Pages
import { EnvironmentsPage } from "./pages/environments/EnvironmentsPage";
import { PromptPage } from "./pages/prompts/PromptPage";
import { PromptsPage } from "./pages/prompts/PromptsPage";
import { OnboardingPage } from "./pages/organizations/onboarding";
import { LogoutPage } from "./pages/auth/LogoutPage";
import { RequestsPage } from "./pages/requests/RequestsPage";
import { DashboardPage } from "./pages/projects/overview/DashboardPage";
import { LoginPage } from "./pages/auth/LoginPage";
import { AuthCallbackPage } from "./pages/auth/AuthCallbackPage";
import { queryClient } from "./lib/graphql";
import { AuthProvider } from "./lib/providers/AuthProvider";
import { OptionalIntercomProvider } from "./lib/providers/OptionalIntercomProvider";
import { LayoutWrapper } from "./components/layout/LayoutWrapper";
import { AcceptInvitationPage } from "./pages/invitations/AcceptInvitationPage";
import { CurrentPromptProvider } from "./lib/providers/CurrentPromptContext";
import { RequiredProviderApiKeyModalProvider } from "./lib/providers/RequiredProviderApiKeyModalProvider";
import { OrgMembersPage } from "./pages/organizations/OrgMembersPage";
import { OrgSettingsPage } from "./pages/organizations/OrgSettingsPage";
import { OrgApiKeysPage } from "./pages/organizations/OrgApiKeysPage";
import { useCurrentOrganization } from "./lib/hooks/useCurrentOrganization";
import { PromptEditView } from "./features/editor/PromptEditView";
import { EditorProvider } from "./lib/providers/EditorContext";
import { PromptTesterProvider } from "./lib/providers/PromptTesterContext";
import { PromptVersionsView } from "./components/prompts/views/PromptVersionsView";
import { PromptMetricsView } from "./components/prompts/views/PromptMetricsView";
import { Suspense } from "react";
import { FullScreenLoader } from "./components/common/FullScreenLoader";
import { OrgPage } from "./pages/projects/OrgPage";

initSuperTokens();

if (HOTJAR_SITE_ID && HOTJAR_VERSION) {
hotjar.initialize(Number(HOTJAR_SITE_ID), Number(HOTJAR_VERSION));
}

export const RootPageHandler = () => {
const { organizationId } = useCurrentOrganization();
return organizationId && <Navigate to={`/orgs/${organizationId}`} />;
};

export function App() {
return (
<div className="relative h-full">
<Toaster />
<Suspense fallback={<FullScreenLoader />}>
<SuperTokensWrapper>
<QueryClientProvider client={queryClient}>
{/* Non-authorized routes */}
<Routes>
{/* We don't render the LayoutWrapper for non-authorized routes */}
<Route
path="/login/callback/:providerId"
element={<AuthCallbackPage />}
/>
<Route path="/login" element={<LoginPage />} />
<Route path="/logout" element={<LogoutPage />} />
</Routes>
{/* Authorized routes */}
<Routes>
<Route
element={
<SessionAuth>
<AuthProvider>
<OptionalIntercomProvider>
<Outlet />
</OptionalIntercomProvider>
</AuthProvider>
</SessionAuth>
}
>
<Route
path="/invitations/:token/accept"
element={
<LayoutWrapper withSideNav={false}>
<AcceptInvitationPage />
</LayoutWrapper>
}
/>

<Route
path="/onboarding"
element={
<LayoutWrapper withSideNav={false}>
<OnboardingPage />
</LayoutWrapper>
}
/>

{/* Organizations */}
<Route
path="/orgs/:orgId"
element={
<LayoutWrapper withSideNav={false} withOrgSubHeader={true}>
<OrgPage />
</LayoutWrapper>
}
></Route>

<Route
path="/orgs/:orgId/members"
element={
<LayoutWrapper withSideNav={false} withOrgSubHeader={true}>
<OrgMembersPage />
</LayoutWrapper>
}
></Route>

<Route
path="/orgs/:orgId/api-keys"
element={
<LayoutWrapper withSideNav={false} withOrgSubHeader={true}>
<OrgApiKeysPage />
</LayoutWrapper>
}
></Route>

<Route
path="/orgs/:orgId/settings"
element={
<LayoutWrapper withSideNav={false} withOrgSubHeader={true}>
<OrgSettingsPage />
</LayoutWrapper>
}
></Route>

{/* Project selection */}
<Route
element={
<LayoutWrapper withSideNav={false} withOrgSubHeader={true}>
<Outlet />
</LayoutWrapper>
}
>
<Route index element={<RootPageHandler />} />
</Route>

{/* In-project routes */}
<Route
path="/projects/:projectId"
element={
<CurrentPromptProvider>
<RequiredProviderApiKeyModalProvider>
<LayoutWrapper withSideNav={true}>
<Outlet />
</LayoutWrapper>
</RequiredProviderApiKeyModalProvider>
</CurrentPromptProvider>
}
>
<Route
index
path="/projects/:projectId/"
element={<DashboardPage />}
/>
<Route
path={"/projects/:projectId/dashboard"}
element={<DashboardPage />}
/>
<Route
path={"/projects/:projectId/requests"}
element={<RequestsPage />}
/>
<Route
path="/projects/:projectId/prompts"
element={<PromptsPage />}
/>
<Route
path="/projects/:projectId/prompts/:promptId"
element={<PromptPage />}
>
<Route index element={<Navigate to="edit" />} />
<Route
index
path="edit"
element={
<EditorProvider>
<PromptTesterProvider>
<PromptEditView />
</PromptTesterProvider>
</EditorProvider>
}
/>
<Route path="versions" element={<PromptVersionsView />} />
<Route path="metrics" element={<PromptMetricsView />} />
</Route>
<Route
path="/projects/:projectId/environments"
element={<EnvironmentsPage />}
/>
</Route>
</Route>
</Routes>
</QueryClientProvider>
</SuperTokensWrapper>
</Suspense>
</div>
);
}

export default App;
38 changes: 0 additions & 38 deletions apps/console/src/app/antd-overrides.css

This file was deleted.

Loading
Loading