Files
dawnline/rules/ui-design.md
T
Aemeath ac90575b0b
Build packages / CI (push) Blocked by required conditions
Build packages / Version (push) Waiting to run
CI / Web (format, types, tests, bundles) (push) Blocked by required conditions
CI / ShellCheck (push) Blocked by required conditions
CI / Backend (Go: vet, tests, a real ubusd and uhttpd) (push) Blocked by required conditions
CI / Package files (push) Blocked by required conditions
Dawnline 0.20.0
- **Backend rewritten in Go.** One daemon, `dawnlined`, replaces the whole ucode backend: the rpcd plugin, the agent, the CLI and the updater. The package no longer depends on ucode.
- **Per-architecture builds.** The release carries the backend for arm64, ARMv7, mips, mipsle and amd64; the router fetches its own after the package is installed and checks its sha256. Dawnline does not run on other architectures (older ARM, 32-bit x86, RISC-V).
- **Faster on the router.** A firewall sync takes 0.06 s instead of 0.9 s; a full apply takes about 300 ms. The portal is served by the daemon itself, without a CGI process per request.
- **Live pages.** The admin and the portal follow a live stream from the router instead of re-fetching the whole state every 30 seconds.
- **Admin redesigned in the portal's style.** Three sections (Overview · Log · Settings); a server is a page of its own with People, Places and Settings; a device opens as a dialog over its person.
- **Changes wait for «Apply».** Every setting, and a person's access, is staged in one dock before it reaches the router.
- **Configuration rollout.** After a change that makes devices fetch their configuration again, the admin shows how many have fetched it and who has not. Every setting shows beforehand (⟳N) how many devices it will touch.
- **Waiting for a decision.** Overview and People put first the people who need one (access ended, limit reached, a device that does not connect), each with its one action a tap away.
- **Bulk actions on people.** «Select» (or a long press on a card) picks several people to extend by a month, pause or resume at once.
- **Undo.** An action done from a card or a request is undone from its toast.
- **Update dialogs redesigned.** An update is one view from its question to its result; Dawnline's own update runs in it like every other, and the page reloads itself once the new version answers. Other versions are a list, each with its notes and Install on a page of its own.
- **Site to site: networks behind a router.** A router connected as a device can have networks behind it (up to eight, /16 to /30): the server routes them and applies the router's access to them. A network that shares addresses with a tunnel, the router's own networks or another site is refused by name.
- **Routers from the portal.** People can add a router and name its networks on their own page; the admin accepts or declines with a reason, or lets them through without asking.
- **Check access and Health know the networks behind routers.**
- **Usage limits reworked.** A monthly limit no longer follows the calendar. A person's month starts with their first traffic and ends a month later; the next one starts only when they connect again, so time away uses up none of it. Before, everyone's limit reset on the 1st.
- Extra data lasts until that person's month ends; «Reset usage» starts the month anew.
- A limit is for a month or for the whole term; the admin and the portal show when it resets.
- Charts that said «this month» show the last 30 days.
- After the update nobody loses what was counted: the month that was running becomes the person's first and ends on the 1st.
- **Access by time of day removed.** The Hours limit is gone from the admin, the portal and the backend; saved hours are dropped.
- **Expiry simplified.** An end date always stops access, with a heads-up three days before; the per-person choice is gone.
- **No false disconnects from sleeping phones.** A phone or a tablet stays online through ten minutes of silence.
- **Mobile Safari fixes.** Pressing a control no longer sends the page to its top; tab tracks that do not fit scroll; switches animate after a press.
2026-11-13 09:43:50 +03:00

