# Urban OS canonical page template

## 1. Page declaration

Before implementation, record:

- route;
- page owner;
- selected shell: Public, Account, Workspace or Spatial;
- primary entity and identifier;
- primary user role;
- primary outcome;
- real APIs used;
- demonstrations or planned integrations;
- applicable languages and themes.

## 2. Shared assets

Load the canonical token and contract files before page-specific code:

```html
<link rel="stylesheet" href="/shared/uos-tokens.css">
<link rel="stylesheet" href="/shared/uos-shell.css">
<link rel="stylesheet" href="/shared/uos-tour.css">
<link rel="stylesheet" href="/shared/uos-assistant.css">
<script src="/shared/uos-contracts.js" defer></script>
<script src="/shared/uos-shell.js" defer></script>
<script src="/shared/uos-tour.js" defer></script>
<script src="/shared/uos-assistant.js" defer></script>
```

Mount the canonical shell with `<div data-uos-shell="public" data-uos-current="platform" data-uos-auto></div>` and declare IVA context on `<body data-uos-assistant="Page name" data-uos-assistant-stage="Lifecycle context">`. Replace `public` with exactly one approved shell. Do not copy or fork shared modules.

## 3. Landmark structure

```html
<a class="skip-link" href="#main">К содержанию</a>
<header><!-- selected shell header --></header>
<main id="main">
  <header><!-- page context and H1 --></header>
  <section aria-labelledby="primary-section-title"><!-- primary workflow --></section>
  <aside aria-label="Контекст"><!-- sources, status, help --></aside>
</main>
<footer><!-- public pages only, or compact legal footer --></footer>
```

## 4. Context header

Workspace and Spatial pages must expose:

- organization;
- project title and `projectId`;
- lifecycle stage;
- current version;
- save/sync state;
- user role and access level.

Use truncation for long titles while keeping the full value available in an accessible label or tooltip.

## 5. Navigation

- Global navigation changes platform area.
- Module navigation changes the current product surface.
- Tabs change views of the same entity.
- Breadcrumbs show hierarchy but do not replace the project switcher.
- Back buttons describe their destination.
- Mobile navigation keeps the primary action and context visible.

## 6. Page templates

### List / directory

Search, filters, saved view, sort, result count, bulk selection, pagination or progressive loading, empty state and recoverable error.

### Detail

Identity block, status, metadata, primary action, related entities, versions, activity and permissions.

### Workspace

Project context, main work surface, inspector, task/approval context, async status, save state and version lineage.

### Wizard

Outcome, numbered progress, validation, back, skip where safe, save/resume and explicit completion.

### Settings

Stable left navigation, grouped cards, save scope, unsaved-change protection, destructive zone and audit explanation.

### System state

Reason, affected context, preserved work, next action, retry/support and technical reference without exposing secrets.

## 7. Responsive contract

- `>=1280`: 12-column desktop shell.
- `768–1279`: 8-column tablet shell; inspector may move below.
- `<=767`: 4-column mobile shell; secondary navigation collapses.
- `<=420`: compact controls; no horizontal page overflow.

Tables may scroll inside their own region. Primary navigation, buttons and statuses must not wrap into ambiguous labels.
