160 Commits
Author SHA1 Message Date
Scott Lamb 00dc543ac8 live view: support changing video parameters 2026-02-20 12:33:10 -08:00
Scott Lamb b74b643d3e gracefully degrade live stream
See #343
2026-02-19 09:32:24 -08:00
Scott Lamb fa19757b7b npx update-browserslist-db@latest 2026-02-18 18:01:12 -08:00
Scott LambandClaude Opus 4.6 2164f83c84 ui: migrate LoadingButton from @mui/lab to @mui/material Button
LoadingButton was merged into the core Button component in MUI v7.
Replace all usages and remove the @mui/lab dependency entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 17:28:56 -08:00
Scott LambandClaude Opus 4.6 4f2e22776c ui: remove unused dev dependencies
Remove @babel/core, @babel/preset-env, @babel/preset-react,
@babel/preset-typescript (Vite uses SWC via @vitejs/plugin-react-swc),
http-proxy-middleware (Vite has built-in proxy), and ts-node (unused).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 17:28:56 -08:00
Scott LambandClaude Opus 4.6 ff20d66413 ui: upgrade MUI 5→7, x-date-pickers 6→8, date-fns 2→4, react-hook-form-mui 6→8
- @mui/material ^5 → ^7, @mui/icons-material ^5 → ^7, @mui/lab → 7 beta
- @mui/x-date-pickers ^6 → ^8 with AdapterDateFns path update
- date-fns ^2 → ^4, date-fns-tz ^2 → ^3 (API renames: zonedTimeToUtc →
  fromZonedTime, utcToZonedTime → toZonedTime)
- react-hook-form-mui ^6 → ^8 (validation → rules prop)
- CssVarsProvider/extendTheme graduated from experimental
- Removed StyledEngineProvider (no longer needed)
- Fixed barrel import in DeleteDialog.tsx

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 17:28:56 -08:00
Scott LambandClaude Opus 4.6 694449d1bb ui: upgrade React 18 → 19, testing-library, react-router v7
React 19:
- Replace JSX.Element with React.JSX.Element (namespace moved)
- Update RefObject types to include null
- Remove forwardRef from FullScreenVideo (ref is a regular prop now)
- Fix snackbar test to use await act() for fake timer advancement

testing-library:
- @testing-library/dom 8 → 10
- @testing-library/react 13 → 16
- Use ReactNode instead of ReactElement in testutil

react-router:
- Rename react-router-dom → react-router (package consolidated in v7)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 17:28:56 -08:00
Scott LambandClaude Opus 4.6 928bbab51c ui: migrate ESLint 8 → 9 with flat config
Replace legacy eslintConfig in package.json with eslint.config.js
using the new flat config format. Update packages:

- eslint 8 → 9
- @typescript-eslint/{parser,eslint-plugin} 6 → typescript-eslint 8
- eslint-plugin-react-hooks 4 → 5
- eslint-plugin-vitest → @vitest/eslint-plugin
- eslint-plugin-react-refresh 0.4 → 0.5
- add @eslint/js

Auto-fix prefer-const violations and remove a stale eslint-disable
directive. Disable no-explicit-any, no-empty-object-type, and
no-this-alias to match previous leniency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 17:28:56 -08:00
Scott LambandClaude Opus 4.6 321fb5ccbd ui: upgrade @fontsource/roboto 4 → 5
No code changes needed; the bare import still works.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:28:41 -08:00
Scott LambandClaude Opus 4.6 edc59d24cb ui: upgrade prettier 2 → 3
The default trailingComma changed from "es5" to "all", so many files
are reformatted with trailing commas in more positions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:28:06 -08:00
Scott LambandClaude Opus 4.6 9d14eba5ec ui: bump minor versions of deps; fix msw test race
Bump @emotion/react, @emotion/styled, react-hook-form,
@testing-library/jest-dom, msw, eslint-plugin-react, and
@testing-library/user-event within their current major versions.

Fix App.test.tsx race condition exposed by msw 2.12: wait for the
fetch error to render before test cleanup aborts the request.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:27:15 -08:00
Scott Lamb b85a27bcd8 fix React ref warnings when opening a recording in list view
FullScreenVideo was a plain function component, so MUI's Modal/FocusTrap
could not attach a ref to it, producing three React warnings. Wrap it in
React.forwardRef and forward the ref to the outermost Box element.

