Migrate SPA from Vue to Solid 2 #6

Merged
jd merged 7 commits from solid-2-migration into main 2026-11-21 20:29:58 -05:00
Owner

Summary

Replaces the Vue 3 + Pinia + Vue Router SPA in web/ with Solid 2: TSX
components, context-provided stores and Solid Router. The served UI, routes,
responsive layouts and test coverage are preserved; no server API, wire type or
Go behavior changes.

What changed

Framework

  • All *.vue components become *.tsx (src/components/**, src/views/**);
    main.ts / App.vue become main.tsx / App.tsx, mounted with render
    from @solidjs/web.
  • Pinia → one context store per domain (create*Store(registry) + context hook),
    constructed in StoresProvider (src/stores/index.tsx) with a per-app
    notification registry (src/stores/registry.ts). Store values are getters,
    changes are explicit actions.
  • Vue Router → @solidjs/router (src/router.tsx), with the unauthorized hook
    still redirecting to /login?ref=…; ordinary anchors stay full document loads
    via explicitLinks.
  • Vite 7 → 8 and @vitejs/plugin-vue → @solidjs/vite-plugin; vue-tsc →
    tsc --noEmit (jsx: preserve, jsxImportSource: @solidjs/web).

Solid-idiomatic follow-ups on top of the port

  • Store writes commit on Solid's own schedule instead of flushing after every
    mutation; the queueMicrotask mount-load workarounds and the fake-DOM store
    harness (storeLoads*, ArchiveView deferral test) are gone. session.ts
    keeps a private synchronous commit because its actions read back what they
    wrote.
  • Model selection rules (repairedChoice, staleSeedRepaired) are pure
    input/output functions; tests are tables over them.
  • Shared errText for error extraction, shared panel.ts for dropdown
    placement (PickerMenu, ContextRing, SlashPalette, MentionPalette),
    composingField for IME composition in controlled inputs.
  • MessageList caches rendered markdown; admin lists load in one request
    (pagination cursors dropped).

Tooling & docs

  • mise run check runs tsc --noEmit; mise run test-web-unit runs
    bun --conditions=browser --conditions=development test src (needed for
    Solid's export conditions).
  • .air.toml watches tsx instead of vue; the reduce rules match tsc
    instead of vue-tsc.
  • web/DESIGN.md, web/STYLE.md and AGENTS.md rewritten for the new stack.
  • Smoke walk gains rail-drawer (phone drawer closes on navigation) and an
    admin-providers edit check; the setup step now asserts the row patch writes
    back to its field.

Non-web touches are comment/regex only: internal/api/settings.go,
internal/server/agents/subagent.go, internal/server/agents/reduce/rules.yaml.

Testing

  • mise run check
  • mise run test-web-unit
  • mise run test-go (needs ERSA_TEST_DATABASE_URL)
  • mise run test-web, and again with ERSA_TEST_WIDTH=400 for the md:
    breakpoints and the new drawer check
  • cd web && bun e2e/smoke.ts --test-lifecycle

Notes

Views that need seeded sessions (Overview desk, tombstones, Archive) were still
checked by hand per web/TESTING.md. Nothing here is meant to change user-facing
behavior — if something looks different, treat it as a port regression.

## Summary Replaces the Vue 3 + Pinia + Vue Router SPA in `web/` with Solid 2: TSX components, context-provided stores and Solid Router. The served UI, routes, responsive layouts and test coverage are preserved; no server API, wire type or Go behavior changes. ## What changed **Framework** - All `*.vue` components become `*.tsx` (`src/components/**`, `src/views/**`); `main.ts` / `App.vue` become `main.tsx` / `App.tsx`, mounted with `render` from `@solidjs/web`. - Pinia → one context store per domain (`create*Store(registry)` + context hook), constructed in `StoresProvider` (`src/stores/index.tsx`) with a per-app notification registry (`src/stores/registry.ts`). Store values are getters, changes are explicit actions. - Vue Router → `@solidjs/router` (`src/router.tsx`), with the unauthorized hook still redirecting to `/login?ref=…`; ordinary anchors stay full document loads via `explicitLinks`. - Vite 7 → 8 and `@vitejs/plugin-vue` → `@solidjs/vite-plugin`; `vue-tsc` → `tsc --noEmit` (`jsx: preserve`, `jsxImportSource: @solidjs/web`). **Solid-idiomatic follow-ups on top of the port** - Store writes commit on Solid's own schedule instead of flushing after every mutation; the `queueMicrotask` mount-load workarounds and the fake-DOM store harness (`storeLoads*`, ArchiveView deferral test) are gone. `session.ts` keeps a private synchronous commit because its actions read back what they wrote. - Model selection rules (`repairedChoice`, `staleSeedRepaired`) are pure input/output functions; tests are tables over them. - Shared `errText` for error extraction, shared `panel.ts` for dropdown placement (`PickerMenu`, `ContextRing`, `SlashPalette`, `MentionPalette`), `composingField` for IME composition in controlled inputs. - `MessageList` caches rendered markdown; admin lists load in one request (pagination cursors dropped). **Tooling & docs** - `mise run check` runs `tsc --noEmit`; `mise run test-web-unit` runs `bun --conditions=browser --conditions=development test src` (needed for Solid's export conditions). - `.air.toml` watches `tsx` instead of `vue`; the reduce rules match `tsc` instead of `vue-tsc`. - `web/DESIGN.md`, `web/STYLE.md` and `AGENTS.md` rewritten for the new stack. - Smoke walk gains `rail-drawer` (phone drawer closes on navigation) and an admin-providers edit check; the setup step now asserts the row patch writes back to its field. **Non-web touches** are comment/regex only: `internal/api/settings.go`, `internal/server/agents/subagent.go`, `internal/server/agents/reduce/rules.yaml`. ## Testing - `mise run check` - `mise run test-web-unit` - `mise run test-go` (needs `ERSA_TEST_DATABASE_URL`) - `mise run test-web`, and again with `ERSA_TEST_WIDTH=400` for the `md:` breakpoints and the new drawer check - `cd web && bun e2e/smoke.ts --test-lifecycle` ## Notes Views that need seeded sessions (Overview desk, tombstones, Archive) were still checked by hand per `web/TESTING.md`. Nothing here is meant to change user-facing behavior — if something looks different, treat it as a port regression.
jd added 7 commits 2026-11-21 20:29:27 -05:00
Replace Vue components, Pinia stores, and Vue Router with Solid 2 TSX,
context stores, and Solid Router. Upgrade Vite and preserve application
behavior, responsive layouts, and test coverage
Introduce `composingField` composable to handle IME composition events,
preventing intermediate keystrokes from triggering reactive updates in
controlled inputs.

Refine navigation behavior by removing `noscroll` props and `scroll: false`
options from `navigate` calls. Update `AppShell` to close the mobile drawer
on `pathname` changes rather than `location.key`, ensuring query-only
updates do not reset UI state.

Simplify admin stores by removing pagination cursors and `loadMore` methods,
loading all providers and users in a single request. Add `sectionController`
module to centralize settings section contracts.

Refactor `OverviewView` to extract query synchronization logic into
`createQuerySync`. Update `modelSelection` to defer mount seeds via
`queueMicrotask` to avoid flushing inside `onSettled`.
Introduce `errText` utility in `format.ts` to standardize error message extraction across the application, replacing inline `instanceof Error` checks in components and stores.

Extract panel placement logic (`panelRoom`, `placePanel`, `headerHeight`) from `contextRing.ts` into a shared `panel.ts` module, updating all consumers (PickerMenu, ContextRing, SlashPalette, MentionPalette) to use the centralized layout helpers.

Simplify component state management by removing redundant `createEffect` hooks that sync props to local signals; replace with lazy signal initializers or derived memos in settings editors, user role form, and session prompt form.

Optimize session store by removing `pickReasoning` method in favor of direct `updateView` calls, and use `reconcile` for session list updates to preserve proxies. Deduplicate settings fetches using a shared in-flight promise.

Refactor `MessageList` to cache markdown rendering results, improving performance for transcript rendering. Update `useDismissable` to toggle document listeners based on menu state rather than mounting on settle.
Store writes went through sync(), which flushed after each one. Solid
bans flush() inside onSettled and tracked effects, so every mount load
was wrapped in queueMicrotask and guarded by a fake-DOM test harness.

Writes in the plain stores (settings, setup, auth, admin, account, keys,
branch, overview, archive) now commit on Solid's own schedule. Callers
that await an action still see its writes. Read-then-write sites in
leaving.ts use functional updaters, and armStrip takes the new strip's
`at` instead of reading the uncommitted signal. Overview's family-slot
id checks read the draft, so a load and a drop in the same tick see
each other's write.

session.ts keeps its synchronous commits as a private sync(): its
actions read back what they just wrote, and reconcile depends on the
identity of the stream buffer.

The queueMicrotask workarounds in BranchMenu, AppShell, SubagentFamily,
MentionPalette and ArchiveView are gone, along with storeLoads.test.ts,
storeLoadsRuntime.ts and the ArchiveView deferral test. Plain store
tests in settledLoads.test.ts now check that each mount load runs
inside onSettled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
repairedChoice and staleSeedRepaired take a ModelChoice and return the
repaired one. They hold the effort-default, stale-seed and option
sanitizing rules that repairSelection and clearStaleSeed applied by
writing into signals and reading them back. The two signal helpers are
now thin wrappers that read once and write once.

ModelsSection resolves its pick and its after-load seed directly, so
both of its flush() calls are gone. ModelChoice moves next to the
resolvers; settingsDirty re-exports it.

The signal-driven repair tests become input/output tables over the pure
functions, plus one wrapper test each.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactor `chipSummary` to return structured parts (`lead`, `model`, `tail`)
instead of a single string, allowing the UI to apply `truncate` only to
the model name while keeping mode and effort labels intact. Update
`PickerMenu` to accept `JSX.Element` summaries and handle truncation
logic for both text and element types. Adjust layout classes in
`PromptComposer` and `HomeView` to support flexible wrapping and
proper dock positioning.
Update `HomeView` to use `mt-auto` on the New Session dock section
when no pickup is present, ensuring it fills available vertical space
correctly. Reflect this layout behavior in `STYLE.md` documentation.
jd merged commit d321190d61 into main 2026-11-21 20:29:58 -05:00
jd deleted branch solid-2-migration 2026-11-21 20:29:58 -05:00
jd referenced this pull request from a commit 2026-11-21 20:30:00 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ersyne/ersa-agent!6
No description provided.