diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d0a57d11f..0f7d2c219 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,7 +12,7 @@ on: jobs: test: runs-on: ubuntu-latest - timeout-minutes: 1 + timeout-minutes: 2 steps: - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 @@ -60,14 +60,15 @@ jobs: name: build-artifacts-${{ github.run_id }} - name: Deploy to Cloudflare Pages - if: github.ref == 'refs/heads/master' && github.repository == 'commaai/new-connect' + if: github.ref == 'refs/heads/master' && vars.CF_PAGES_PROJECT != '' uses: cloudflare/wrangler-action@v3 with: accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} - command: pages deploy dist --project-name=connect --branch=new-connect --commit-dirty=true + command: pages deploy dist --project-name=${{ vars.CF_PAGES_PROJECT }} --branch=master --commit-dirty=true docker: + if: vars.DOCKER_IMAGE != '' runs-on: ubuntu-latest timeout-minutes: 1 permissions: @@ -79,7 +80,7 @@ jobs: uses: docker/setup-buildx-action@v2 - uses: docker/login-action@v3 - if: github.ref == 'refs/heads/master' && github.repository == 'commaai/new-connect' + if: github.ref == 'refs/heads/master' with: registry: ghcr.io username: ${{ github.actor }} @@ -88,7 +89,7 @@ jobs: - id: meta uses: docker/metadata-action@v5 with: - images: ghcr.io/commaai/connect2 # TODO: switch to 'connect' after launch + images: ${{ vars.DOCKER_IMAGE }} tags: | type=raw,value=latest,enable={{is_default_branch}} type=ref,event=branch @@ -111,6 +112,6 @@ jobs: SENTRY_RELEASE=${{ github.event_name == 'push' && github.sha || github.event.pull_request.head.sha }} builder: ${{ steps.buildx.outputs.name }} context: . - push: ${{ github.ref == 'refs/heads/master' && github.repository == 'commaai/new-connect' }} + push: ${{ github.ref == 'refs/heads/master' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/diff.yaml b/.github/workflows/diff.yaml index 6a69e14b4..afebd06bf 100644 --- a/.github/workflows/diff.yaml +++ b/.github/workflows/diff.yaml @@ -10,40 +10,12 @@ concurrency: cancel-in-progress: true jobs: - check-branch: - name: Check PR branch status - runs-on: ubuntu-latest - outputs: - outdated: ${{ steps.status.outputs.outdated }} - steps: - - uses: actions/checkout@v4 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: 0 - - name: Check whether branch is up-to-date - id: status - run: | - git remote add commaai https://github.com/commaai/new-connect.git - git fetch commaai master - echo "${{ github.event.pull_request.head.sha }}" - git rev-list --left-right --count commaai/master...${{ github.event.pull_request.head.sha }} | awk '{print "Behind "$1" - Ahead "$2""}' - count=$(git rev-list --left-right --count commaai/master...${{ github.event.pull_request.head.sha }} | awk '{print $1}') - if [ $count -gt 0 ]; then - echo "Current branch is behind commaai master branch!" - echo "outdated=true" >> "$GITHUB_OUTPUT" - else - echo "outdated=false" >> "$GITHUB_OUTPUT" - fi - lines: name: Lint count diff permissions: contents: read pull-requests: write runs-on: ubuntu-latest - needs: check-branch - if: needs.check-branch.outputs.outdated == 'false' timeout-minutes: 2 steps: - name: Checkout code from PR branch @@ -65,19 +37,3 @@ jobs: file-path: ./diff.txt comment-tag: diff github-token: ${{ secrets.GITHUB_TOKEN }} - - rebase: - name: Rebase comment - permissions: - pull-requests: write - runs-on: ubuntu-latest - needs: check-branch - if: needs.check-branch.outputs.outdated == 'true' - timeout-minutes: 1 - steps: - - name: Comment rebase - uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b - with: - message: This branch is behind commaai/master. The line count diff bot is disabled. - comment-tag: diff - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 12cb5f9e9..6fd894979 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest outputs: number: ${{ steps.pr.outputs.number }} - if: github.repository == 'commaai/new-connect' && github.event.workflow_run.event == 'pull_request' + if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' steps: # use `gr pr view` to get the PR number # https://github.com/orgs/community/discussions/25220#discussioncomment-11285971 @@ -48,6 +48,7 @@ jobs: preview: name: Deploy preview needs: pr + if: needs.pr.outputs.number != '' && vars.CF_PAGES_PROJECT != '' && vars.PREVIEW_BASE_DOMAIN != '' outputs: check_id: ${{ steps.check.outputs.result }} runs-on: ubuntu-latest @@ -66,7 +67,7 @@ jobs: title: 'Preview deployment', summary: 'In Progress', }, - owner: 'commaai', + owner: '${{ github.repository_owner }}', repo: '${{ github.event.repository.name }}', }) return response.data.id @@ -87,7 +88,7 @@ jobs: with: accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} - command: pages deploy dist --project-name=connect --branch=${{ needs.pr.outputs.number }} --commit-dirty=true + command: pages deploy dist --project-name=${{ vars.CF_PAGES_PROJECT }} --branch=pr-${{ needs.pr.outputs.number }} --commit-dirty=true - name: Comment URL on PR uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b @@ -95,69 +96,11 @@ jobs: message: | - # deployed preview: https://${{ needs.pr.outputs.number }}.connect-d5y.pages.dev + # preview ready - Welcome to connect! Make sure to: - * read the [contributing guidelines](https://github.com/commaai/connect?tab=readme-ov-file#contributing) - * mark your PR as a draft until it's ready to review - * post the preview on [Discord](https://discord.comma.ai); feedback from users will speedup the PR review - comment-tag: run_id - pr-number: ${{ needs.pr.outputs.number }} - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Checkout ci-artifacts - uses: actions/checkout@v4 - with: - repository: commaai/ci-artifacts - ssh-key: ${{ secrets.CI_ARTIFACTS_DEPLOY_KEY }} - path: ${{ github.workspace }}/ci-artifacts - ref: master - - - name: take screenshots - run: bun src/ci/screenshots.ts https://${{ needs.pr.outputs.number }}.connect-d5y.pages.dev ${{ github.workspace }}/ci-artifacts - - - name: Push Screenshots - working-directory: ${{ github.workspace }}/ci-artifacts - run: | - git checkout -b connect/pr-${{ needs.pr.outputs.number }} - git config user.name "GitHub Actions Bot" - git config user.email "<>" - git add . - git commit -m "screenshots for PR #${{ needs.pr.outputs.number }}" - git push origin connect/pr-${{ needs.pr.outputs.number }} --force - - - name: Add screenshots to comment on PR - uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b - with: - message: | - - - # deployed preview: https://${{ needs.pr.outputs.number }}.connect-d5y.pages.dev - - Welcome to connect! Make sure to: - * read the [contributing guidelines](https://github.com/commaai/connect?tab=readme-ov-file#contributing) - * mark your PR as a draft until it's ready to review - * post the preview on [Discord](https://discord.comma.ai); feedback from users will speedup the PR review - - ### Mobile -
![]() |
- ![]() |
- ![]() |
- ![]() |
-
![]() |
- ![]() |
- ![]() |
- ![]() |
-
Manage your openpilot experience.
+Check devices, trips, uploads, and settings from one place.
Make sure to sign in with the same account if you have previously paired your comma three.
++ Use the same account that your device was originally paired with so your trips and settings show up correctly. +
+ - If you still cannot see a QR code, your device may already be paired to another account. Make sure you have signed in to connect - with the same account you may have used previously. + If you still cannot see a QR code, your device may already be paired to another account. Make sure you have signed in with the + same account you used before.
} href="/pair"> Add new device diff --git a/src/pages/dashboard/activities/DeviceActivity.tsx b/src/pages/dashboard/activities/DeviceActivity.tsx index b8364228b..28a700906 100644 --- a/src/pages/dashboard/activities/DeviceActivity.tsx +++ b/src/pages/dashboard/activities/DeviceActivity.tsx @@ -11,6 +11,7 @@ import TopAppBar from '~/components/material/TopAppBar' import DeviceLocation from '~/components/DeviceLocation' import DeviceStatistics from '~/components/DeviceStatistics' import UploadQueue from '~/components/UploadQueue' +import { dayjs } from '~/utils/format' import { getDeviceName } from '~/utils/device' import RouteList from '../components/RouteList' @@ -75,6 +76,13 @@ const DeviceActivity: VoidComponent
+ - Learn more from our{' '} - - FAQ - - . +
+ Plan availability still depends on the current backend account, device state, and SIM setup.
comma prime activated
+Connectivity activated
Use quick filters to focus on recent drives or routes you saved for later.
+offline
diff --git a/vite.config.ts b/vite.config.ts index de1eba666..db2b5edc3 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,4 +1,4 @@ -import { defineConfig } from 'vite' +import { defineConfig, loadEnv, type HtmlTagDescriptor, type PluginOption } from 'vite' import solid from 'vite-plugin-solid' import devtools from 'solid-devtools/vite' import { sentryVitePlugin } from '@sentry/vite-plugin' @@ -7,8 +7,9 @@ import { VitePWA } from 'vite-plugin-pwa' // noinspection ES6PreferShortImport import { Icons } from './src/components/material/Icon' -export default defineConfig({ - plugins: [ +export default defineConfig(({ mode }) => { + const env = loadEnv(mode, process.cwd(), '') + const plugins: PluginOption[] = [ devtools(), solid({ ssr: false, @@ -16,9 +17,9 @@ export default defineConfig({ VitePWA({ registerType: 'autoUpdate', manifest: { - name: 'comma connect', - short_name: 'connect', - description: 'manage your openpilot experience', + name: 'new connect', + short_name: 'new connect', + description: 'Monitor your devices, trips, and uploads from one place.', background_color: '#131318', theme_color: '#131318', start_url: '/', @@ -56,40 +57,50 @@ export default defineConfig({ }), { name: 'inject-material-symbols', - transformIndexHtml(html) { + transformIndexHtml(html: string) { const icons = Icons.toSorted().join(',') + const tags: HtmlTagDescriptor[] = [ + { + tag: 'link', + attrs: { + rel: 'stylesheet', + href: `https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,400,0..1,0&icon_names=${icons}&display=block`, + }, + injectTo: 'head', + }, + ] return { html, - tags: [ - { - tag: 'link', - attrs: { - rel: 'stylesheet', - href: `https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,400,0..1,0&icon_names=${icons}&display=block`, - }, - injectTo: 'head', - }, - ], + tags, } }, }, - // put the Sentry plugin after all other plugins - sentryVitePlugin({ - org: 'commaai', - project: 'new-connect', - telemetry: false, - }), - ], - server: { - port: 3000, - }, - build: { - target: 'esnext', - sourcemap: true, // must be turned on for Sentry - }, - resolve: { - alias: { - '~': '/src', + ] + + if (env.VITE_SENTRY_ORG && env.VITE_SENTRY_PROJECT) { + plugins.push( + sentryVitePlugin({ + org: env.VITE_SENTRY_ORG, + project: env.VITE_SENTRY_PROJECT, + authToken: env.SENTRY_AUTH_TOKEN || undefined, + telemetry: false, + }), + ) + } + + return { + plugins, + server: { + port: 3000, + }, + build: { + target: 'esnext', + sourcemap: true, + }, + resolve: { + alias: { + '~': '/src', + }, }, - }, + } })