refactor(dashboard): drop the editor surface (Stage 2 of #28)#31
Merged
Conversation
The design mockup deleted §7 Editor in #26 — Reasonix's value is the agent loop, not a VSCode-in-a-tab. The code follows. Net −1535 LoC across nine files; the dashboard bundle shrinks from 137 KB to 121 KB. Removed: - dashboard/app.js — EditorPanel + the lazy CodeMirror loader (~540 lines), the editor drawer overlay in App, the `editor` entry in TABS, the `openFileInEditor` helper, the `open-file` event-bus path, and the four tool-card path-link click handlers (now plain code spans). - dashboard/app.css — 590 lines of editor-drawer / file-tree / CodeMirror skin. The `.tool-card-path-link` hover treatment goes with the click handler. - dashboard/codemirror.js — 36-line CDN loader stub, gone. - scripts/bundle-codemirror.mjs — the build-time CodeMirror bundler, no longer needed. - src/server/api/file.ts — the `/api/files` + `/api/file/<path>` endpoints had no consumer outside the editor panel. - src/server/router.ts — drops the `files` / `file` route cases. - src/server/assets.ts — drops the `codemirror.js` serving branch. - package.json — drops `dashboard/codemirror.js` from the npm files list and removes the `build:cm` script. Out of scope: the new §7 Edit review surface (Stage 4 PR 4.15) will live in `dashboard/src/panels/edit-review.tsx` and replaces this slot in the IA conceptually, but that's later in the rollout.
This was referenced May 1, 2026
esengine
added a commit
that referenced
this pull request
May 1, 2026
Stage 3 PR (consolidated). Originally split across PRs 3.2–3.5 in #28 but each was a 30–60 line leaf extraction — not enough review value for the PR overhead. Folded the four into one architectural slice. New files under dashboard/src/lib/: - use-poll.ts (45 LoC) — typed `usePoll<T>` hook over the api() wrapper. - bus.ts (65 LoC) — appBus, toastBus, showToast, ToastStack, plus reportAppError and the two window error listeners (registered on module load, same as before). - error-boundary.ts (159 LoC) — ErrorOverlay component, ErrorBoundary class, buildIssueBody helper. Both consumers of bus.ts. - markdown.ts (169 LoC) — escapeHtml, SEARCH_REPLACE_RE, renderSearchReplace, renderUnifiedDiff, the marked renderer customisation, renderMarkdownToString (was inline in renderMessageBody), LANG_BY_EXT, langFromPath, renderHighlightedBlock, hlLine. Drops the unused previewMarked (was only for the Editor that #31 removed). Other moves: - types.d.ts — module shims so TypeScript resolves the CDN URL imports against npm types. Specific shims for preact, htm, marked, highlight.js; wildcard fallback for anything else. - package.json — preact, htm, marked, highlight.js added as devDependencies (types only — runtime still loads from esm.sh, tsup keeps them external). - dashboard/app.js — drops ~500 LoC of moved blocks. renderMessageBody stays as a thin wrapper around renderMarkdownToString since it needs the Preact-bound `html` template literal. Bundle output verified: dashboard/dist/app.js still 121 KB, CDN imports preserved external. 1682/1682 tests pass.
esengine
added a commit
that referenced
this pull request
May 1, 2026
Stage 2 (#31) removed the dashboard's editor surface — the CodeMirror integration that was its only consumer. The 20 @codemirror/* packages have been dead weight in package-lock since then. Removed: @codemirror/autocomplete, commands, language, search, state, theme-one-dark, view, plus 13 lang-* grammars. Build / typecheck / 1682 tests still green.
This was referenced May 19, 2026
2 tasks
esengine
pushed a commit
that referenced
this pull request
May 20, 2026
…tems (#1394) Fixes #1295 — Desktop MCP tools panel crashes with React error #31 ("Objects are not valid as a React child") when `config.json` contains non-string items in the `mcp` array. Root cause: `readConfig()` does `JSON.parse` without runtime validation, so `cfg.mcp` can contain objects even though it's typed as `string[]`. When `summarizeMcpSpec()` threw on these object inputs, its catch block returned `summary: raw` directly, leaking objects into JSX. Fix: - `summarizeMcpSpec` catch block — stringify non-string `raw` before returning. - `emitMcpSpecs` — filter `cfg.mcp` to string items before mapping. - `CtxTools` / `PageMCP` — render `summary` / `name` only when string. - Regression test in `tests/mcp-desktop-react31.test.ts`. Follow-up tracked separately: tighten `readConfig` with zod schema validation so this boundary check lives in one place.
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
Stage 3 PR (consolidated). Originally split across PRs 3.2–3.5 in esengine#28 but each was a 30–60 line leaf extraction — not enough review value for the PR overhead. Folded the four into one architectural slice. New files under dashboard/src/lib/: - use-poll.ts (45 LoC) — typed `usePoll<T>` hook over the api() wrapper. - bus.ts (65 LoC) — appBus, toastBus, showToast, ToastStack, plus reportAppError and the two window error listeners (registered on module load, same as before). - error-boundary.ts (159 LoC) — ErrorOverlay component, ErrorBoundary class, buildIssueBody helper. Both consumers of bus.ts. - markdown.ts (169 LoC) — escapeHtml, SEARCH_REPLACE_RE, renderSearchReplace, renderUnifiedDiff, the marked renderer customisation, renderMarkdownToString (was inline in renderMessageBody), LANG_BY_EXT, langFromPath, renderHighlightedBlock, hlLine. Drops the unused previewMarked (was only for the Editor that esengine#31 removed). Other moves: - types.d.ts — module shims so TypeScript resolves the CDN URL imports against npm types. Specific shims for preact, htm, marked, highlight.js; wildcard fallback for anything else. - package.json — preact, htm, marked, highlight.js added as devDependencies (types only — runtime still loads from esm.sh, tsup keeps them external). - dashboard/app.js — drops ~500 LoC of moved blocks. renderMessageBody stays as a thin wrapper around renderMarkdownToString since it needs the Preact-bound `html` template literal. Bundle output verified: dashboard/dist/app.js still 121 KB, CDN imports preserved external. 1682/1682 tests pass.
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
Stage 2 (esengine#31) removed the dashboard's editor surface — the CodeMirror integration that was its only consumer. The 20 @codemirror/* packages have been dead weight in package-lock since then. Removed: @codemirror/autocomplete, commands, language, search, state, theme-one-dark, view, plus 13 lang-* grammars. Build / typecheck / 1682 tests still green.
ChasLui
pushed a commit
to ChasLui/DeepSeek-Reasonix
that referenced
this pull request
May 23, 2026
…string items (esengine#1394) Fixes esengine#1295 — Desktop MCP tools panel crashes with React error esengine#31 ("Objects are not valid as a React child") when `config.json` contains non-string items in the `mcp` array. Root cause: `readConfig()` does `JSON.parse` without runtime validation, so `cfg.mcp` can contain objects even though it's typed as `string[]`. When `summarizeMcpSpec()` threw on these object inputs, its catch block returned `summary: raw` directly, leaking objects into JSX. Fix: - `summarizeMcpSpec` catch block — stringify non-string `raw` before returning. - `emitMcpSpecs` — filter `cfg.mcp` to string items before mapping. - `CtxTools` / `PageMCP` — render `summary` / `name` only when string. - Regression test in `tests/mcp-desktop-react31.test.ts`. Follow-up tracked separately: tighten `readConfig` with zod schema validation so this boundary check lives in one place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The design mockup deleted §7 Editor in #26 — Reasonix's value is the agent loop, not a VSCode-in-a-tab. The code follows. Stage 2 of #28.
Net −1535 LoC across nine files. Dashboard bundle drops from 137 KB to 121 KB.
Removed
dashboard/app.js—EditorPanel+ the lazy CodeMirror loader (~540 lines), the editor drawer overlay inApp, theeditorentry inTABS, theopenFileInEditorhelper, theopen-fileevent-bus path, and the four tool-card path-link click handlers (now plain<code>spans).dashboard/app.css— 590 lines of editor-drawer / file-tree / CodeMirror skin. The.tool-card-path-linkhover treatment goes with the click handler.dashboard/codemirror.js— 36-line CDN loader stub, gone.scripts/bundle-codemirror.mjs— the build-time CodeMirror bundler, gone.src/server/api/file.ts— the/api/files+/api/file/<path>endpoints had no consumer outside the editor panel.src/server/router.ts— drops thefiles/fileroute cases.src/server/assets.ts— drops thecodemirror.jsserving branch.package.json— dropsdashboard/codemirror.jsfrom the npmfileslist and thebuild:cmscript.Out of scope
The new §7 Edit review surface (Stage 4 PR 4.15) will live in
dashboard/src/panels/edit-review.tsxand conceptually replaces this slot in the IA, but lands much later in the rollout — Stage 3 (extract shared infra) goes first.Test plan
npm run build— bundles cleanly, dashboard output drops to 121 KB.npm run typecheck— both root + dashboard projects clean.npm run lint— clean (6 pre-existing warnings unrelated).npm test— 1682/1682.