sveltelean
Versionv0.2.0 GitHub

The screen has a section rail, an account menu, three tabs of forms, a table of active sessions with a row menu, and three dialogs. Every control is the real primitive: the dialogs and popovers are native elements opened by invoker attributes, the tabs and menus are Tier 1 behaviors discovered from the static markers in the component, and Svelte owns only what the application owns.

Application

Acme Workspace

Settings

Account

Email
ada@example.com

Used for digest emails and for the times shown in the sessions table.

Your name and avatar are visible to people outside the workspace.

Active sessions

Devices signed in to this account. Revoking a session signs that device out.

Last active
Actions
MacBook Pro This device Chrome on macOS
Berlin, Germany
Now
iPhone Safari on iOS
Berlin, Germany
Today, 08:41
ThinkPad X1 Firefox on Windows
Ankara, Türkiye
Yesterday, 19:05
iPad Safari on iPadOS
Lisbon, Portugal
Three days ago
What counts as a session

A session starts at sign-in on one browser and ends at sign-out, at revocation, or after thirty days without activity.

Danger zone

Deleting the account removes its workspaces, documents and sessions. This cannot be undone.

Change email

The address you sign in with. A confirmation link goes to the new address.

Enter an address such as name@example.com.

Delete account

Your workspaces, documents and sessions are removed. This cannot be undone.

Revoke session

The selected device is signed out and has to sign in again.

Runtime

Read from the page after it loads: the primitives in the document by tier, the behaviors registered on the document runtime, the shared listeners counted by the runtime and, separately, by static/instrument.js, the router-sourced listeners on elements (a per-instance listener would show up there), and the scoped controllers in development builds. The counts cover the whole document; the roots inside the application are the "in examples" part.

Runtime
Read from the page after it loads; requires JavaScript.

Primitives by tier

The primitives the application uses, with their declared tier and measured behavior JavaScript
PrimitiveTierShared listenersRegistration moduleBehavior JS (brotli)
button0nonenone (native)0 B
dialog0nonenone (native)0 B
popover0nonenone (native)0 B
disclosure0nonenone (native)0 B
checkbox0nonenone (native)0 B
switch0nonenone (native)0 B
radio-group0nonenone (native)0 B
tabs1click, keydown@svelte-lean/primitives/tabs/register1521 B
menu1click, keydown, toggle@svelte-lean/primitives/menu/register1932 B

Behaviors loaded by this build

@svelte-lean/vite scanned the demo's files for static data-slean markers and injected the matching registration modules; native primitives have none. This is what the manifest of the build you are looking at recorded for src/routes/demos/settings/.

Markers found in the demo's files and the module injected for each, from node_modules/.svelte-lean/manifest.json
BehaviorRegistration moduleFound in
buttonnone (native)SettingsApp.svelte
checkboxnone (native)SettingsApp.svelte
dialognone (native)SettingsApp.svelte
disclosurenone (native)SettingsApp.svelte
menu@svelte-lean/primitives/menu/registerSettingsApp.svelte
popovernone (native)SettingsApp.svelte
radio-groupnone (native)SettingsApp.svelte
switchnone (native)SettingsApp.svelte
tabs@svelte-lean/primitives/tabs/registerSettingsApp.svelte

Without JavaScript

What keeps working with scripting disabled, and where each statement is tested. A statement is called tested only when a spec runs the same markup with JavaScript disabled or before any script has arrived; everything else is expected from the platform and marked as not tested on this page.

Parts of the application with JavaScript disabled
PartWith JavaScript disabledEvidence
Dialogs: Change email, Delete account, Revoke sessionOpen through command="show-modal" on the buttons and on the menu items, close through command="close", Escape and the method="dialog" forms; focus returns to the invoker. native.spec.ts, the same markup with JavaScript disabled
demos.spec.ts, this page with JavaScript disabled
Popovers: the two help hintsOpen and close through popovertarget, with light dismiss and Escape. native.spec.ts, the same markup with JavaScript disabled
demos.spec.ts, this page with JavaScript disabled
Menus: account, session actionsOpen and close as plain popovers, and the items that carry commandfor open their dialog. Arrow keys, Home, End and typeahead need the behavior. demos.spec.ts, this page with JavaScript disabled
Disclosures: Recovery codes, What counts as a sessionOpen and close. native.spec.ts, the same markup with JavaScript disabled
Switches, checkboxes, radio groupToggle and select; the state is the native checked state. native.spec.ts, the same markup with JavaScript disabled
Change-email formrequired and type="email" keep the dialog open and show the message while the address is invalid (:user-invalid). demos.spec.ts, this page with JavaScript disabled
Native selects and text inputsWork; nothing on this page depends on script for them. expected from the platform, not tested on this page
TabsThe Profile panel stays visible; Security and Notifications cannot be shown until the behavior is registered. hydration.spec.ts, before any script arrives
demos.spec.ts, this page with JavaScript disabled
Sessions tableThe rows are in the prerendered document. Sorting, Show details and removing a revoked row need JavaScript. expected from the platform, not tested on this page
Profile formSave submits a GET request and reloads the page; with JavaScript the demo intercepts the submit. expected from the platform, not tested on this page

Notes

  • Native select is the default primitive (blueprint §16.8): Language and Timezone are <select> elements. A custom listbox would have to provide focus management, keyboard interaction, typeahead, positioning, mobile behavior and assistive technology behavior that the browser already provides.
  • One menu per table, not per row: the session actions menu is a single popover. Each row's button invokes it through popovertarget, the invoker becomes the menu's anchor, and the table's onAction tells the application which row asked. Every row shares that one menu and the behavior's shared listeners; a row adds a button, not a menu.
  • Menu items that open a dialog carry command="show-modal". The behavior hides the menu during the click, the platform returns focus to the menu button, and the command then opens the dialog from that button, so closing the dialog puts focus back where the user started.
  • Application state (Tier 3) is limited to what the application owns: the email shown after a change, the session list after a revoke, the status line. Open, checked and selected states stay in the DOM and are never mirrored into Svelte state.
  • Nothing is sent anywhere: there is no server. Saving, exporting and deleting write a status line; revoking removes the row.

Source