Also fix an MUI warning about the modal content node not accepting focus,
by adding tabIndex={-1} to FullScreenVideo's root element.
2026-02-18 12:15:43 -08:00
Scott Lamb ef8cc2d872 fix intermittent live view failures in FF
The live view WebSocket handler was declared async and called
`await blob.arrayBuffer()` directly:

```js
onWsMessage = async (e: MessageEvent<any>) => {
  ...
  const raw = new Uint8Array(await e.data.arrayBuffer());
  ...
};
```

When several WebSocket messages arrive in quick succession—as commonly
happens at stream start—the browser dispatches multiple concurrent
invocations of this handler. Each invocation independently awaits
`Blob.arrayBuffer()`. `LiveCamera.tsx` implicitly assumed that message
n's buffer would resolve before message n+1's buffer, which seemed
logical because they're on the same TCP stream. However, there's no
guarantee of this, and it apparently is not true on Firefox. Perhaps
it's about how FF schedules async tasks.

`LiveCamera.tsx` assumes in its timestamp handling that media segments'
blobs will be strictly resolved in the order they should be played.
Playing segments before their dependencies (e.g. non-IDR frames before
the first IDR frame) doesn't go well.

Fix: make `onWsMessage` synchronous and chain each blob onto a
sequential promise (`messageChain`) so that `processWsBlob` is always
called in arrival order, regardless of the implementation-defined
resolution order of individual `Blob.arrayBuffer()` calls.

Fixes #343.
2026-02-18 08:30:06 -08:00
Scott Lamb 483fb90a8d fix 9x16 videos being stretched in full screen 2026-02-17 21:08:50 -08:00
Scott Lamb cacb7eda76 fix TypeScript error: use Uint8Array<ArrayBuffer> for Part.body
TypeScript 5.7 made typed arrays generic (Uint8Array<TArrayBuffer extends
ArrayBufferLike>), which is no longer assignable to BufferSource (used by
SourceBuffer.appendBuffer), since ArrayBufferLike includes SharedArrayBuffer.
Since the data always comes from Blob.arrayBuffer(), it is always backed by a
plain ArrayBuffer, so use Uint8Array<ArrayBuffer> to reflect that precisely.
2026-02-17 20:58:25 -08:00
Scott Lamb 840dfb4679 use hyperlinks to issues in live view error alert
Fixes #326.
2026-02-17 20:58:25 -08:00
Scott Lamb 1cc422bf0d update node versions
...to:

* 20 (maintenance LTS)
* 22 (maintenance LTS)
* 24 (active LTS release)
* 25 (current non-LTS release)

And address some "realm mismatch" problems in tests:

* It was using `AbortSignal` from `jsdom`'s realm, `fetch` from the Node
  native `fetch`. Node 24 upgraded to undici v7 with stricter Fetch spec
  compliance, which complained about this.
* It was doing `instanceof` checks from `myfetch` which failed for
  similar reasons.

