From 4794458e0cbf39081f5834d394b28f432f0e1a39 Mon Sep 17 00:00:00 2001 From: stefpi <19478336+stefpi@users.noreply.github.com> Date: Thu, 30 Jul 2026 20:59:29 -0700 Subject: [PATCH 1/6] clean --- src/App.jsx | 2 +- src/colors.js | 114 ------------ src/components/AppDrawer/index.jsx | 2 +- src/components/AppHeader/AccountMenu.jsx | 16 +- src/components/AppHeader/index.jsx | 15 +- src/components/BodyTeleop/ControlsBar.jsx | 10 +- src/components/BodyTeleop/Joystick.jsx | 45 ++--- src/components/BodyTeleop/SettingsMenu.jsx | 16 +- src/components/BodyTeleop/StatusBar.jsx | 32 ++-- src/components/BodyTeleop/Video.jsx | 12 +- src/components/BodyTeleop/index.jsx | 12 +- src/components/CommacareBadge.jsx | 2 +- src/components/Dashboard/AddDevice.jsx | 28 +-- src/components/Dashboard/DeviceList.jsx | 33 +--- .../Dashboard/DeviceSettingsModal.jsx | 31 ++-- src/components/Dashboard/DriveList.jsx | 36 ++-- src/components/Dashboard/DriveListEmpty.jsx | 6 +- src/components/Dashboard/DriveListItem.jsx | 28 ++- src/components/Dashboard/index.jsx | 2 +- src/components/DeviceInfo/index.jsx | 58 ++---- src/components/DriveVideo/index.jsx | 6 +- src/components/DriveView/Media.jsx | 68 +------ src/components/DriveView/index.jsx | 8 +- src/components/ErrorFallback.jsx | 6 +- src/components/Files/UploadQueue.jsx | 6 +- src/components/IosPwaPopup/index.jsx | 8 +- src/components/Navigation/index.jsx | 24 +-- src/components/PWAIcon.jsx | 6 +- src/components/Prime/PrimeCheckout.jsx | 55 +++--- src/components/Prime/PrimeManage.jsx | 123 +++++++------ src/components/Prime/index.jsx | 3 +- src/components/TimeDisplay/index.jsx | 25 ++- src/components/TimeSelect/index.jsx | 6 +- src/components/Timeline/index.jsx | 43 ++--- src/components/anonymous.jsx | 20 +-- src/components/explorer.jsx | 12 +- src/components/utils/InfoTooltip.jsx | 8 +- src/components/utils/SwitchLoading.jsx | 4 +- src/index.css | 169 ++++++++++++++++-- src/index.jsx | 3 +- src/theme.js | 61 +------ 41 files changed, 497 insertions(+), 667 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 6a0fa3c78..a374d8aba 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -123,7 +123,7 @@ class App extends Component { return ( - + ); diff --git a/src/colors.js b/src/colors.js index beb491844..58bf906ca 100644 --- a/src/colors.js +++ b/src/colors.js @@ -1,20 +1,9 @@ const Colors = { - transparent: 'transparent', white: '#fff', - darken10: 'rgba(0, 0, 0, 0.1)', - darken20: 'rgba(0, 0, 0, 0.2)', - darken30: 'rgba(0, 0, 0, 0.3)', - darken40: 'rgba(0, 0, 0, 0.4)', - darken50: 'rgba(0, 0, 0, 0.5)', - darken60: 'rgba(0, 0, 0, 0.6)', - darken70: 'rgba(0, 0, 0, 0.7)', - darken80: 'rgba(0, 0, 0, 0.8)', - darken90: 'rgba(0, 0, 0, 0.9)', white03: 'rgba(255, 255, 255, 0.03)', white05: 'rgba(255, 255, 255, 0.05)', white08: 'rgba(255, 255, 255, 0.08)', white10: 'rgba(255, 255, 255, 0.1)', - white12: 'rgba(255, 255, 255, 0.12)', white20: 'rgba(255, 255, 255, 0.2)', white30: 'rgba(255, 255, 255, 0.3)', white40: 'rgba(255, 255, 255, 0.4)', @@ -23,112 +12,20 @@ const Colors = { white70: 'rgba(255, 255, 255, 0.7)', white80: 'rgba(255, 255, 255, 0.8)', white90: 'rgba(255, 255, 255, 0.9)', - black: '#030404', - blue50: '#258FDA', blue100: '#2284c9', - blue200: '#1f79b8', - blue300: '#1c6ea8', - blue400: '#1a6397', - blue500: '#175886', - blue600: '#144d75', - blue700: '#114265', - blue800: '#0e3754', - blue900: '#0b2c43', - blue950: '#061622', - blue999: '#030b11', - lightBlue50: '#eef6fc', - lightBlue100: '#ddeef9', - lightBlue200: '#cde5f6', - lightBlue300: '#bcddf4', - lightBlue400: '#abd4f1', - lightBlue500: '#9acbee', - lightBlue600: '#8ac3eb', lightBlue700: '#79bae8', - lightBlue800: '#68b1e5', lightBlue900: '#57a9e3', - desatBlue800: '#657f92', primeBlue50: '#5e8bff', - primeBlue100: '#5984F2', primeBlue200: '#547de6', - primeBlue300: '#4b6fcc', - primeBlue400: '#4261b3', - primeBlue500: '#385399', - primeBlue600: '#2f4680', - primeBlue700: '#263866', - primeBlue800: '#1c2a4d', - primeBlue900: '#131c33', - red50: '#da2535', - red100: '#c92231', - red200: '#b81f2d', red300: '#971a25', red400: '#861721', red500: '#75141d', - red600: '#651118', - red700: '#540e14', - red800: '#430b10', - red900: '#32090c', - lightRed50: '#fceeef', - lightRed100: '#f9dde0', - lightRed200: '#f6cdd0', - lightRed300: '#f4bcc1', - lightRed400: '#f1abb1', - lightRed500: '#ee9aa2', - lightRed600: '#eb8a92', - lightRed700: '#e87983', - lightRed800: '#e56873', - lightRed900: '#e35764', - lightRed950: '#e04754', - lightRed999: '#dd3645', - green50: '#22c967', green100: '#20b85f', green200: '#1da756', green300: '#1a974e', green400: '#178645', green500: '#14753c', - green600: '#116534', - green700: '#0e542b', - green800: '#0c4323', - green900: '#09321a', - lightGreen50: '#eefcf4', - lightGreen100: '#def9e9', - lightGreen200: '#cdf6de', - lightGreen300: '#bcf4d3', - lightGreen400: '#abf1c8', - lightGreen500: '#9beebd', - lightGreen600: '#8aebb2', - lightGreen700: '#79e8a7', - lightGreen800: '#68e59c', - lightGreen900: '#25da70', - orange50: '#da6f25', - orange100: '#c96722', orange200: '#b85e1f', - orange300: '#a7551c', - orange400: '#964d19', - orange500: '#864417', - orange600: '#753c14', - orange700: '#643311', - orange800: '#532b0e', - orange900: '#42220b', - lightOrange50: '#f9e8dd', - lightOrange100: '#f6ddcc', - lightOrange200: '#f4d2bb', - lightOrange300: '#f1c7aa', - lightOrange400: '#eebc9a', - lightOrange500: '#ebb189', - lightOrange600: '#e8a678', - lightOrange700: '#e59b67', - lightOrange800: '#e08546', - lightOrange900: '#dd7a35', - yellow50: '#f1ebaa', - yellow100: '#eee79a', - yellow200: '#ebe389', - yellow300: '#e8df78', - yellow400: '#e5db67', - yellow500: '#e3d756', - yellow600: '#e0d346', - yellow700: '#ddcf35', - yellow800: '#daca25', - yellow900: '#c9bb22', grey50: '#6e7d84', grey100: '#65737a', grey200: '#5c696f', @@ -141,18 +38,7 @@ const Colors = { grey900: '#1e2224', grey950: '#151819', grey999: '#0c0e0f', - lightGrey50: '#f8f9f9', - lightGrey100: '#eeeff0', - lightGrey200: '#e3e6e8', - lightGrey300: '#d8dcdf', - lightGrey400: '#cdd3d6', - lightGrey500: '#c3c9cd', lightGrey600: '#b8c0c4', - lightGrey700: '#adb6bb', - lightGrey800: '#a3adb2', - lightGrey900: '#98a3a9', - lightGrey950: '#8d9aa1', - lightGrey999: '#77878f', }; export default Colors; diff --git a/src/components/AppDrawer/index.jsx b/src/components/AppDrawer/index.jsx index fe1f639b4..138dd475d 100644 --- a/src/components/AppDrawer/index.jsx +++ b/src/components/AppDrawer/index.jsx @@ -40,7 +40,7 @@ const AppDrawer = ({ variant={isPermanent ? 'permanent' : 'temporary'} PaperProps={{ style: { width, top: 'auto' } }} > -
+
{!isPermanent && ( diff --git a/src/components/AppHeader/AccountMenu.jsx b/src/components/AppHeader/AccountMenu.jsx index af0d41746..3cde1f494 100644 --- a/src/components/AppHeader/AccountMenu.jsx +++ b/src/components/AppHeader/AccountMenu.jsx @@ -20,7 +20,7 @@ const Version = () => { if (sha) { const commitUrl = `https://github.com/commaai/connect/commit/${sha}`; - content.push({sha.substring(0, 7)}); + content.push({sha.substring(0, 7)}); if (timestamp) { const buildDate = dayjs(timestamp).fromNow(); @@ -30,7 +30,7 @@ const Version = () => { content.push('dev'); } - return {content} + return {content} }; const AccountMenu = ({ profile, open, onClose }) => { @@ -48,15 +48,15 @@ const AccountMenu = ({ profile, open, onClose }) => { return ( <>
-
+
- {profile.email} - {profile.user_id} + {profile.email} + {profile.user_id} {version}
-
+
{ Manage Account
diff --git a/src/components/BodyTeleop/ControlsBar.jsx b/src/components/BodyTeleop/ControlsBar.jsx index 0d73baf3c..9709f2066 100644 --- a/src/components/BodyTeleop/ControlsBar.jsx +++ b/src/components/BodyTeleop/ControlsBar.jsx @@ -6,9 +6,9 @@ const CAMERAS = [ { key: 'driver', label: 'driver', num: '2' }, ]; -const btnBase = `h-11 w-[80px] rounded-xl text-[14px] font-bold tracking-[0.2px] uppercase flex items-center justify-center min-w-[44px] cursor-pointer select-none hover:text-white hover:bg-white/20 bg-glass`; -const btnInactive = `${btnBase} bg-white/10 text-white/60`; -const btnActive = `${btnBase} bg-white/30 text-white`; +const btnBase = `h-11 w-[80px] rounded-xl text-[14px] font-bold tracking-[0.2px] uppercase flex items-center justify-center min-w-[44px] cursor-pointer select-none hover:text-content hover:bg-content/20 bg-glass`; +const btnInactive = `${btnBase} bg-content/10 text-content/60`; +const btnActive = `${btnBase} bg-content/30 text-content`; const controlsGroupBase = 'z-10 flex flex-row items-stretch gap-3.5 rounded-[20px] p-4 bg-glass-dark'; const controlsGroupLandscape = 'absolute bottom-4 left-4'; @@ -87,7 +87,7 @@ const ControlsBar = ({ ))}
- Camera + Camera
)}
@@ -99,7 +99,7 @@ const ControlsBar = ({ >
- Snapshot + Snapshot
); diff --git a/src/components/BodyTeleop/Joystick.jsx b/src/components/BodyTeleop/Joystick.jsx index bcea115e8..7dd92b488 100644 --- a/src/components/BodyTeleop/Joystick.jsx +++ b/src/components/BodyTeleop/Joystick.jsx @@ -3,28 +3,31 @@ import React, { useState, useEffect, useRef, useCallback } from 'react'; import { getOrientationSource } from '../../hooks/window'; const TriggerGroup = ({ bumperActive, bumperLabel, bumperKey, cameraActive, triggerValue, triggerColor, triggerKey, directionLabel }) => { - const activeStyle = cameraActive ? { background: 'rgba(59,130,246,0.35)', borderColor: 'rgba(59,130,246,0.5)' } : undefined; + const activeStyle = cameraActive ? { + background: 'color-mix(in srgb, var(--color-action-hover) 35%, transparent)', + borderColor: 'color-mix(in srgb, var(--color-action-hover) 50%, transparent)', + } : undefined; return (
- + {bumperLabel}
- + {bumperKey}
-
+
- + {triggerKey}
- + {directionLabel}
@@ -39,17 +42,17 @@ const ControllerOverlay = ({ gamepadSteering, gamepadGas, gamepadBrake, gamepadL
- L Stick — Steering -
-
- {'\u25C0'} - {'\u25B6'} + L Stick — Steering +
+
+ {'\u25C0'} + {'\u25B6'}
@@ -58,7 +61,7 @@ const ControllerOverlay = ({ gamepadSteering, gamepadGas, gamepadBrake, gamepadL
); @@ -72,7 +75,7 @@ const TouchJoystick = ({ className, thumbPos, joystickAreaRef, onTouchStart, onT return (
e.preventDefault()} > -
-
-
+
+
+
diff --git a/src/components/BodyTeleop/SettingsMenu.jsx b/src/components/BodyTeleop/SettingsMenu.jsx index bed124b57..9421ec8fd 100644 --- a/src/components/BodyTeleop/SettingsMenu.jsx +++ b/src/components/BodyTeleop/SettingsMenu.jsx @@ -14,7 +14,7 @@ const QUALITY_OPTIONS = [ { key: 'low', label: 'low', bitrate: '500 kbps' }, ]; -const rowClass = 'flex items-center h-9 px-3.5 gap-3 cursor-pointer select-none text-[13px] text-white/85 hover:bg-white/10 transition-colors whitespace-nowrap'; +const rowClass = 'flex items-center h-9 px-3.5 gap-3 cursor-pointer select-none text-[13px] text-content/85 hover:bg-content/10 transition-colors whitespace-nowrap'; const pageClass = 'absolute top-0 left-0 w-max min-w-[200px] py-1.5 transition-all duration-200 ease-out'; const SettingsMenu = ({ onQualityChange, options = QUALITY_OPTIONS }) => { @@ -58,7 +58,7 @@ const SettingsMenu = ({ onQualityChange, options = QUALITY_OPTIONS }) => { return (
@@ -89,7 +89,7 @@ const SettingsMenu = ({ onQualityChange, options = QUALITY_OPTIONS }) => { >
setView('quality')}> Quality - + {selected?.label} @@ -106,18 +106,18 @@ const SettingsMenu = ({ onQualityChange, options = QUALITY_OPTIONS }) => { pointerEvents: open && view === 'quality' ? 'auto' : 'none', }} > -
setView('main')}> - +
setView('main')}> + Quality (Bitrate)
-
+
{options.map((opt) => (
selectQuality(opt.key)}> - {opt.key === quality && } + {opt.key === quality && } {opt.label} - {opt.bitrate && {opt.bitrate}} + {opt.bitrate && {opt.bitrate}}
))}
diff --git a/src/components/BodyTeleop/StatusBar.jsx b/src/components/BodyTeleop/StatusBar.jsx index 5288643a9..c4287748f 100644 --- a/src/components/BodyTeleop/StatusBar.jsx +++ b/src/components/BodyTeleop/StatusBar.jsx @@ -13,8 +13,8 @@ const PACKET_LOSS_POOR = 0.02; const RTT_POOR_MS = 250; const QUALITY_INDICATOR = { - good: { color: '#22c967', label: 'connected' }, - poor: { color: '#f5c542', label: 'poor connection' }, + good: { color: 'var(--color-success)', label: 'connected' }, + poor: { color: 'var(--color-warning)', label: 'poor connection' }, }; const STATS_ROWS = [ @@ -273,28 +273,28 @@ export const StatsPanel = ({ isLandscape, stats, latency, latencyHistory }) => { if (showInCompact == false && compact) return; return (
- {label} - {stats?.[key] ?? '--'} + {label} + {stats?.[key] ?? '--'}
) })}
- {!compact &&
} + {!compact &&
}
- {!compact &&
{"FRAME LATENCY"}
} + {!compact &&
{"FRAME LATENCY"}
} {LATENCY_LAYERS.map(({ label, key, labelColor }) => (
{label} - {fmtMs(latency?.[key])} + {fmtMs(latency?.[key])}
))}
- Frame Latency - {fmtMs(latency?.totalMs)} + Frame Latency + {fmtMs(latency?.totalMs)}
- - {!compact &&
} + + {!compact &&
}
); }; @@ -309,11 +309,11 @@ const StatsMenu = ({ return (
- + stats
@@ -341,12 +341,12 @@ const StatusBar = ({ style={{ backgroundColor: indicator.color }} title={indicator.label} /> - {stats?.rtt ?? '--'} + {stats?.rtt ?? '--'}
{battery && (
- - {battery.level}% + + {battery.level}%
)} {
{connecting ? ( <> - - Connecting... + + Connecting... ) : canRetry ? ( ) : null} {error && ( -
+
{error}
)} @@ -70,7 +70,7 @@ const Video = ({ }, [connectionTimeLabel]); return ( -
+