Skip to content

ElectricSQL run page and react-window-splitter #1277

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

Merged
merged 84 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
40b8aec
WIP on using react-window-splitter
matt-aitken Aug 12, 2024
8afd4c4
WIP with new resizable panels and SSR
matt-aitken Aug 12, 2024
1d12f8a
Use the cookie package
matt-aitken Aug 12, 2024
b46698b
Resizable storybook page
matt-aitken Aug 12, 2024
a8f725d
Increase indexing memory limit
nicktrn Aug 12, 2024
37fd088
Fixed v2 usage meter displaying when on paid plan (#1255)
samejr Aug 13, 2024
2c80e9a
Concurrency page and more accurate tracking (#1252)
matt-aitken Aug 13, 2024
4148921
v3: fix unfreezable state crashes for runs with multiple waits (#1253)
nicktrn Aug 13, 2024
0e990fd
Added more logging to TaskRunConcurrencyTracker and some more try/cat…
matt-aitken Aug 13, 2024
6b0c37a
Call subscriber.messageDequeued in dequeueMessageInSharedQueue
matt-aitken Aug 13, 2024
41c551d
Added messageReplaced to concurrency tracking (when freezing)
matt-aitken Aug 13, 2024
ff435fb
Added depenenciesToBundle guide to bundle all packages
samejr Aug 13, 2024
26e872a
Include the old message data when replacing, so we get the projectId …
matt-aitken Aug 13, 2024
cbaaa3b
Fix restored container names
nicktrn Aug 13, 2024
494e1ea
Fix for schedule page not scrolling
samejr Aug 14, 2024
cd10d47
Added a description panel to the Concurrency admin page
samejr Aug 14, 2024
31da143
chore: Update version for release (beta) (#1256)
github-actions[bot] Aug 14, 2024
95b3754
Release 3.0.0-beta.53
nicktrn Aug 14, 2024
fa24ae6
Added a note to use batchTrigger() instead of trigger()
samejr Aug 14, 2024
d3810fc
The latest react-window-splitter fixes the ESM issues
matt-aitken Aug 15, 2024
194c56a
Set sensible defaults for the run page
matt-aitken Aug 15, 2024
68945a4
Deployments page
matt-aitken Aug 15, 2024
c3298f9
Test page
matt-aitken Aug 15, 2024
4027045
Schedules page
matt-aitken Aug 15, 2024
2416f42
Latest version of react-window-splitter (0.2.5)
matt-aitken Aug 18, 2024
0756230
Merge remote-tracking branch 'origin/main' into react-window-splitter
samejr Aug 23, 2024
d36f07b
Updated to the latest version: react-window-splitter
samejr Aug 23, 2024
bb93adc
Callout if runs don’t start right away now has some top margin
samejr Aug 23, 2024
1e68485
Small padding fix
samejr Aug 23, 2024
442e3b4
styled the handle focus state
samejr Aug 23, 2024
1d3cd1d
Added isStaticAtRest prop to resizable panel
samejr Aug 23, 2024
3952421
Updated resizable storybook
samejr Aug 23, 2024
4510fc0
Inline code blocks behave nicer when text wraps
samejr Aug 24, 2024
4495fa9
Added ElectricSQL to docker-compose, available on 3060
matt-aitken Aug 29, 2024
1f9b4bf
Extracted some logic out of the eventRepository for getting a trace. …
matt-aitken Aug 29, 2024
96665a4
Use the new util
matt-aitken Aug 29, 2024
723753b
More restructuring ready to use the trace summary from the frontend
matt-aitken Aug 29, 2024
cbb95f2
Using ElectricSQL for the run page data
matt-aitken Aug 29, 2024
1d58ef9
Min size for resizable panel on test page
samejr Aug 29, 2024
2190bd6
Don’t load the trace in the RunPresenter anymore
matt-aitken Aug 29, 2024
894ce9e
Merge remote-tracking branch 'origin/react-window-splitter' into elec…
matt-aitken Aug 29, 2024
3fea23d
Fix for the resizable panels on the run page
matt-aitken Aug 29, 2024
cd2bb3e
Added overflow hidden to the panel group
samejr Aug 29, 2024
75fddae
min size for the test page left hand panel
samejr Aug 29, 2024
d662e41
Updated to latest window-splitter version
samejr Aug 29, 2024
6986557
Removed unused const
matt-aitken Aug 29, 2024
a66bb39
One fix for client-server mismatch
matt-aitken Aug 29, 2024
8811897
Slight improvement in the loading state
matt-aitken Aug 29, 2024
bf4e581
Restructured the page so the loading is better
matt-aitken Aug 29, 2024
5e9b86e
Improvement to the loading states
matt-aitken Aug 29, 2024
259cfc5
Improved the loading behaviour with the inspector
matt-aitken Aug 29, 2024
704b0da
WIP on auth, having problems with it
matt-aitken Aug 29, 2024
e63ee9e
Upgrade Remix to 2.9.1 (same as PR #1096)
matt-aitken Aug 29, 2024
67ec4f0
Switched structure around again so we only call the useTrace hook fro…
matt-aitken Aug 29, 2024
2229610
Added auth to the sync
matt-aitken Aug 30, 2024
b67a8f9
Overscan more rows in the tree view
matt-aitken Aug 30, 2024
4cf9c65
Fix for TS error
matt-aitken Aug 30, 2024
10ba1d9
Remove duplicate import
matt-aitken Aug 30, 2024
d46999e
Revert "Upgrade Remix to 2.9.1 (same as PR #1096)"
samejr Aug 30, 2024
b54387d
save cookie only when id is used
samejr Aug 30, 2024
e298ab3
Deployment table now scrolls
samejr Aug 30, 2024
e2bbf98
removed imports
samejr Aug 30, 2024
25d1304
A lot of changes to make the inspector live too… WIP
matt-aitken Aug 30, 2024
3d8ea66
More major overhauls to get the synced version of the run page working…
matt-aitken Aug 30, 2024
91778b1
If a span is completed show that
matt-aitken Aug 30, 2024
af92280
Set the debounce much lower for selecting the span view
matt-aitken Aug 30, 2024
8159c25
Load the details run inspector data on demand
matt-aitken Aug 30, 2024
6c9c841
Merge branch 'main' into electricsql-run
matt-aitken Aug 30, 2024
591385a
Delete the SpanPresenter
matt-aitken Aug 30, 2024
021e074
Use the async payload because it deals with superjson
matt-aitken Aug 30, 2024
f3a0127
Fixed weird merge conflict
matt-aitken Aug 30, 2024
537f706
Share some inspector timeline components
matt-aitken Sep 2, 2024
3c24d4c
A couple of layout tweaks
matt-aitken Sep 2, 2024
01b1f53
Improved the run inspector loading states
matt-aitken Sep 2, 2024
5bf8615
Fix for paragaph errors
matt-aitken Sep 2, 2024
1aad21a
Fix for focusing on a span
matt-aitken Sep 2, 2024
ddc1db1
Undefined typre for useSyncedShape
matt-aitken Sep 2, 2024
f26fd2d
ELECTRIC_ORIGIN env var doesn’t have a default, added to the examples
matt-aitken Sep 2, 2024
a342877
Updated @electric-sql/react package to the latest
matt-aitken Sep 4, 2024
6bdbc68
Fix the timeline duration stretching
matt-aitken Sep 4, 2024
cd94cc9
Added some better error handling for the electric sync
matt-aitken Sep 4, 2024
1791d15
More logging
matt-aitken Sep 4, 2024
9f11455
Better error when there are bad responses
matt-aitken Sep 4, 2024
1812067
Turn off resizable snapshots, there’s a bug
matt-aitken Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ DIRECT_URL=${DATABASE_URL}
REMIX_APP_PORT=3030
APP_ENV=development
APP_ORIGIN=http://localhost:3030
ELECTRIC_ORIGIN=http://localhost:3060
NODE_ENV=development
V3_ENABLED=true

Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/app/components/code/CodeBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Clipboard, ClipboardCheck } from "lucide-react";
import type { Language, PrismTheme } from "prism-react-renderer";
import { Highlight, Prism } from "prism-react-renderer";
import { forwardRef, useCallback, useState } from "react";
import { forwardRef, ReactNode, useCallback, useState } from "react";
import { cn } from "~/utils/cn";
import { Paragraph } from "../primitives/Paragraph";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../primitives/Tooltip";
Expand Down Expand Up @@ -385,7 +385,7 @@ function Chrome({ title }: { title?: string }) {
);
}

export function TitleRow({ title }: { title: string }) {
export function TitleRow({ title }: { title: ReactNode }) {
return (
<div className="flex items-center justify-between px-3">
<Paragraph variant="small/bright" className="w-full border-b border-grid-dimmed py-2">
Expand Down
2 changes: 1 addition & 1 deletion apps/webapp/app/components/code/InlineCode.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { cn } from "~/utils/cn";

const inlineCode =
"px-1 py-0.5 rounded border border-charcoal-700 bg-charcoal-800 text-charcoal-200 font-mono";
"px-1 py-0.5 rounded border border-charcoal-700 bg-charcoal-800 text-charcoal-200 font-mono text-wrap";

const variants = {
"extra-extra-small": "text-xxs",
Expand Down
31 changes: 18 additions & 13 deletions apps/webapp/app/components/primitives/Resizable.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
"use client";

import * as ResizablePrimitive from "react-resizable-panels";
import React from "react";
import { PanelGroup, Panel, PanelResizer } from "react-window-splitter";
import { cn } from "~/utils/cn";

const ResizablePanelGroup = ({
className,
...props
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
<ResizablePrimitive.PanelGroup
className={cn("flex w-full data-[panel-group-direction=vertical]:flex-col", className)}
const ResizablePanelGroup = ({ className, ...props }: React.ComponentProps<typeof PanelGroup>) => (
<PanelGroup
className={cn(
"flex w-full overflow-hidden data-[panel-group-direction=vertical]:flex-col",
className
)}
autosaveStrategy={props.autosaveId ? "cookie" : undefined}
{...props}
/>
);

const ResizablePanel = ResizablePrimitive.Panel;
const ResizablePanel = Panel;

const ResizableHandle = ({
withHandle,
withHandle = true,
className,
...props
}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
}: React.ComponentProps<typeof PanelResizer> & {
withHandle?: boolean;
}) => (
<ResizablePrimitive.PanelResizeHandle
<PanelResizer
className={cn(
"focus-visible:ring-ring group relative flex w-0.75 items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 hover:w-0.75 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1 [&[data-panel-group-direction=vertical]>div]:rotate-90",
"focus-visible:ring-ring group relative flex w-0.75 items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 hover:w-0.75 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-secondary/50 focus-visible:ring-offset-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
className
)}
size="3px"
{...props}
>
<div className="absolute left-[0.0625rem] top-0 h-full w-px bg-grid-bright transition group-hover:left-0 group-hover:w-0.75 group-hover:bg-lavender-500" />
Expand All @@ -37,7 +40,9 @@ const ResizableHandle = ({
))}
</div>
)}
</ResizablePrimitive.PanelResizeHandle>
</PanelResizer>
);

export { ResizableHandle, ResizablePanel, ResizablePanelGroup };

export type ResizableSnapshot = React.ComponentProps<typeof PanelGroup>["snapshot"];
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export function useTree<TData, TFilterValue>({
index,
});
},
overscan: 20,
overscan: 50,
});

const scrollToNodeFn = useCallback(
Expand Down
63 changes: 63 additions & 0 deletions apps/webapp/app/components/runs/v3/InspectorTimeline.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { ReactNode } from "react";
import { cn } from "~/utils/cn";

type RunTimelineItemProps = {
title: ReactNode;
subtitle?: ReactNode;
state: "complete" | "error";
};

export function RunTimelineEvent({ title, subtitle, state }: RunTimelineItemProps) {
return (
<div className="grid h-5 grid-cols-[1.125rem_1fr] text-sm">
<div className="flex items-center justify-center">
<div
className={cn(
"size-[0.3125rem] rounded-full",
state === "complete" ? "bg-success" : "bg-error"
)}
></div>
</div>
<div className="flex items-baseline justify-between gap-3">
<span className="font-medium text-text-bright">{title}</span>
{subtitle ? <span className="text-xs text-text-dimmed">{subtitle}</span> : null}
</div>
</div>
);
}

type RunTimelineLineProps = {
title: ReactNode;
state: "complete" | "delayed" | "inprogress";
};

export function RunTimelineLine({ title, state }: RunTimelineLineProps) {
return (
<div className="grid h-6 grid-cols-[1.125rem_1fr] text-xs">
<div className="flex items-stretch justify-center">
<div
className={cn(
"w-px",
state === "complete" ? "bg-success" : state === "delayed" ? "bg-text-dimmed" : ""
)}
style={
state === "inprogress"
? {
width: "1px",
height: "100%",
background:
"repeating-linear-gradient(to bottom, #3B82F6 0%, #3B82F6 50%, transparent 50%, transparent 100%)",
backgroundSize: "1px 6px",
maskImage: "linear-gradient(to bottom, black 50%, transparent 100%)",
WebkitMaskImage: "linear-gradient(to bottom, black 50%, transparent 100%)",
}
: undefined
}
></div>
</div>
<div className="flex items-center justify-between gap-3">
<span className="text-text-dimmed">{title}</span>
</div>
</div>
);
}
Loading
Loading