43 Commits
Author SHA1 Message Date
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 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 7f7b95c56c make prettier ignore pnpm lockfile 2025-02-10 11:20:56 -08:00
michioxd a787703a31 added jsdom to dev deps 2024-04-13 21:53:59 -07:00
michioxd 6e81b27d1a Extra change for Moonfire WebUI 2024-04-13 21:53:59 -07: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
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 3de62eb70d ui test cleanups
* update `msw` 0.49 -> 1.x. (2.x is out now, but small steps.)
* wrap some `jest.{runOnlyPendingTimers,advanceTimersByTime}` calls
  in `act`.
* extend a timeout that had no slack at all
2023-12-09 14:59:40 -08:00
Scott Lamb 1f7806108c upgrade @mui/x-date-pickers to v6 beta
Fixes #256
2023-11-28 10:26:52 -08:00
Scott Lamb 098b54c9f9 upgrade to react 18
* new root rendering api
* components are now allowed to return undefine
* testing library changes for userEvent.type
2023-01-11 22:25:56 -08:00
Scott Lamb fbb5e6b266 upgrade typescript and msw 2023-01-11 20:55:38 -08:00
Scott Lamb dc9c62e8bb react-hook-form-mui in ChangePassword 2023-01-09 17:16:05 -08:00
Scott Lamb 918bb05d40 update @types/node 2022-10-03 21:18:49 -07:00
Scott Lamb 96e6cbfd5f update typescript and msw
No problems seen so far.

msw version 0.46.0 is advertised as supporting ts v4.8, so I updated
them together, even though tests seemed to pass without the msw update.
2022-10-03 21:15:28 -07:00
Scott Lamb d509d3ff40 update @mui/lab
This is now only used for LoadingButton.
2022-10-03 20:55:10 -07:00
Scott Lamb 1ad14007a5 ui: update date pickers 2022-10-03 20:51:39 -07:00
Scott Lamb a614a8f559 update @mui/material and @mui/icons-material
This works much better with a working lockfile...
2022-10-03 17:59:28 -07:00
Scott Lamb 8d716bf4dd Stop using deprecated @mui/styles
I was struggling to upgrade the version of mui stuff (material and date
picker). I'm hoping getting rid of the deprecated stuff eases this a
bit.