53 lines
13 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# UI design (Dawnline admin, portal and other panels)
The bar is a modern product UI (Linear / Vercel / Raycast level), not a "native" LuCI form. A plain label + input row, a bare radio list, three columns of check marks or a text dump is a first draft, never the result.
**One design system, `DESIGN.md`** (repo root): the personal portal's, and the admin's too. Read it before any work on either, mocks included. Build from its tokens, components and spring tokens, follow its Do's and Don'ts, and update it in the same change when the look or motion changes.
## The admin on the portal's design system
Every admin page is drawn on `DESIGN.md` inside LuCI (the concept: `dawnline-admin-concept`; the structure: its `docs/ia2/`, decisions in `06-decisions.md`). Three sections answer three questions: **Overview** (does everything work now: «now» in numbers, the servers, Health), **Log** (what happened: the feed with its filters) and **Settings** (how the router, the portal and Dawnline itself are set up: a rail of sections shown one at a time). Everything of one server stands behind one door (the owner's structure, 2026-11-11): a server's card on Overview opens **the server's page**, whose track across the page is Overview (does this server work, who on it waits for a decision, its rollout, its checks, the path check) · People (their cards grouped by state; a person's page takes the list's place) · Places (the map of where they connect from) · Settings (General: its name, whether it runs, its address, removing it; Core: what is the tunnel core's own; Network: where the tunnel leads; a rail names the three, a jump pill on a phone). A device is not a page: it opens from its person as a dialog in two columns (what it does on the left, what it is set up with on the right), and «Map and replay» and «Show set-up» are steps of that dialog. A person, a device and Places are not LuCI pages: they are People's `?id=`, `?device=` and `?view=map` inside the server's frame. One fact, one place holds across the frame: the server's state is its head's, who waits is its Overview's (the main Overview only counts them on the server's card), a device's state is said once in its dialog. The old addresses (Person, Device, Places, System, Activity, Health, Diagnostics, Updates, the old Settings, Server and Servers pages' sections) lead to their places now.
- **A card says only what is true now and changes something.** A person's card on People has its parts by their state (`people/card.ts`, DESIGN.md › Person card): a decision is its line and its button, someone fine is presence and traffic, a quiet state is one line. What stops many people at once (a server turned off, a rollout) is one notice over the list, not a part of each card. Counts of people (chips, group heads, Overview's «Waiting for a decision») come from the same matrix.
- **No page of accordion rows.** An object's page is not a stack of «name — value» rows that fold: each thing it has gets a form of its own that shows its state and is edited on itself (a term with its calendar, a measure with its limit, switches of what is reached, a file card). A fold is allowed inside such a part for what is read always and changed rarely (the interfaces a server does not offer as home networks), never as the page's skeleton.
- **Run the padding lint before showing or shipping a look change:** `node tools/ia3-pads.mjs` in the concept repo (`SHEETS=<openers.jsonl>` walks the sheets too, `W=390` the phone), DESIGN.md › «Paddings, checked». It must print «0 findings»; a finding is fixed in the stylesheet, not silenced in the tool, unless the tool misread a clipped or pinned element.
- **A name and a note never look alike, and a note sits with what it explains** (DESIGN.md › «A name, a value, a note»): a label or caption in the text's colour with a weight, a note in the second tone 6 px under its thing and well clear of the next name, one note a thing. Before adding a line of grey text, say which thing it explains and put it there; if it explains nothing in particular, it is a lead or it goes.
- **One home per fact and control**; elsewhere only a pointer to it (a number or a phrase that leads there).
- **A fix stands where the problem is.** A check that did not pass is shown in the Settings section it is about, with its fix as a button or its advice; Overview shows the same signal as a link to that section, without a second button (it keeps a button only for a check no section is about).
- **Settings wait for «Apply».** Nothing that changes how a server works or what a person may do is made by one press (the owner, 2026-11-11: «половина настроек не имеет подтверждения»): the edit waits, its place shows the new value as not applied, a dock at the window's foot says «N changes · M devices will fetch the configuration · Apply / Cancel». «Apply» makes them all: when devices must fetch their configuration again it asks one question naming every change first and starts one rollout, which the page then shows open; when none must, «Apply» is the whole confirmation. This holds for a server's Settings (every field, the disguise, the home networks, how internet traffic leaves, the WAN, who sees whom), for the router-wide sections (the portal with its addresses, port, certificate files and unknown links; new people's defaults; the update policy; history and what is recorded: one dock with the server's changes, «not applied» at the end of the section's head) and for a person's page (what they reach, the limit and its period, the device limit). Not settings, so made at once: a name or a note typed and confirmed with Return; the one-tap actions with Undo in their toast (pause and resume, extend, more data this month, a device or a server turned on or off as before); what destroys or cannot be undone asks its own question (remove, new keys, reset). Leaving with changes waiting is asked about.
- **The rollout is open on the page**, not behind a pill: how many fetched, the change it follows, a cell a device, who still waits with their links (no «Remind everyone»: the owner removed it, a person is reminded with their own link).
- **Inside LuCI, in a Shadow DOM.** The theme's rules stop at the page's host and ours never reach the theme. What floats (the sheet, ⋯ menus, toasts, the map's marker card) is in a second host on `<body>`, above Outline's header and sidebar, below LuCI's own modal.
- **No ground of our own.** The page stands on the theme's background: dark keeps the portal's ladder on the theme's black; light steps raised → field → knob down in tone from the theme's near-white (`styles/shadow/ground.css`).
- **Theme from LuCI** (`html[data-darkmode]`, Outline's button switches it in place), else the system's. **The system font**, as the portal.
- **Own navigation, no LuCI tabs.** LuCI's menu keeps one Dawnline item (an alias of Overview); every section is a view of its own (Back and bookmarks work) and the page draws its own row: Overview · Log · Settings, the portal's segmented track with words (`shell/nav.ts`); a server's page keeps Overview lit and draws its own track under its head. What is picked inside a section (a panel, a view, a filter) is in its address too.
- **Layout by the page's width**, not the window's (container `dlpage`: inside LuCI the column is ~910 px on a 1440 screen).
- **Admin-only parts on the portal's tokens:** the page head (glass, name, facts after dots, ⋯ on the right), a labelled segmented track with counts or icons (narrow: icons, the picked one with its word), the kit (`rules/frontend.md`: a person's card by state with its device tiles, the filter bar with its search and chips, a list of choices under its button, a list and the page of one thing in it (the way back and ×), a tooltip for a thing without words, a rail of sections with a jump pill on a phone, a section with its cards, option tiles that draw their choice, a measure with its limit, a server's way in as two named cells and the router's verdicts as rows, a row of a thing with its actions in sight, the empty state, a map with its list, and a panel's parts: term, traffic measure, what-they-reach switch rows, set-up card, place rows with strips, the short feed), rows of a feed in a raised card under day heads, the way back (‹ parent), charts in the map's language (`--live`, `--past`: the line of days with the period before it dashed, the live line under a speed, today by the hour as bars).
- **Approved deviations from the portal:** an undo beside a toast's words for a reversible one-tap action (5 s, held under the pointer or focus); toasts wrap (the admin's sentences are longer); the portal's buttons, sheet and menus as they are, nothing restyled.
- **Read-only logins** see values without the controls that would fail (`shell/role.ts`), and a «View only» fact in the head.
- **Four LuCI modules, each under 576 KiB** (uhttpd sends them uncompressed; the build refuses more): the pages (`dawnline.app`), their stylesheet (`dawnline.style`), the map (`dawnline.map`, loaded when a page draws one) and the QR generator (`dawnline.qr`, loaded when a sheet draws a code). Something a page rarely needs and that would push a module over goes into a module of its own, loaded on demand (`rules/frontend.md`).
## Approach
- **Mock first.** Any visible change beyond a one-line fix: show a mockup (2–4 genuinely different options when the direction is open) with a recommendation, then build the chosen one. Do not start coding a layout the user has not seen.
- **Think past the obvious.** When an option is rejected as "not it", propose new concepts, not variations of the same layout.
- **Structure over text.** Tiles, segmented tracks, pills, round knobs, inline status, folded rows. Summaries first ("All 6 checks passed"), details on demand.
- **No duplication.** One place per fact (usage, device count, links), a state said once (DESIGN.md › Principles). Remove what is repeated elsewhere on the page.
- **Reuse the house parts** before inventing new ones: the portal's components (DESIGN.md) and the admin's `ui/` and `widgets/` (page head, tabs, the kit, edit rows, stepper, the rows of checks and components, the rollout strip, line chart, live line, map box). An edit row is for a number without a picture of its own (MTU, keep-alive), at most four in a card, never a page of them. A new class only when nothing fits, and then on the portal's tokens.
- **Alignment and spacing are part of the design.** Shared margins and edges, equal heights in a row, controls pinned consistently, nothing clipped or overflowing, single-line labels where they fit.
- **No ellipsis on buttons or menu items** ("Remove", not "Remove…"), even when they open a sheet. "…" only for progress ("Loading…") and truncated values.
- **Colour means something:** ok = green, warn/pause = orange, danger = red, accent = blue; on charts and the map, live = blue, the past = grey. Icons for states instead of words where obvious.
- **Honest warnings** belong in the UI (e.g. plain HTTP, Cloudflare throttling), shown where the choice is made.
## Mocks look like the real product
A mock is judged against the page it will live on, so it must already look like it. Hand-drawn look-alikes with invented styles get rejected ("выбивается из дизайна").
- **Study the existing pages first** (the section being changed and its neighbours) and build only from their parts: the portal's components and tokens (DESIGN.md), the admin's `ui/` and `widgets/`.
- **Build it from the real code and CSS**, not from a copy: the concept repo's mock pages run the real `web/src` modules (the portal's, the admin's) on demo data; a change to an existing page is mocked in a LuCI stand-in (Outline's shell and `main.css`, LuCI's globals stubbed, the RPC answered from fixtures) that loads the built `app.js`, `style.js` and `map.js`.
- **Show only what changes.** Do not add existing, unrelated controls to a mock; say in the caption that the rest of the page stays.
- Keep mocks outside the product repo, serve them with `python3 -m http.server` started from Bash (the preview server cannot read `~/Documents` on macOS), and delete the folder when the feature ships.
## Done means seen
Look at it in the browser before reporting (a LuCI stand-in, or the router after a deploy): 1440 and 390 (touch), both themes switched from Outline's button, read-only too. Look at whole screens, not crops alone, and measure overflow at 390 inside the shadow roots (the page's and the layer's). Check sheets and menus stack correctly and long values do not overflow. Look at it in Russian too: a visible change is localized in the same change (`i18n.md`), and Russian text is longer.