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 (
{ cameraError || 'Camera not found, please enable camera access.' } -
You can also scan the QR code using any other QR code reader application. -
{ pairError }
@@ -424,10 +424,10 @@ class AddDevice extends Component { ) } { pairDongleId && ( <> -{'Successfully paired device '} { pairDongleId } -
{deviceNamePretty(device)} -
{ this.state.error }
{ this.state.unpairError }
Unpairing will also cancel comma prime and {' '} permanently end your commacare extended warranty. @@ -400,9 +399,9 @@ class DeviceSettingsModal extends Component { Your standard 1-year warranty still applies for any remaining time. {' '} What is commacare? -
Unpairing will also cancel the comma prime subscription for this device.
)}More info
make sure to enable the “Record and Upload Driver Camera” toggle
> ); diff --git a/src/components/DriveView/index.jsx b/src/components/DriveView/index.jsx index ef21a19ab..16e95b0be 100644 --- a/src/components/DriveView/index.jsx +++ b/src/components/DriveView/index.jsx @@ -3,7 +3,7 @@ import { connect } from 'react-redux'; import Obstruction from 'obstruction'; import dayjs from 'dayjs'; -import { IconButton, Typography } from '@material-ui/core'; +import { IconButton } from '@material-ui/core'; import { popTimelineRange, pushTimelineRange, updateSegmentRange } from '../../actions'; import { ArrowBackBold, CloseBold } from '../../icons'; @@ -48,7 +48,7 @@ class DriveView extends Component { return (Route does not exist.
:
{information}
Add to home screen
+
Install this webapp on your home screen:
{' '}
@@ -131,7 +131,7 @@ class IosPwaPopup extends Component {
{' '}
and then ‘Add to Home Screen’
-
Could not initialize map.
+{mapError}
{title}
+{timeFromNow(carLocation.time)}
{Utils.formatPlaceName(searchSelect)} {Utils.formatPlaceAddress(searchSelect)} -
comma prime
{this.props.device?.eligible_features?.commacare ? 'Put your car on the internet with comma prime and extend your 1-year limited warranty with commacare' : 'Put your car on the internet with comma prime'} -
INCLUDES COMMACARE -
Fetching SIM data
{ disabledDataPlanText }
{'Learn more about comma prime from our '} FAQ -
{ error }
{ chargeText }
Waiting for confirmed payment
Processing subscription
comma prime activated
{subscription.is_prime_sim && ( -Connectivity will be enabled as soon as activation propagates to your local cell tower. Rebooting your device may help. -
{planName} {` ${planSubtext}`} -
{joinDate}
{nextPaymentDate}
{cancelAtDate}
{`$${(subscription.amount / 100).toFixed(2)}`} -
{this.state.error}
Your prime subscription will be canceled on May 15th unless you replace the SIM card in your device. A new SIM card can be ordered from the shop . Use discount code SIMSWAP at checkout to receive a free SIM card. -
Standard comma prime discontinued for {deviceTypePretty(device.device_type)} -
{this.state.planSwitchMessage}
{this.state.planSwitchTarget === 'data' ? 'Your plan now includes data for $24/month.' : 'Your plan no longer includes data and costs $14/month.'} -
{this.state.planSwitchTarget === 'data' ? ( <> The Standard plan costs $24/month, includes a data plan, and is {' '} - only available in the U.S. + only available in the U.S. > ) : 'The Lite plan costs $14/month and does not include a data plan.'} -
Switching your plan…
{this.state.planSwitchMessage}
{this.state.cancelError}
{this.state.cancelSuccess}
{`Device: ${alias} (${dongleId})`} -
We're sorry to see you go. -
Your subscription will be cancelled immediately and can be resumed at any time. -
Cancelling will permanently end your extended warranty coverage. {' '} Your standard 1-year warranty still applies for any remaining time. {' '} What is commacare? -
No access
); } if (device.prime || stripeSuccess) { return ({ displayTime } -
comma connect
+Manage your comma device, view your drives, and use comma prime features -
Sign in with Google
AppleID.auth.signIn()} className={classes.logInButton}>Sign in with Apple
Sign in with GitHub
diff --git a/src/components/explorer.jsx b/src/components/explorer.jsx index 7c43e3a31..213d9ad5b 100644 --- a/src/components/explorer.jsx +++ b/src/components/explorer.jsx @@ -4,7 +4,7 @@ import Obstruction from 'obstruction'; import localforage from 'localforage'; import { replace } from 'connected-react-router'; -import { withStyles, Button, CircularProgress, Divider, Modal, Paper, Typography } from '@material-ui/core'; +import { withStyles, Button, CircularProgress, Divider, Modal, Paper } from '@material-ui/core'; import 'mapbox-gl/src/css/mapbox-gl.css'; import { devices as Devices } from '../api'; @@ -28,7 +28,7 @@ import NoDeviceUpsell from './DriveView/NoDeviceUpsell'; const styles = (theme) => ({ window: { - background: 'linear-gradient(180deg, #1D2225 0%, #16181A 100%)', + background: 'linear-gradient(180deg, var(--color-surface) 0%, var(--color-canvas) 100%)', display: 'flex', flexDirection: 'column', }, @@ -236,17 +236,17 @@ class ExplorerApp extends Component {{'Successfully paired device '} { pairDongleId } -
{ pairError }
}{title}
> )} diff --git a/src/components/utils/SwitchLoading.jsx b/src/components/utils/SwitchLoading.jsx index 89a233df2..9e93c32ea 100644 --- a/src/components/utils/SwitchLoading.jsx +++ b/src/components/utils/SwitchLoading.jsx @@ -1,7 +1,7 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { withStyles, Switch, FormControlLabel, Popper, Typography } from '@material-ui/core'; +import { withStyles, Switch, FormControlLabel, Popper } from '@material-ui/core'; import Colors from '../../colors'; import { ErrorOutline } from '../../icons'; @@ -121,7 +121,7 @@ class SwitchLoading extends Component { anchorEl={ this.state.errorPopper } className={classes.copiedPopover} > -{ this.state.error }
> )} diff --git a/src/index.css b/src/index.css index 1023f5a09..24ce5c89e 100644 --- a/src/index.css +++ b/src/index.css @@ -11,6 +11,57 @@ @plugin "@tailwindcss/typography"; @theme { + /* + * Semantic colour roles + * --------------------- + * Keep component classes coupled to purpose rather than palette values. + */ + + /* Foundations */ + --color-canvas: #16181a; + --color-canvas-deep: #030404; + --color-scrim: #000000; + --color-surface: #1d2225; + --color-surface-muted: #272d30; + --color-surface-raised: #30373b; + --color-surface-overlay: #1b2023; + --color-surface-overlay-deep: #111516; + + /* Content and boundaries */ + --color-content: #ffffff; + --color-content-inverse: #000000; + --color-content-subtle: #74838e; + --color-boundary-strong: #d8dddf; + --color-progress: #525e66; + --color-field: #ffffff; + --color-field-hover: #dddddd; + --color-field-muted: #d1d1d1; + + /* Actions */ + --color-action: #2563eb; + --color-action-hover: #3b82f6; + --color-link: #60a5fa; + + /* Status */ + --color-success: #22c967; + --color-success-content: #dcfce7; + --color-warning: #f5c542; + --color-danger: #dc2626; + --color-danger-content: #fca5a5; + --color-feedback-error: #ff0000; + --color-feedback-success: #00ff00; + + /* Driving states */ + --color-driving: #175886; + --color-engaged: #178645; + --color-engaged-override: #919b95; + --color-alert: #da6f25; + --color-alert-critical: #c92231; + --color-bookmark: #e3d756; + + /* Data visualisation */ + --color-timeline-track: #25333d; + --animate-fadein: fadein 0.25s; --breakpoint-xxs: 360px; --breakpoint-xs: 480px; @@ -41,13 +92,41 @@ } :root { + /* + * Typography + * ---------- + * These values mirror the Material UI typography scale used on master. + * Native elements inherit the body style; type-* classes cover variants. + */ + --font-text: 'Inter', sans-serif; + --font-weight-regular: 400; + --font-weight-medium: 500; + --font-size-body: 0.875rem; + --font-size-caption: 0.75rem; + --font-size-h1: 1.3125rem; + --font-size-h2: 1rem; + --line-height-body: 1.46429em; + --line-height-body-strong: 1.71429em; + --line-height-caption: 1.375em; + --line-height-h1: 1.16667em; + --line-height-h2: 1.5em; + --color-text-primary: color-mix(in srgb, var(--color-content) 87%, transparent); + --color-text-secondary: color-mix(in srgb, var(--color-content) 54%, transparent); + color-scheme: dark; - background: #16181A; + background: var(--color-canvas); } html { + box-sizing: border-box; + color: var(--color-text-primary); + font-family: var(--font-text); font-size: 16px; + font-weight: var(--font-weight-regular); + line-height: var(--line-height-body); -webkit-tap-highlight-color: transparent; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; margin-top: env(safe-area-inset-top); margin-bottom: env(safe-area-inset-bottom); @@ -55,15 +134,80 @@ html { margin-right: env(safe-area-inset-right); } +*, +*::before, +*::after { + box-sizing: inherit; +} + body { - background: #16181A; - font-family: 'Inter', sans-serif; + background: var(--color-canvas); + color: inherit; + font-family: inherit; + font-size: var(--font-size-body); + font-weight: var(--font-weight-regular); + line-height: var(--line-height-body); scrollbar-gutter: stable; overflow-y: scroll; margin: 0; padding: 0; } +button, +input, +optgroup, +select, +textarea { + font: inherit; +} + +/* + * Native text elements + * -------------------- + * Replaces Material UI Typography's root reset and variants. + */ + +p, +h1, +h2, +aside { + display: block; + margin: 0; +} + +h1 { + color: var(--color-text-primary); + font-family: var(--font-text); + font-size: var(--font-size-h1); + font-weight: var(--font-weight-medium); + line-height: var(--line-height-h1); +} + +h2 { + color: var(--color-text-primary); + font-family: var(--font-text); + font-size: var(--font-size-h2); + font-weight: var(--font-weight-regular); + line-height: var(--line-height-h2); +} + +.type-body-strong { + color: var(--color-text-primary); + font-family: var(--font-text); + font-size: var(--font-size-body); + font-weight: var(--font-weight-medium); + line-height: var(--line-height-body-strong); +} + +.type-caption { + color: var(--color-text-secondary); + display: block; + font-family: var(--font-text); + font-size: var(--font-size-caption); + font-weight: var(--font-weight-regular); + line-height: var(--line-height-caption); +} + a:focus { outline: none; box-shadow: none; @@ -75,7 +219,7 @@ a:focus { */ .scrollstyle { - scrollbar-color: rgba(255, 255, 255, 0.2) transparent; + scrollbar-color: color-mix(in srgb, var(--color-content) 20%, transparent) transparent; } .scrollstyle::-webkit-scrollbar-track { @@ -94,15 +238,15 @@ a:focus { } .scrollstyle:hover::-webkit-scrollbar-thumb { - background-color: rgba(255, 255, 255, 0.1); + background-color: color-mix(in srgb, var(--color-content) 10%, transparent); } .scrollstyle::-webkit-scrollbar-thumb:hover { - background-color: rgba(255, 255, 255, 0.2); + background-color: color-mix(in srgb, var(--color-content) 20%, transparent); } .scrollstyle::-webkit-scrollbar-thumb:active { - background-color: rgba(255, 255, 255, 0.2); + background-color: color-mix(in srgb, var(--color-content) 20%, transparent); } /* @@ -111,12 +255,15 @@ a:focus { @layer utilities { .bg-glass { - @apply bg-black/30 backdrop-blur-[10px] border-[1.5px] border-white/20 shadow-[inset_0_0_20px_rgba(255,255,255,0.1),0_4px_20px_rgba(0,0,0,0.4)]; + @apply bg-scrim/30 backdrop-blur-[10px] border-[1.5px] border-content/20 shadow-[inset_0_0_20px_color-mix(in_srgb,var(--color-content)_10%,transparent),0_4px_20px_color-mix(in_srgb,var(--color-scrim)_40%,transparent)]; } .bg-glass-dark { - @apply bg-black/40 backdrop-blur-[10px] shadow-[0_2px_12px_rgba(0,0,0,0.3)]; + @apply bg-scrim/40 backdrop-blur-[10px] shadow-[0_2px_12px_color-mix(in_srgb,var(--color-scrim)_30%,transparent)]; + } + .bg-radial-content { + @apply bg-[radial-gradient(circle_at_30%_30%,color-mix(in_srgb,var(--color-content)_25%,transparent),color-mix(in_srgb,var(--color-content)_5%,transparent))]; } - .bg-radial-white { - @apply bg-[radial-gradient(circle_at_30%_30%,rgba(255,255,255,0.25),rgba(255,255,255,0.05))]; + .bg-radial-content-active { + @apply bg-[radial-gradient(circle_at_35%_35%,color-mix(in_srgb,var(--color-content)_60%,transparent),color-mix(in_srgb,var(--color-content)_15%,transparent))]; } } diff --git a/src/index.jsx b/src/index.jsx index 126b16b61..dc93e03db 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -1,6 +1,6 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; -import { CssBaseline, MuiThemeProvider } from '@material-ui/core'; +import { MuiThemeProvider } from '@material-ui/core'; import * as Sentry from '@sentry/react'; import './index.css'; @@ -24,7 +24,6 @@ if (import.meta.env.VITE_APP_GIT_TIMESTAMP) { ReactDOM.createRoot(document.getElementById('root')).render((
-
- )}
- dispatch(selectDevice(dongleId)))}
+ connect
- -
+
+ )}
+ dispatch(selectDevice(dongleId)))}
+ >
+ connect
+ ++
{deviceNamePretty(device)}
- + { device.dongle_id }There are no more routes found in selected time range.
{startDate}
+{startDate}
{`${startTime} to ${endTime}`}
{duration}
+{duration}
{distance}
{drive.startLocation?.place}
+{drive.startLocation?.place}
{drive.startLocation?.details}
{drive.endLocation?.place}
+{drive.endLocation?.place}
{drive.endLocation?.details}
${hasBaseline ? `Base: ${manifest.baseSha}
` : ''}Head: ${manifest.headSha}
Generated:
| Page | Baseline | PR | Diff | Result |
|---|---|---|---|---|
| Page | Screenshot |