wrolpi/app/src/hooks
Roland 49eb2bdce6
build: uninstall Semantic UI
`semantic-ui-react`, `react-semantic-toasts-2` and `semantic-ui-offline` are
gone from package.json, the lockfile and node_modules -- 19 MB of dependencies
that nothing had imported since the migration finished.

Four things still referenced them and would have broken on uninstall.  None was
caught by a build or by jest:

  Four test files still ran `jest.mock('react-semantic-toasts-2', ...)` for
  components that no longer use it.  A jest.mock of a module that does not exist
  throws, so the packages could not have come out without this.

  `src/components/Download.cy.js` and `cypress/support/component.js` both
  imported semantic.min.css.  The support file now loads what the app loads --
  index.css, the font and token stylesheets, and Mantine's.

The ratchet changes job rather than being deleted.  An import of a missing module
fails loudly now, but three quieter mistakes would not: a `className="ui button"`
that styles nothing, a file reaching back through Theme.tsx, and someone
reinstalling a package to "just use one Semantic component".  It asserts all
three, plus that package.json names nothing matching /semantic/i.

Two pre-existing problems in the cypress component harness surfaced while
checking the uninstall had not broken it, both fixed because that file had to be
edited anyway:

  It imported `react-router-dom`, which is not installed -- this app is on
  react-router v7.  Dates to 5621d473, so the component suite has been
  un-runnable since well before this migration.

  Its mount helper supplied no MantineProvider, so every library component threw
  -- the same gap test-utils.js had for jest.

The component specs now load and four pass; eleven assertions are still written
against markup from before they stopped running.  Repairing those is its own
piece of work, deliberately not bundled in here.  The e2e suite is unaffected:
43/43.
2026-08-05 18:36:31 -06:00
..
customHooks.js ui: thirty-five files off Semantic, leaving fifteen 2026-08-05 18:34:58 -06:00
customHooks.test.js ui: Common.js and thirteen more files off Semantic 2026-08-05 18:34:50 -06:00
useForm.js ui: the last Semantic UI file, and the stylesheet with it 2026-08-05 18:36:26 -06:00
useForm.test.js ui: Common.js and thirteen more files off Semantic 2026-08-05 18:34:50 -06:00
useKeyboardShortcuts.test.js ui: Common.js and thirteen more files off Semantic 2026-08-05 18:34:50 -06:00
useOverflowNav.js Navigation links automatically hide based on screen width, rather than hard breaks. 2026-04-09 16:17:38 -06:00
useSubsystemToggle.test.js build: uninstall Semantic UI 2026-08-05 18:36:31 -06:00