I don't love that I can't just use sx on plain HTML stuff and have to
wrap it in Box, but oh well. Looks like I'm not alone, fwiw.
https://github.com/mui/material-ui/issues/23220
2022-10-03 08:29:11 -04:00
Scott Lamb 4addf3c90c npm upgrade 2022-03-16 15:46:42 -07:00
Scott Lamb 90c9a31ad0 upgrade almost all frontend deps
typescript isn't at the latest because eslint warns about it.
2022-03-04 08:55:06 -08:00
Scott Lamb 274dc09ec3 upgrade typescript to 4.5.5
I found one significant breaking change: caught exceptions are now
unknown rather than any. Rework the error handling a bit to match.
2022-03-03 14:49:14 -08:00
Scott Lamb a82453e73a upgrade to create-react-scripts v5
I had to disable more of the Login tests to get this to work.
Frustrating, but I just can't figure out how to fake jest timers,
msw, and the testing libraries to all get along anymore.
2022-03-03 14:39:08 -08:00
Scott Lamb 8a65a09c7f upgrade msw version 2022-03-03 12:56:46 -08:00
Damian Krysta 41dfae336e EDIT - Run prettier
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Damian Krysta 2d517c28dc ADD react router and reading from query params
Signed-off-by: Damian Krysta <damian@krysta.dev>
2022-03-02 10:07:46 -08:00
Scott Lamb 74b9f36a75 upgrade to @mui v5 release
This requires a bunch of package name changes. See
[https://mui.com/blog/material-ui-is-now-mui/] for their rationale.
[https://mui.com/guides/migration-v4/] lists the changes:

```
@material-ui/core -> @mui/material
@material-ui/system -> @mui/system
@material-ui/unstyled -> @mui/core
@material-ui/styles -> @mui/styles
@material-ui/icons -> @mui/icons-material
@material-ui/lab -> @mui/lab
@material-ui/types -> @mui/types
@material-ui/styled-engine -> @mui/styled-engine
@material-ui/styled-engine-sc ->@mui/styled-engine-sc
@material-ui/private-theming -> @mui/private-theming
@material-ui/codemod -> @mui/codemod
@material-ui/docs -> @mui/docs
@material-ui/envinfo -> @mui/envinfo
```

We only use a few of these.
2021-09-24 10:57:29 -07:00
Scott Lamb dad9bdc20f fix test error with node 14
This worked fine on my workstation with node 12. But on CI or my laptop
with node 14, it failed. Apparently there @testing-library/user-events
expects a peer @testing-library/dom dependency. At least copying the
"npm install --save-dev @testing-library/user-event @testing-library/dom" command
from the top of https://testing-library.com/docs/ecosystem-user-event/
made it work again on my laptop; fingers crossed about CI.
2021-08-10 13:07:13 -07:00
Scott Lamb 39a63e03ae upgrade material-ui to latest beta
This is a surprisingly complex upgrade. Some relevant changes from
[their CHANGELOG](https://github.com/mui-org/material-ui/blob/v5.0.0-beta.3/CHANGELOG.md):

* @material-ui/core/styles no longer re-exports some stuff from
  @material-ui/styles
* there's no more defaultTheme, so tests need to provide one
* select's onChange has a new type; match that. I haven't actually
  tried that the string form (apparently from autofill) works correctly.
* checkboxes no longer default to the secondary color; explicitly
  request this in some places.
* checkbox no longer has a checked argument; use event.target.checked
  instead.
* date pickers have switched to the new style system, so I had to
  redo how I was overridding their spacing for desktop.
* LoadingButton now has a loading property, not pending
* createMuiTheme is no createTheme
2021-08-10 12:43:10 -07:00
Scott Lamb 0236ab8d64 add live stream viewing to React prototype
It's a start. It can display several streams at once, which is nice.
There are lots of opportunities for improvement:

*   it doesn't keep the videos approximately in sync.
*   it accumulates extra buffering, drifting behind live. This is
    particularly noticeable when it's paused and played again; it can
    be several seconds before it jumps to after the break.
*   it always uses the sub stream rather main. I'd prefer it support
    "auto" (use main if the viewport is larger than the sub stream and
    there's sufficient bandwidth), "main", or "sub".
*   it has a kludgy heuristic where it throws away everything buffered 5
    seconds before the current timestamp. It should throw away
    everything before the current GOP instead, but I need to alter the
    API so it can easily know when that is.
*   it can't tell you when a camera connection is down. This needs an
    API change also.
*   it'd be nice to quickly double-click on a stream to view only it,
    then double-click again to go back to the multi-pane view.
*   it doesn't allow you to zoom in on part of the video. This would be
    nice particularly when viewing 4k video streams on small screens.
*   it has only four preconfigured layouts that subdivide a 16x9
    viewport. You have to choose every camera every time. It'd be nice
    to both allow more flexibility and have more memory.

React prototype: #111
live stream: #59
2021-03-26 16:45:47 -07:00
Scott Lamb 08c3246982 first draft of react-based list ui (#111) 2021-03-05 16:59:57 -08:00
Scott Lamb e7527af24c upgrade to @material-ui 5.0 alphas
(and various other lockfile upgrades. "npm audit" is clean.)

The date picker to use with 4.0 is unmaintained, and the new one is
apparently quite different.

Given that 5.0 is expected to be released this quarter, I prefer to
jump straight to the new one and get things working with it, even if
it means using an alpha in the short-term.
2021-02-22 16:57:49 -08:00
Scott Lamb f281922359 start a new React-based UI (#111)
This doesn't do much yet but should provide a better foundation for
improvement than the jQuery UI, as described in the github issue.
2021-02-17 19:42:32 -08:00
Scott Lamb b7095e9b07 upgrade favicons-webpack-plugin
Fixes #105

I still don't know why it wasn't working properly, but I'm happy that
a simple upgrade fixed it.
2021-01-25 14:06:54 -08:00
Scott Lamb dd66c7b0dd restructure into "server" and "ui" subdirs
Besides being more clear about what belongs to which, this helps with
docker caching. The server and ui parts are only rebuilt when their
respective subdirectories change.

Extend this a bit further by making the webpack build not depend on
the target architecture. And adding cache dirs so parts of the server
and ui build process can be reused when layer-wide caching fails.
2021-01-22 22:01:17 -08:00