Skip to content

armgit / plexo

Public Imported from GitHub
0

Speed up downloads by combining multiple network connections in parallel

Add a pill toggle variant and make main.css Tailwind-first

Anmol Kapil97b001c24679
diff --git a/src/renderer/index.html b/src/renderer/index.html
index 2e4832c..419f8e9 100644
--- a/src/renderer/index.html
+++ b/src/renderer/index.html
@@ -1,5 +1,5 @@
<!doctype html>
-<html lang="en">
+<html lang="en" class="h-full">
<head>
<meta charset="UTF-8" />
<title>Plexo</title>
@@ -10,8 +10,8 @@
/>
</head>
- <body>
- <div id="root"></div>
+ <body class="h-full overflow-hidden bg-background text-foreground antialiased select-none">
+ <div id="root" class="h-full"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css
index 62e30a0..03d848c 100644
--- a/src/renderer/src/assets/main.css
+++ b/src/renderer/src/assets/main.css
@@ -37,13 +37,6 @@
--border-strong: #b9b9bb;
--footer-border: #d8d8da;
- --button-secondary-bg: linear-gradient(#fefefe, #f3f3f3);
- --button-secondary-border: var(--border-strong);
- --button-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
- --button-disabled-bg: #f4f4f5;
- --button-disabled-border: #d2d2d4;
- --button-disabled-text: #a8a8ac;
-
--icon-muted: #c2c2c6;
--icon-muted-strong: #b0b0b2;
--scrollbar-thumb: #d0d0d2;
@@ -81,7 +74,6 @@
--color-accent: #d97706;
--color-accent-onsolid: #ffffff;
- --color-accent-shadow: rgba(217, 119, 6, 0.25);
--color-success: #1f8a70;
--color-danger: #dc2626;
@@ -151,13 +143,6 @@
--border-strong: #33383c;
--footer-border: #2b2f33;
- --button-secondary-bg: #262a2d;
- --button-secondary-border: var(--border-strong);
- --button-shadow: none;
- --button-disabled-bg: #232628;
- --button-disabled-border: #2b2f33;
- --button-disabled-text: #5d6268;
-
--icon-muted: #33383c;
--icon-muted-strong: #3a3f44;
--scrollbar-thumb: #3a3f44;
@@ -191,7 +176,6 @@
--color-accent: #d8a44c;
--color-accent-onsolid: #1b1408;
- --color-accent-shadow: rgba(216, 164, 76, 0.22);
--color-success: #4ea89a;
--color-danger: #eda3a3;
@@ -202,52 +186,36 @@
}
}
-* {
- box-sizing: border-box;
-}
-
-html,
-body,
-#root {
- height: 100%;
- margin: 0;
-}
-
-body {
- overflow: hidden;
- font-family:
- 'Manrope',
- -apple-system,
- 'SF Pro Text',
- 'Helvetica Neue',
- Helvetica,
- sans-serif;
- -webkit-font-smoothing: antialiased;
- background: var(--bg);
- color: var(--text);
- user-select: none;
-}
-
-input,
-[contenteditable] {
- user-select: text;
-}
+/* Layered, not plain global CSS, so Tailwind utility classes still win over these resets.
+ Tailwind puts its own utilities in a later layer than base styles, and unlayered CSS beats
+ every layer regardless of specificity, so an unlayered button font reset here previously
+ overrode every text and font utility on every button in the app. box-sizing, margin and
+ padding resets, and the default font family, are already handled by Tailwind Preflight, so
+ they are not repeated here. Body, html and root element sizing now live as utility classes
+ in index.html instead. */
+@layer base {
+ input,
+ [contenteditable] {
+ user-select: text;
+ }
-button {
- font: inherit;
-}
+ button {
+ font: inherit;
+ }
-::-webkit-scrollbar {
- width: 10px;
-}
+ /* No core Tailwind utility for scrollbar pseudo-elements. */
+ ::-webkit-scrollbar {
+ width: 10px;
+ }
-::-webkit-scrollbar-track {
- background: transparent;
-}
+ ::-webkit-scrollbar-track {
+ background: transparent;
+ }
-::-webkit-scrollbar-thumb {
- background-color: var(--scrollbar-thumb);
- border-radius: 9999px;
+ ::-webkit-scrollbar-thumb {
+ background-color: var(--scrollbar-thumb);
+ border-radius: 9999px;
+ }
}
@keyframes plexo-dash {
diff --git a/src/renderer/src/components/DevToolsPanel.tsx b/src/renderer/src/components/DevToolsPanel.tsx
index 9aa556f..a3a564b 100644
--- a/src/renderer/src/components/DevToolsPanel.tsx
+++ b/src/renderer/src/components/DevToolsPanel.tsx
@@ -342,16 +342,12 @@ export function DevToolsPanel(): React.JSX.Element | null {
setConnectionsPerNetwork(Number(values[0]))
}}
aria-labelledby="devtools-connections-label"
- variant="default"
+ variant="pill"
+ size="xs"
spacing={1}
>
{PRESET_CONNECTIONS.map((preset) => (
- <ToggleGroupItem
- key={preset}
- value={String(preset)}
- size="sm"
- className="h-5 border border-border bg-muted px-1.5 font-mono text-[10px] font-semibold text-[var(--text-secondary)] aria-pressed:!border-primary aria-pressed:!bg-primary aria-pressed:!text-primary-foreground"
- >
+ <ToggleGroupItem key={preset} value={String(preset)}>
{preset}×
</ToggleGroupItem>
))}
diff --git a/src/renderer/src/components/ui/toggle.tsx b/src/renderer/src/components/ui/toggle.tsx
index b3a7320..7d43025 100644
--- a/src/renderer/src/components/ui/toggle.tsx
+++ b/src/renderer/src/components/ui/toggle.tsx
@@ -8,11 +8,15 @@ const toggleVariants = cva(
variants: {
variant: {
default: 'bg-transparent',
- outline: 'border border-input bg-transparent hover:bg-muted'
+ outline: 'border border-input bg-transparent hover:bg-muted',
+ // A selectable preset pill (e.g. "1×"/"2×"/"4×"/"8×" stream-count pickers) — muted/outlined
+ // at rest, switches to the primary/accent color once picked.
+ pill: 'border border-border bg-muted font-mono text-[var(--text-secondary)] hover:bg-muted hover:text-[var(--text-secondary)] aria-pressed:border-primary aria-pressed:bg-primary aria-pressed:text-primary-foreground data-[state=on]:border-primary data-[state=on]:bg-primary data-[state=on]:text-primary-foreground'
},
size: {
default:
'h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
+ xs: "h-5 min-w-5 gap-1 rounded-[min(var(--radius-md),8px)] px-1.5 text-[10px] font-semibold [&_svg:not([class*='size-'])]:size-3",
sm: "h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
lg: 'h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2'
}
diff --git a/src/renderer/src/screens/IdleScreen.tsx b/src/renderer/src/screens/IdleScreen.tsx
index 13f94e7..19b58e2 100644
--- a/src/renderer/src/screens/IdleScreen.tsx
+++ b/src/renderer/src/screens/IdleScreen.tsx
@@ -269,16 +269,12 @@ export function IdleScreen(): React.JSX.Element {
}}
disabled={isSingleStreamOnly}
aria-labelledby="idle-streams-label"
- variant="default"
+ variant="pill"
+ size="xs"
spacing={1}
>
{PRESET_STREAMS.map((preset) => (
- <ToggleGroupItem
- key={preset}
- value={String(preset)}
- size="sm"
- className="h-5 border border-border bg-muted px-1.5 font-mono text-[10px] font-semibold text-[var(--text-secondary)] aria-pressed:!border-primary aria-pressed:!bg-primary aria-pressed:!text-primary-foreground"
- >
+ <ToggleGroupItem key={preset} value={String(preset)}>
{preset}×
</ToggleGroupItem>
))}