hermes-agent/apps/desktop/src
xxxigm 743c55efa3
fix(desktop): stop file tree throwing "Cannot have two HTML5 backends" on remount (#43541)
* fix(desktop): stop file tree throwing "two HTML5 backends" on remount

The Agent Workspace file tree (react-arborist) shows a permanent "TREE ERROR"
with `[error-boundary:file-tree] Cannot have two HTML5 backends at the same
time.` react-arborist mounts its own react-dnd DndProvider + HTML5Backend per
<Tree>. react-dnd v14 keeps that manager on a global, ref-counted singleton
context and nulls it when the count reaches 0. The tree is keyed on
`${cwd}:${collapseNonce}`, so changing folder / collapsing forces a fresh
<Tree>; during the remount the singleton can be torn down and recreated while
the previous HTML5Backend still owns `window.__isReactDndHtml5Backend`, so the
new backend's setup() throws. The error boundary then sticks, because "Try
again" just remounts into the same race.

Pass arborist a stable, app-lifetime `dndManager` (new getFileTreeDndManager
singleton) so it reuses one backend for the life of the app and never
double-claims the window flag. Drag/drop is already disabled on this tree;
this only changes how the (unused) dnd backend is provisioned.

Promotes dnd-core and react-dnd-html5-backend to explicit deps (already present
transitively via react-arborist's react-dnd 14.x line, so they dedupe to one
instance).

* fix(nix): bump npmDepsHash for desktop dnd deps

Adding dnd-core / react-dnd-html5-backend changed the workspace
package-lock.json, so the single workspace-root npmDepsHash in
nix/lib.nix was stale and the nix build failed. Regenerate it
(hash from the failing nix CI job's 'got:' value).

* fix(nix): update npmDepsHash for merged lockfile

After merging main, the workspace lockfile combined main's dep
changes with the desktop dnd additions, so the npmDepsHash needed
recomputing again. Hash from the nix lockfile-check job.

* fix(nix): use fetchNpmDeps hash for desktop dnd lockfile

prefetch-npm-deps reported sha256-lVnybH9RE/... but fetchNpmDeps
wants sha256-mYgKXE/FL4hnkrEvpVv+ULM/oeyIfO2AM9Ol8OrfWm0= for the
merged workspace lockfile. Use the nix build 'got:' hash so CI passes.

---------

Co-authored-by: Brooklyn Nicholson <brooklyn.bb.nicholson@gmail.com>
2026-06-11 11:47:34 -07:00
..
app fix(desktop): stop file tree throwing "Cannot have two HTML5 backends" on remount (#43541) 2026-06-11 11:47:34 -07:00
components fix(desktop): preserve explicit hide-all choice in model visibility dialog (#43496) 2026-06-11 13:27:38 -05:00
hooks Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
i18n feat(desktop): wire remote filesystem browsing 2026-06-11 09:41:35 -07:00
lib fix(desktop): scope remote workspace defaults 2026-06-11 09:41:35 -07:00
store fix(desktop): preserve explicit hide-all choice in model visibility dialog (#43496) 2026-06-11 13:27:38 -05:00
themes feat(desktop): theme the terminal ANSI palette + restyle the Cmd-K / Ctrl-Tab HUDs 2026-06-09 23:37:50 -05:00
types fix(desktop): local-only recents, per-platform sidebar sections, and Ctrl+N regressions (#42537) 2026-06-09 14:24:25 +00:00
global.d.ts feat(cron): Cron Recipes — parameterized automation templates across every surface 2026-06-11 10:49:47 -07:00
hermes.test.ts fix(desktop): scope session list to active profile + longer timeout 2026-06-07 02:15:23 -07:00
hermes.ts feat(desktop): remote update overlay sourced from backend 2026-06-08 08:58:26 -07:00
main.tsx feat(desktop): add i18n with Simplified Chinese (zh-Hans) support 2026-06-05 10:32:26 -07:00
styles.css style(desktop): filled SVG glyphs for in-thread tool icons 2026-06-10 03:41:55 -05:00
vite-env.d.ts Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00