Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
8f52b84
make logo responsive to light/dark mode
ken-zlai Mar 3, 2025
a5f5d5d
v1 pass
ken-zlai Mar 4, 2025
13de8ee
better color for success
ken-zlai Mar 4, 2025
05e9cb8
add success scale
ken-zlai Mar 4, 2025
6d1915c
job tracker colors light mode
ken-zlai Mar 4, 2025
8ca946e
mods to icon color bg
ken-zlai Mar 4, 2025
397167e
add mode-watcher
ken-zlai Mar 4, 2025
8c9137b
Revert "mods to icon color bg"
ken-zlai Mar 4, 2025
4bff511
add ModeSwitcher
ken-zlai Mar 4, 2025
3e26c1a
slider
ken-zlai Mar 4, 2025
7a6dcea
prevent flicker on load
ken-zlai Mar 4, 2025
6babaec
upgrade layerchart
ken-zlai Mar 4, 2025
3d2d8e0
remove bar chart borders
ken-zlai Mar 4, 2025
c6e4f47
svelte-ux 1.0.1
ken-zlai Mar 5, 2025
b5654bc
put logo back for favicon
ken-zlai Mar 5, 2025
b93257c
space
ken-zlai Mar 5, 2025
e633f4d
Merge branch 'main' into ken/light-mode
ken-zlai Mar 5, 2025
c227981
npm install
ken-zlai Mar 5, 2025
6f848bb
invert colors
ken-zlai Mar 5, 2025
fdabfc4
contrast for code
ken-zlai Mar 5, 2025
83fe824
adjust borders
ken-zlai Mar 5, 2025
4dccdb1
make colors less muddy
ken-zlai Mar 5, 2025
12a7c5a
adjust active-border for better contrast
ken-zlai Mar 5, 2025
62c7016
remove comments
ken-zlai Mar 5, 2025
9a880b0
adjust color for better contrast
ken-zlai Mar 5, 2025
cf5b8a8
Merge branch 'main' into ken/light-mode
ken-zlai Mar 5, 2025
a7aa243
make icon button slightly smaller
ken-zlai Mar 5, 2025
099118a
Merge remote-tracking branch 'origin/ken/light-mode' into ken/light-mode
ken-zlai Mar 5, 2025
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
26 changes: 18 additions & 8 deletions frontend/package-lock.json

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

5 changes: 3 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@
"clsx": "^2.1.1",
"d3": "^7.9.0",
"dotenv": "^16.4.7",
"layerchart": "^1.0.3",
"layerchart": "^1.0.5",
"lodash": "^4.17.21",
"mode-watcher": "^0.5.1",
"svelte-inspect-value": "0.3.0",
"svelte-ux": "^1.0.0",
"svelte-ux": "^1.0.1",
"tailwind-merge": "^2.6.0",
"tailwind-variants": "^0.3.1"
},
Expand Down
125 changes: 111 additions & 14 deletions frontend/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,21 @@

