Repository navigation
feat(dash): move the operator dashboard to Preact - #55
Merged
Merged
Conversation
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>
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 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/dashruns on Preact throughvoid-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-preactgains what dash imports:FudaMark,FingerprintSimple,ConfirmAction, the theme and language controls andPasskeySection, with ported tests. The DOM test helper takes an optional host.card-draftstays module state behind a subscription hook. A server render never reads or writes it.useStable, anduseGuardedcaches its wrappers), because an effect keyed on a function prop now reruns when its parent hands it a new one.@fuda/uiimports in dash move to renderer-independent subpaths (/theme,/short).ui-preactfiles are excluded from clone detection in.fallowrc.jsonuntil the last layer deletes the Solid copies.docs/architecture.mdand ADRs 0010 and 0015 are updated.void-preact@0.1.2gets one exactminimumReleaseAgeExcludeentry.Scope
Dash only, plus what it consumes from
ui-preact. App and the Solid query binding are untouched. No product behavior, API, spec orpackages/e2eassertion 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-lockfilepasses.Verification
On the final tree, all exit 0:
pnpm install --frozen-lockfilepnpm check: 1,042 files, no warning, lint or type errorpnpm 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
useSharederror.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.