Skip to content

feat(dash): move the operator dashboard to Preact - #55

Merged
yujiym merged 11 commits into
mainfrom
feat/dash-preact
Nov 5, 2026
Merged

yujiym merged 11 commits into
mainfrom
feat/dash-preact

Conversation

@yujiym

@yujiym yujiym commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Why

The owner of fuda is moving its frontends from Solid to Preact through their own adapter void-preact, because they consider it the most promising structure and it dogfoods their library. This is layer 5 of that stack: the operator dashboard. It stacks on #54 (feat/gate-preact), so its base is that branch.

What changed

  • apps/dash runs on Preact through void-preact@0.1.2: 15 routes, the layout, 49 production components and 24 test files. Every route stays live and there is no Solid left in the app.
  • packages/ui-preact gains what dash imports: FudaMark, FingerprintSimple, ConfirmAction, the theme and language controls and PasskeySection, with ported tests. The DOM test helper takes an optional host.
  • Lifetimes that Solid kept in component closures are explicit:
    • The card designer publishes a draft in the field event, not in an effect, so a trip to the profile cannot lose the last keystroke.
    • card-draft stays module state behind a subscription hook. A server render never reads or writes it.
    • The layout renders nothing and reloads when a refresh brings a new cookie session, so an old form is never blessed with it.
    • Sign-in and add-passkey keep their generation and in-flight guard in refs. Ceremonies start only from user events.
    • Object URLs, logo decode revisions and debounced handle checks are released on unmount and drop any later answer.
  • Page callbacks have a stable identity (useStable, and useGuarded caches its wrappers), because an effect keyed on a function prop now reruns when its parent hands it a new one.
  • @fuda/ui imports in dash move to renderer-independent subpaths (/theme, /short).
  • The five mirrored ui-preact files are excluded from clone detection in .fallowrc.json until the last layer deletes the Solid copies.
  • docs/architecture.md and ADRs 0010 and 0015 are updated.
  • void-preact@0.1.2 gets one exact minimumReleaseAgeExclude entry.

Scope

Dash only, plus what it consumes from ui-preact. App and the Solid query binding are untouched. No product behavior, API, spec or packages/e2e assertion changes. No test assertion was weakened; 16 tests were added.

Blast Radius

The whole dashboard. The riskiest paths are sign-in and add-passkey, the session boundary in the layout, the card draft round trip, ENS claim, reception and stamps, and the logo upload. A plain pnpm install --frozen-lockfile passes.

Verification

On the final tree, all exit 0:

  • pnpm install --frozen-lockfile
  • pnpm check: 1,042 files, no warning, lint or type error
  • pnpm test: 2,471 Vitest tests and 70 Solidity tests. Dash has 453 tests, up from 437.
  • pnpm fallow:audit: exit 0. Warnings only: four complexity findings already on main and one added-suppression for the wrapper cache cast.
  • pnpm e2e: gate 7, dash 6 and app 6, unchanged.

In Chromium, in Japanese and English, in dev and on the built Worker, a walk of every route (cold direct load, screenshot, no console error, no page error, no server-rendered element removed on hydration) and these flows: client navigation across two card slugs, the draft round trip, language and theme change in place, and virtual-authenticator passkey sign-in, add, a refused add, and sign-in again. 0 failures in both runs. The six dash e2e cases also pass against the built Workers. Three clean-cache dev starts show no useShared error.

Gzipped client JS per route, from each production manifest's static closure (the pages entry, the layout and that route), Solid against Preact: Preact is 79 to 1,393 bytes larger per route; the profile route is 108,916 against 109,038. This is static bytes, not speed. Most of each route is shared application code.

Deploy and manual checks

Nothing to deploy from this PR. Before release, check on a real device: a real passkey sign-in and add, a wallet sign-in, a live ENS claim and WebKit. None of these ran here.

yujiym added 11 commits November 5, 2026 20:37
Pin void-preact 0.1.2 exactly and exempt only that release from the
three-day age window. Dash drops its Solid adapter and compiler plugin
and takes the Preact packages gate already uses. ui-preact gains cn for
the controls it is about to carry.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
FudaMark, FingerprintSimple, ConfirmAction, the theme and language
controls and PasskeySection, with their tests ported to the DOM helper.
PasskeySection keeps its ceremony guard in a ref so a double click starts
one add, and a list that resolves after unmount writes nothing.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
Dash tests keep a host they query after unmount. mount takes an optional
host and removes only the one it created. The PasskeySection and
ConfirmAction tests use Promise.withResolvers.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
use-copy-text, issuer-passes-state and the page-context hooks become
Preact hooks. The clipboard timer and the pass-list generation live in
refs, the pass list reloads on its query key, and page callbacks keep a
stable identity so effects that key on them do not rerun every render.
card-draft stays module state behind an external store with a
subscription hook; a server render never reads or writes it.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
Controls, forms, tables and dialogs render with Preact. State is plain
hooks; generations, mounted flags and in-flight guards live in refs so a
rerender neither repeats a request nor loses its guard. The card designer
publishes each draft change in the field event, not in an effect, so a trip
to the profile cannot lose the last keystroke. Object URLs, logo decode
revisions and debounced handle checks are released on unmount and drop any
answer that arrives after it.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
Pages, layout and the Worker loaders use void-preact's router and shared
data. The layout renders nothing and reloads when a state-preserving
refresh brings a new cookie session, so an old form is never blessed with
the new session identifier. Sign-in keeps its ceremony generation and
running guard in refs and cancels on unmount.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
The tests keep their assertions. User actions go through act so renders and
effects have run before the next line. Language and target changes rerender
the same tree instead of writing a signal. New tests cover publishing a
draft in the field event, the opening draft, and the session boundary
dropping the old form.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
The draft store keeps its value across a screen leaving, tells mounted
readers, renders as empty on the server, and ignores a write with no window.
The venue page releases a preview URL on unmount, creates none for a decode
that finishes after it, drops an earlier decode, and never asks the api
about a handle once gone or answers for an older handle.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
The ternaries that replace Show make every branch visible, so StampActions,
ReceptionPage, IssuerPassesPage, PublishedCard, RightsPage, CardEditPage,
DashboardShell and the layout read better as a few named parts. The stamp
and integration panels share their load and footer views, components that
kept a mounted flag and revision share useLifetime, a thrown call becomes
one network failure in one place, and a plain link click is decided in one
place. The mirrored ui-preact controls stay out of clone detection until the
last layer removes the Solid copies. Behavior is unchanged.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
Update the architecture overview and ADRs 0010 and 0015: which frontends
are migrated, how dash keeps its draft, session boundary and request
lifetimes, the effect-identity pitfall Solid's lazy props hid, and the
per-route gzipped client size against the Solid build.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
A hook setter does not apply until the next render, and a location answer
can arrive after the screen left. So the profile link and submit read a
stale form, and a late answer overwrote a newer draft. Solid did neither.
Read the latest draft from its ref, and ignore writes once unmounted.

Signed-off-by: yujiym <1409395+yujiym@users.noreply.github.com>
@yujiym
yujiym changed the base branch from feat/gate-preact to main November 5, 2026 14:13
@yujiym
yujiym merged commit 8c857ed into main Nov 5, 2026
22 checks passed
@yujiym
yujiym deleted the feat/dash-preact branch November 5, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant