Olddevs UI4.14.0

SaaS account

An account overview with metrics and an event feed, and a settings form with an unsaved-changes bar.

Open full screen

What it is built from

Try it

  • On the “Settings” tab, change any field: a bar reading “N unsaved changes” slides in at the bottom. “Save” sends the edits (a timer and a toast), “Discard” brings back the saved values.
  • Clear the workspace name or type admin into the address: the form highlights the field, and the bar shows that the save was refused.
  • Edit a field and switch to “Overview” (or press the bell in the header): the Gallery screen asks whether to discard the edits. You can save without leaving the keyboard: ⌘S (Ctrl+S).
  • On “Overview”, mark a notification as read, switch to “Unread” or press “Mark all read” — the counter in the header stays in sync with the list.
  • In the “Danger zone”, “Delete” asks you to type the workspace name: the button stays disabled until the input matches. After the deletion the Gallery screen offers to restore the workspace.

How it is built

The save bar knows nothing about the form. ContextualSaveBar takes a flag for “there are edits”, their number and two handlers. What counts as an edit is the Gallery screen's decision: it keeps a saved copy of the settings and a draft, and counts the fields where they differ. So “Discard” is essentially one line, setDraft(saved), and the number on the bar is always accurate, even when the changed field has scrolled out of view. A refused save goes into the error prop, and the field highlight goes into the error prop of FormField.

Leaving with unsaved edits is the application's job. The bar knows neither the router nor the tabs, and does not warn about leaving: that is written into its contract. The Gallery screen owns the tabs: Tabs is controlled, and the tab change handler first looks at the edit counter and, if there are edits, opens a ConfirmDialog with kind="warning". The same handler also handles the bell in the header.

Three questions, one ConfirmDialog component. The “Discard unsaved changes?” and “Transfer ownership?” dialogs are plain confirmations with kind="warning". Deleting the workspace is the same component with typeToConfirm={workspace}: the kit renders the labeled field, focuses it, keeps the button disabled until the name is typed exactly, and clears the input when the dialog closes. While the “deletion” runs, loading keeps the dialog from closing, and all that is left for the Gallery screen is the timer and the switch to EmptyState.

The overview is built from data. The metrics are three Card components, each with a Stat; the Gallery screen chooses the delta tone (deltaTone), because MRR growth is good news and growth in errors is not. The event feed is a Timeline where every event carries its own status, and words such as “paid” come from statusLabel. NotificationCenter is content with no surface of its own, so it sits in a Card; the unread count is passed to it rather than counted from the visible rows, and EmptyState handles an empty list after a filter.

Settings are a Toggle with a label. The setting's title goes in children, the explanation in description, and the kit puts the switch on the right. Pressing the text flips the switch, the label is the accessible name, and the description is associated with the switch for screen readers, so the Gallery screen needs no separate “setting row”.

On a phone the shell rearranges itself. AppShell moves SideNav into a drawer (Drawer) and shows MobileTabBar, and a two-column FormLayout collapses into one. The shell publishes the bottom bar's height as --bottombar-h, and ContextualSaveBar sits above it with no className adjustment.