@layer base {
:root {
--background: 0 0% 100%;
--background: var(--neutral-100);
--foreground: 0 0% 3.9%;

--muted: 0 0% 96.1%;
--muted-foreground: 0 0% 45.1%;
--muted-foreground: var(--neutral-800);
--muted-icon-neutral: var(--neutral-700);
--muted-icon-primary: var(--primary-700);

--popover: 0 0% 100%;
--popover-foreground: 0 0% 3.9%;

--card: 0 0% 100%;
--card-foreground: 0 0% 3.9%;

--border: 0 0% 89.8%;
--border: var(--neutral-300);
--input: 0 0% 89.8%;

--primary: 0 0% 9%;
Expand All @@ -70,6 +72,101 @@
--ring: 0 0% 3.9%;

--radius: 0.5rem;

--neutral-50: 0 0% 98%;
--neutral-100: 0 0% 95%;
--neutral-200: 0 0% 93%;
--neutral-300: 0 0% 90%;
--neutral-400: 0 0% 87%;
--neutral-500: 0 0% 79%;
--neutral-600: 0 0% 71%;
--neutral-700: 0 0% 63%;
--neutral-800: 0 0% 39%;
--neutral-900: 0 0% 23%;
--neutral-950: 0 0% 5%;

--primary-50: 351 100% 97%;
--primary-100: 354 100% 93%;
--primary-200: 349 100% 88%;
--primary-300: 345 95% 84%;
--primary-400: 345 90% 79%;
--primary-500: 346 85% 73%;
--primary-600: 347 80% 55%;
--primary-700: 347 75% 44%;
--primary-800: 345 70% 37%;
--primary-900: 348 65% 30%;
--primary-950: 352 60% 17%;

--warning-50: 41 66% 10%;
--warning-100: 40 29% 8%;
--warning-200: 41 66% 10%;
--warning-300: 41 100% 12%;
--warning-400: 42 100% 14%;
--warning-500: 43 81% 19%;
--warning-600: 42 58% 26%;
--warning-700: 42 56% 34%;
--warning-800: 44 100% 55%;
--warning-900: 45 100% 60%;
--warning-950: 40 100% 86%;

--success-50: 151 63% 92%;
--success-100: 152 60% 85%;
--success-200: 153 65% 75%;
--success-300: 155 70% 65%;
--success-400: 157 80% 50%;
--success-500: 159 98% 23%;
--success-600: 159 90% 20%;
--success-700: 159 80% 17%;
--success-800: 159 70% 14%;
--success-900: 159 60% 12%;
--success-950: 159 46% 11%;

/* Base colors for reuse */
--color-failed: 10 35% 55%;
--color-failed-border: 10 32% 48%;
--color-failed-active: 10 80% 30%;

--color-running: 250 40% 60%;
--color-running-border: 250 38% 52%;
--color-running-active: 250 80% 30%;

/* Job status colors using base variables */
--job-RUNNING-bg: var(--color-running);
--job-RUNNING-border: var(--color-running-border);
--job-RUNNING-active-border: var(--color-running-active);

--job-WAITING_FOR_UPSTREAM-bg: 210 40% 58%;
--job-WAITING_FOR_UPSTREAM-border: 210 38% 50%;
--job-WAITING_FOR_UPSTREAM-active-border: 210 80% 30%;

--job-FAILED-bg: var(--color-failed);
--job-FAILED-border: var(--color-failed-border);
--job-FAILED-active-border: var(--color-failed-active);

--job-SUCCESS-bg: 160 45% 52%;
--job-SUCCESS-border: 160 42% 45%;
--job-SUCCESS-active-border: 160 80% 30%;

--job-UPSTREAM_FAILED-bg: var(--color-failed);
--job-UPSTREAM_FAILED-border: var(--color-failed-border);
--job-UPSTREAM_FAILED-active-border: var(--color-failed-active);

--job-QUEUED-bg: 0 0% 52%;
--job-QUEUED-border: 0 0% 46%;
--job-QUEUED-active-border: 0 0% 20%; /* Back to 20% lightness */

--job-UPSTREAM_MISSING-bg: 38 40% 58%;
--job-UPSTREAM_MISSING-border: 38 38% 50%;
--job-UPSTREAM_MISSING-active-border: 38 80% 30%;

--job-WAITING_FOR_RESOURCES-bg: var(--color-running);
--job-WAITING_FOR_RESOURCES-border: var(--color-running-border);
--job-WAITING_FOR_RESOURCES-active-border: var(--color-running-active);

/* Scrollbar colors */
--scrollcolor: hsla(0, 0%, 87%, 1);
--scrollbackground: transparent;
scrollbar-color: var(--scrollcolor) var(--scrollbackground);
}

.dark {
Expand Down Expand Up @@ -114,17 +211,17 @@
--primary-900: 348 100% 78%;
--primary-950: 352 100% 91%;

--warning-50: 41 66% 10%;
--warning-100: 40 29% 8%;
--warning-200: 41 66% 10%;
--warning-300: 41 100% 12%;
--warning-400: 42 100% 14%;
--warning-500: 43 81% 19%;
--warning-600: 42 58% 26%;
--warning-700: 42 56% 34%;
--warning-800: 44 100% 55%;
--warning-900: 45 100% 60%;
--warning-950: 40 100% 86%;
--success-50: 159 46% 11%;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up moving the warning colors to :root so they are shared between light and dark mode for now.

--success-100: 159 60% 12%;
--success-200: 159 70% 14%;
--success-300: 159 80% 17%;
--success-400: 159 90% 20%;
--success-500: 160 66% 38%;
--success-600: 157 80% 50%;
--success-700: 155 70% 65%;
--success-800: 153 65% 75%;
--success-900: 152 60% 85%;
--success-950: 151 63% 92%;

--secondary: 0 0% 14.9%;
--secondary-foreground: 0 0% 98%;
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/app.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<!doctype html>
<html lang="en" class="dark">
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helps prevent a flicker when the page initially loads

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do something similar in LayerStack/Svelte UX (little trickier with multiple dark themes). Nice work!

const modeWatcherMode = localStorage.getItem('mode-watcher-mode');
if (
modeWatcherMode === 'dark' ||
(modeWatcherMode !== 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches)
) {
document.documentElement.classList.add('dark');
}
</script>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/ExpandableCell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div class="flex items-center justify-center h-full relative">
<CellDivider />
<button
class="flex items-center justify-between bg-neutral-300 border border-neutral-400 rounded-md p-[5px] pl-0 w-full mr-[18px] max-w-[440px] max-h-[32px]"
class="flex items-center justify-between bg-neutral-50 dark:bg-neutral-300 border border-neutral-400 rounded-md p-[5px] pl-0 w-full mr-[18px] max-w-[440px] max-h-[32px]"
style:margin-left={`calc(${depth * 0.75}rem)`}
onclick={() => ($isExpanded = !$isExpanded)}
title={name}
Expand Down
37 changes: 37 additions & 0 deletions frontend/src/lib/components/Logo.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<script lang="ts">
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a Logo.svelte for easier changing of fill

const { class: className }: { class?: string } = $props();
</script>

<svg
class={className}
width="240"
height="240"
viewBox="0 0 240 240"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M51 120H0C29.5372 80 59.0743 40 63 0H114C110.074 40 80.5372 80 51 120Z"
fill="currentColor"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M189 120H240C210.463 160 180.926 200 177 240H126C129.926 200 159.463 160 189 120Z"
fill="currentColor"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M114 240H63C70.8513 160 181.149 79.9999 189 0H240C232.149 79.9999 121.851 160 114 240Z"
fill="currentColor"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M51 240H0C7.85135 160 118.149 79.9999 126 0H177C169.149 79.9999 58.8513 160 51 240Z"
fill="currentColor"
/>
</svg>
27 changes: 27 additions & 0 deletions frontend/src/lib/components/ModeSwitcher.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script lang="ts">
import IconSun from '~icons/heroicons/sun';
import IconMoon from '~icons/heroicons/moon';
import { resetMode, setMode } from 'mode-watcher';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { Button } from '$lib/components/ui/button/index.js';
</script>

<DropdownMenu.Root>
<DropdownMenu.Trigger asChild let:builder>
<Button builders={[builder]} variant="outline" size="icon">
<IconSun
class="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
/>
<IconMoon
class="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"
/>
<span class="sr-only">Toggle theme</span>
</Button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a touch big to me. I see it's ~36x36px. On shadcn-svelte's docs it's 32x32. Maybe make it 1rem instead of 1.2rem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! I changed the size of the button to 2rem (since our base size is 16px, 2rem comes out to 32px w/h)

</DropdownMenu.Trigger>
<DropdownMenu.Content align="end">
<DropdownMenu.Item on:click={() => setMode('light')}>Light</DropdownMenu.Item>
<DropdownMenu.Item on:click={() => setMode('dark')}>Dark</DropdownMenu.Item>
<DropdownMenu.Item on:click={() => resetMode()}>System</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu.Root>
3 changes: 2 additions & 1 deletion frontend/src/lib/components/NavigationBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import { Separator } from '$lib/components/ui/separator';
import IconChatBubbleOvalLeft16Solid from '~icons/heroicons/chat-bubble-oval-left-16-solid';
import IconQuestionMarkCircle16Solid from '~icons/heroicons/question-mark-circle-16-solid';
import Logo from '$lib/components/Logo.svelte';

type Props = {
navItems: EntityConfig[];
Expand Down Expand Up @@ -105,7 +106,7 @@
<nav class="w-60 p-3 flex flex-col">
<div class="ml-2 mt-1 mb-10 flex items-center justify-between">
<Button variant="link" href="/" class="p-0 h-6 w-6">
<img src="/logo.svg" alt="Zipline Logo" />
<Logo class="text-foreground" />
</Button>
</div>
<Button
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/NavigationSlider.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{#if $navigating}
<div
class="fixed w-full top-0 right-0 left-0 h-[1px] z-50 bg-white"
class="fixed w-full top-0 right-0 left-0 h-[1px] z-50 bg-black dark:bg-white"
in:slide={{ duration: 2000, axis: 'x', easing: expoOut }}
></div>
{/if}
6 changes: 3 additions & 3 deletions frontend/src/lib/components/charts/PercentileLineChart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
x="date"
y="value"
series={[
{ label: 'p95', color: '#4B92FF', index: 2 },
{ label: 'p50', color: '#7DFFB3', index: 1 },
{ label: 'p5', color: '#FDDD61', index: 0 }
{ label: 'p95', color: '#2976E6', index: 2 },
{ label: 'p50', color: '#3DDC91', index: 1 },
{ label: 'p5', color: '#E5B72D', index: 0 }
].map((c) => {
const timestamps = data.timestamps ?? [];
const values = data.percentiles?.[c.index] ?? [];
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/ui/badge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const badgeVariants = tv({
outline: 'text-foreground',
key: '',
'key-bg': 'border-transparent bg-neutral-400',
success: 'bg-[#0F2920] text-[#21A378] border-transparent' // todo use our style guide when it is created
success: 'bg-success-50 text-success-500 border-transparent' // todo use our style guide when it is created
}
},
compoundVariants: [
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/ui/tabs/tabs-trigger.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
export { className as class };

const _class = cn(
'ring-offset-background focus-visible:ring-ring border-b-[3px] border-transparent data-[state=active]:border-b-[3px] data-[state=active]:border-primary-800 data-[state=active]:text-primary-800 inline-flex items-center justify-center whitespace-nowrap px-[10px] py-[5px] text-regular transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm z-10 not-first:ml-5',
'ring-offset-background focus-visible:ring-ring border-b-[3px] border-transparent data-[state=active]:border-b-[3px] data-[state=active]:border-primary-600 dark:data-[state=active]:border-primary-800 data-[state=active]:text-primary-600 dark:data-[state=active]:text-primary-800 inline-flex items-center justify-center whitespace-nowrap px-[10px] py-[5px] text-regular transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 z-10 not-first:ml-5',
className
);

Expand Down
Loading