by updating vitest (see <https://github.com/vitest-dev/vitest/issues/8374>) and simplifying the `api.ts` checking.

Along the way, give error messages like `POST /api/login failed; see browser console` rather than the unhelpful `TypeError: Failed to fetch`.
2026-02-14 12:29:25 -08:00
Scott Lamb 284a3dd5a9 regenerate pnpm lockfile (mass UI dep bump)
Note: `pnpm install` with pnpm 10+ completely ignores the old lockfile,
so this does actually bump all the versions.
2025-02-10 11:20:56 -08:00
Scott Lamb 7f7b95c56c make prettier ignore pnpm lockfile 2025-02-10 11:20:56 -08:00
Scott Lamb c75292e43b fix bug spotted by newer typescript 2025-02-10 11:09:21 -08:00
Scott Lamb 3efff2cfd6 improve end reason in list ui
* in backend, save the full reason, not just the most direct error,
  which is often the useless `UNKNOWN`

* in UI, instead of wrapping in `<Typography>` which just resorts in
  a weird ransom-note mixed size look, reserve space for or actually
  use an icon.
2024-09-01 22:18:01 -07:00
Scott Lamb 04b49f06db make iphone live view play in line
Fixes #133
2024-08-21 21:52:05 -07:00
Scott Lamb 0422593ec6 ui list view: tool tip to see why recording ended
Users are often puzzled why there are short recordings. Previously
the only way to see this was to examine Moonfire's logs. This should
be a much better experience to find it right in the UI where you're
wondering, and without the potential the logs are gone.

Fixes #302
2024-06-01 07:46:11 -07:00
Scott Lamb 93a9ad9af3 attempt at iPhone support (#121) 2024-04-16 21:20:07 -07:00
Scott Lamb 8b5f2b4b0d work on Firefox!
Fixes #286.

I dug into Firefox code a bit to understand this but got a lost. But
I guess there are different policies for what's accessible via
`video.src = ""` than for `<video src="">`. This works for now, matches
what other players such as `mpegts.js` do, and is closer to what Safari
MME (required on iPhone) needs anyway. (With MME, apparently you have to
use `video.srcObject`, or the `MediaSource`'s `sourceopen` event will
never fire.)
2024-04-16 17:08:16 -07:00
Scott Lamb 7f4b04ee8a list ui selector layout fixes
* The `DisplaySelector` wasn't getting the correct flex layout.
  Before this was done by a manual style on a `Paper` element. That
  broke when adding the inner `<CardContent>` to because that's the
  container that needs the `display: "flex"`. But really, it's clearer
  to do this with `<FormGroup>` anyway, so do that.

* Switch from `<Card><CardContent>` to `<Paper sx={{ padding: ... }}>`.
  The card content has extra padding (16 px in general, 24 at the bottom
  of the last element to fit with an action). I'm not quite sure the
  best way to remove it, and the simpler `<Paper>` seems fine for this
  use anyway.
2024-04-15 21:46:22 -07:00
michioxd 8036aa40b7 prettify code 2024-04-13 21:53:59 -07:00
michioxd a787703a31 added jsdom to dev deps 2024-04-13 21:53:59 -07:00
michioxd 3f4cee7ead Switch to pnpm 2024-04-13 21:53:59 -07:00
michioxd c67a5ffba5 Added more dark background for select camera and fullscreen button. 2024-04-13 21:53:59 -07:00
michioxd 305deaa1e7 Set default theme mode to based on system color scheme 2024-04-13 21:53:59 -07:00
michioxd 29cafc2f82 Fixed code that didn't meet the eslint rule. 2024-04-13 21:53:59 -07:00
michioxd 60c6247ef9 Fixed TypeError: window.matchMedia is not a function during testing via vitest. 2024-04-13 21:53:59 -07:00
michioxd 317b8e9484 Resolved know problem. 2024-04-13 21:53:59 -07:00
michioxd 91e02eba7a Add copyright/license header for each components 2024-04-13 21:53:59 -07:00
michioxd 5b5822900d Update lock file for npm 2024-04-13 21:53:59 -07:00
michioxd b46d3acabb force color white in camera selector due to light theme 2024-04-13 21:53:59 -07:00
michioxd 6e81b27d1a Extra change for Moonfire WebUI 2024-04-13 21:53:59 -07:00
Scott Lamb eef18372cc fix inverted cond in combining 2024-02-12 18:04:47 -08:00
Scott Lamb 1f7c4c184a seamlessly merge minor VSE changes
Improves #302.
2024-02-12 17:35:27 -08:00
dependabot[bot] f3da22fc5c Bump vite from 5.0.10 to 5.0.12 in /ui
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.10 to 5.0.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.0.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 22:49:25 -08:00
dependabot[bot] 65b3d54466 Bump follow-redirects from 1.15.3 to 1.15.4 in /ui
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-31 22:49:11 -08:00
Scott Lamb b47310644d update gitignore to reflect webpack->vi move 2024-01-31 20:15:04 -08:00
Scott Lamb 2bcee02ea6 use recommended userEvent style
Noticed this while looking at these `act` warnings. I didn't manage to
solve those, but at least this makes the tests more consistent with
current docs.
2023-12-30 12:26:29 -08:00
Scott Lamb 77720a09e3 fix vitest busy loops 2023-12-30 11:59:24 -08:00
Scott Lamb e9a25322b5 upgrade msw 1->2, fix network error case
In the upgrade I managed to dust off some tests that I'd been skipping
for quite a while. It turns out one of them was pointing out a real
problem: in the network error case, we didn't display the error to the
user properly. It's really sad this reaches our code as a `TypeError`,
but it is what it is.
2023-12-18 17:08:19 -08:00
Scott Lamb 3911334fee switch to vitest 2023-12-18 17:08:09 -08:00
Scott Lamb 24880a5c2d switch from create-react-app to vite
create-react-app is apparently deprecated, so the cool kids use vite,
I guess.
2023-12-18 17:08:09 -08:00
Scott Lamb 79af39f35e add a couple missing imports
(not entirely sure why it works without them but may be complicating
an upgrade)
2023-12-17 16:21:52 -08:00
Scott Lamb 14d1879ccd fix #290 2023-12-17 15:57:52 -08:00