Skip to content
Design System
GitHub

Permissions and data states

What a screen shows when the viewer may not act, and while its data loads, fails, is empty or grows old. One decision each, so every list, card and button answers the same way.

When the viewer may not

Ask in order: may they ever have it here, could they be given it, may they read it, may they open the page, does it exist for them at all.

ShowWhenHowUse
HiddenThe viewer can never have this here: another axis's tool (a platform admin's action on a project page), or a feature the plan lacks.Nothing in its place. Never a gap or a placeholder that hints at it.permission-gate hidden
Disabled, with a reasonSomeone in their position could be given it: a Member looking at Remove device, which an Admin has.In view, focusable, refused on click; the reason (the permission and who grants it) in a tooltip, on a tap and to screen readers.permission-gate disabled
Read-onlyThey may read the values but not change them: project settings for a Viewer.Values as text with one line saying it is view only; never fields that look editable.permission-gate read-only
Forbidden regionA part of a page they may open, which needs a further permission to read: the audit log.The region says what is missing and who grants it; the rest of the page works.permission-gate forbidden, data-state forbidden
No access pageThe whole page needs a permission they lack, inside their own tenant.403: what they cannot open and who can change it, with a way back.status-pages NoAccessPage
Not found (404)The record is in another tenant, or does not exist. Both answer the same.Never forbidden: a 403 would confirm the record exists to someone outside it.status-pages NotFoundPage
Only a project admin or owner can remove devices.

Permission rules

  • Decide by permission strings (devices:delete), never by a role's name. Roles are bundles that change from product to product; the strings are the contract between the server and the interface.
  • Two axes, one check: the platform's permissions and the project's come with the session, and can looks in both. The interface never works out what a role allows.
  • Every disabled action says why and who can change it. A greyed button with no reason sends people to support.
  • Hiding is not security. The server checks every request again; the interface only spares people an action that would fail.
  • Across tenants, 404 everywhere: the page, the API and the error copy say not found, so a guessed ID learns nothing.

Data states

Every region that fetches is in exactly one of six states. A page never invents its own order of checks: dataStateOf picks the state from what the fetch knows.

StateWhenShow
loadingNothing to show yet: the first fetch.One line says what is coming; bones take the content's shape. The heading and anything known already stay.
emptyThe server's total is 0.What is missing, why, and the one action that adds it. A search with no match offers to clear it.
errorThe fetch failed and there is nothing to show.Copy from the error's code, the code itself for support, Try again. The message is never shown or parsed.
forbiddenThe viewer lacks the read permission for this region.Which permission, who grants it. No retry: trying again changes nothing.
staleThe data in hand is older than it should be: a refresh failed, or an update has not arrived.Keep the content; a notice above says how old it is, with Try again.
readyFresh data.The content alone. Calm states stay grey.

Devices 3

Showing data from 14:02:31. It may be out of date.

Showing data from 14:02:31. It may be out of date.
Line 2 inspectionHsinchu plantOnline
Warehouse gateTaoyuan depotOffline
Assembly cell 4Hsinchu plantHeartbeat late

Data rules

  • Counts come from the server's total, never from items.length: a page holds one page of rows, and a server may cap them. A tab's count, a heading's count and a metric all read total or a summary endpoint.
  • Lists the server pages share one query, page, limit, sortBy, order and search, kept in the URL, so a filtered view is a link. A new search or sort goes back to page 1.
  • Errors are read by their machine code (the envelope's error.code), never by their message. Each code a product knows has its own sentence; any other falls back to one general sentence with the code beside it.
  • An error with data in hand is stale, not an error: never replace what someone is reading with a failure panel.
  • Forbidden wins over every other state: a region the viewer may not read does not first load, then fail.
  • Colour only for a problem. Ready and loading are grey; stale takes the warning tint, an error its icon. The status rules of the Colour foundation apply.

Sensitive actions

When the server asks for a fresh check (ELEVATED_SESSION_REQUIRED), the action waits, the person proves it is them, and the action runs. They never press it twice.

    Components

    ItemFor
    permission-gateHidden, disabled with a reason, read-only or forbidden, by permission string.
    data-stateLoading, empty, error by code, forbidden, stale and ready, with dataStateOf.
    list-queryThe list query grammar and ListPage<T>: parse and serialise URLSearchParams.
    use-list-queryThat query kept in the URL, with search debounce and page reset.
    step-up-dialogThe check itself: a code or the password through your verify().
    use-step-upHolds the action on a step-up code and replays it after the check.

    Blocks that take them

    These blocks export a …Content that renders only from props: a page and its total, the query out through onQueryChange, a data state, can, callbacks that return promises, and labels.

    BlockContent
    fleet-tableFleetTableContent
    users-rolesUsersRolesContent
    users-invitationsUsersInvitationsContent
    users-audit-logUsersAuditLogContent
    settings-api-keysSettingsApiKeysContent
    settings-webhooksSettingsWebhooksContent
    settings-sessionsSettingsSessionsContent
    notification-centerNotificationCenterContent
    settings-pageSettingsPageContent
    device-enrolmentDeviceEnrolmentContent
    device-detailDeviceDetailContent
    offline-licenceOfflineLicenceContent
    project-membersProjectMembersContent
    permission-matrixPermissionMatrixContent
    webhook-deliveriesWebhookDeliveriesContent
    tenant-adminTenantAdminContent
    platform-healthPlatformHealthContent
    console-overviewConsoleOverviewContent
    incident-queueIncidentQueueContent
    incident-detailIncidentDetailContent
    maintenance-dueMaintenanceDueContent
    maintenance-work-orderMaintenanceWorkOrderContent
    rollout-overviewRolloutOverviewContent
    rollout-planRolloutPlanContent
    event-logEventLogContent
    map-workspaceMapWorkspaceContent
    list-detailListDetailContent
    mission-scheduleMissionScheduleContent
    sign-inSignInContent
    auth-passkeyAuthPasskeyContent
    auth-inviteAuthInviteContent
    auth-2faAuthTwoFactorContent
    settings-notificationsSettingsNotificationsContent
    settings-billingSettingsBillingContent
    agent-runsAgentRunsContent
    agent-traceAgentTraceContent
    agent-approvalAgentApprovalContent
    agent-chatAgentChatContent
    agent-run-gateAgentRunGateContent
    agent-run-outcomeAgentRunOutcomeContent
    agent-tool-permissionsAgentToolPermissionsContent
    app-shell-mobile-tabsAppShellMobileTabs
    app-shell-controlAppShellControl
    status-pagesNotFoundPage, NoAccessPage, ErrorPage