refactor(panel): move the renderer runtime and app state into @luke/panel

Merged
DA
11d ago
+193-170

Summary

This is the second band of step 16 of the web plan ("๐Ÿ“ฑ Web support", Refactors to land first), which moves the desktop panel into @luke/panel bottom-up. The first band was #3655.

It moves these files as-is. Only the import specifiers change:

  • renderer-runtime.ts, the renderer's atom runtime and registry
  • use-app-state.ts
  • the modules the logic-lives-in-packages check would otherwise leave behind importing only packages:
    • markdown-html-parser.ts
    • desktop/automation-words.ts, desktop/use-automation-runs.ts, desktop/use-automations.ts, desktop/use-issues.ts
    • factory-world/use-factory-world.ts
    • tasks/chat-gate.ts, tasks/file-view-settings.ts, tasks/task-time.ts, tasks/use-link-standing.ts

Git records all 12 files as renames. The desktop files that imported them now import @luke/panel/<path>. Two tests stay in the desktop for now, because they also draw desktop modules: markdown-html-parser.test.ts and tasks/task-time.test.ts. They import their subjects from the package.

Beyond renames and import rewrites:

  • Root AGENTS.md (approved by the developer): the Effect-idioms paragraph names renderer-runtime.ts at its new path, packages/panel/src/renderer-runtime.ts. tools/anti-slop/effect-edges.json's runtimeEdges row moves with it. The repository check holds the two to each other.
  • rehype-raw redirect: apps/desktop/scripts/build.mjs (markdownHtmlParserOnDemand) and apps/desktop/vitest.config.ts answer rehype-raw with the parser's new path.
  • Dependencies: rehype-raw moves from the desktop's devDependencies to the panel's dependencies, since the parser is what imports it. The panel also gains effect and @effect/atom-react (both catalog:).

The desktop's behavior is unchanged.

Evidence

  • ./scripts/repository-checks.sh: passed.
  • tsc for @luke/panel and @luke/desktop: passed.
  • lint, knip: passed.
  • @luke/desktop vitest: 218 files passed. No test was added or removed.
  • @luke/desktop build, bundle budget included: passed. The HTML parser still lands in its own chunk, outside panel.js's up-front load.
  • I booted the built app on Linux under xvfb-run -a with --disable-gpu --disable-dev-shm-usage --fixture smoke. The panel drew Home, the hidden voice window mounted VoiceHost, and call.html drew the call card. The only console errors were Sentry's sentry-ipc:// requests, which also appear on main. Not run on a Mac.

Invariants

  • ./scripts/check.sh green. (CI)
  • JSON Schema goldens unchanged.
  • No behavior change, so no new test is needed; no change-detector test added.
  • Gateway envelope goldens unchanged.
  • No new as type assertion.
  • No Effect.run* outside the runtime edges (the edge row moved with its file).
  • No new raw async primitives.
  • No dropped Effect, Stream, or Layer statement.
  • Test count unchanged.
  • No hand-rolled file replaced.
  • Every CLAUDE.md/AGENTS.md sentence naming a changed part is edited (root AGENTS.md; CLAUDE.md is its symlink).
  • PRIVACY.md unchanged.
  • Package package.json deps match what the sources import by bare specifier.
  • Barrel/door rule unchanged.

Notes

  • Next: the leaf bands, renames and import rewrites only.

Made with Luke


Devin Review