From aab5634ff71c663e30f5f4fb648449740048256d Mon Sep 17 00:00:00 2001 From: Peter van Arkel Date: Thu, 3 Dec 2026 16:26:19 +0100 Subject: [PATCH] Document shared panel design patterns --- CONTRIBUTING.md | 10 ++----- docs/panel-design.md | 68 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 8 deletions(-) create mode 100644 docs/panel-design.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ebad7c1..98b5def 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -194,14 +194,8 @@ python tools/web_update_manifest.py dist/coulobre_panel-0.10.2rc1-py3-none-any.w For example, “This zone changed before publication. Reload the account and try again.” Keep credentials and raw service output out of messages shown in the panel. -- Reuse existing templates and styles for controls, focus states, and - status labels. Keep form inputs labelled and validation errors close to - the field that needs attention. -- Use the shared workspace template for signed-in pages. Place the page - heading first, followed by local tabs and any account, domain, or list - filters. Start the main content below the divider. Keep status updates - separate from forms the operator or customer may be editing. - [Workspace template](src/coulobre/hosting/templates/hosting/workspace_page.html) +- Follow the [panel design guidelines](docs/panel-design.md) for Core and + Premium layouts, forms, and UI review. ## Checks diff --git a/docs/panel-design.md b/docs/panel-design.md new file mode 100644 index 0000000..78544a8 --- /dev/null +++ b/docs/panel-design.md @@ -0,0 +1,68 @@ +# Panel design guidelines + +Core and Premium share one panel interface. Core owns the workspace layout, +theme tokens, and reusable UI patterns. Both editions follow this guide. +Reuse Core's templates and classes before adding a new style. If a pattern +belongs in both editions, add it to Core and document it here. Premium should +only use shared components available in its supported Core versions. + +## Page structure + +- Extend [the workspace template][workspace] for signed-in pages. Follow + **HTTP Settings** for pages with tabs. Put the page title and any page-wide + actions first, then local tabs, then an account or domain selector if + needed. The workspace divider separates these controls from the content. +- Keep the page title stable across tabs. Mark the current tab with + `aria-current="page"` and give the tab navigation an accessible label. +- Use `.live-sections` to space stacked sections. Keep live status refreshes + separate from forms so they cannot erase edits or move keyboard focus. +- Use `.surface` for sections, `.section-heading` for ordinary section + headers, and `.table-scroll` around tables. Keep horizontal overflow in + the table wrapper and give empty or pending states an explicit label. + +## Forms and actions + +For a compact editor, use `.surface.editor-surface` on the card and +`.editor` on the form. Render Django fields with `form.as_div` so each +field, label, and validation message occupies one row in the shared grid. +Put the explanation and submit action inside the same grid. Don't add a +padded `.section-heading` inside an already padded editor card. The +heading, help, fields, and actions should share a left edge. + +```django +
+
+ {% csrf_token %} +
+

Edit settings

+

Explain what these settings affect.

+
+ {{ form.as_div }} +
+ +
+
+
+``` + +- Use one clear primary action per form. Put secondary actions such as + Cancel in the same `.form-actions` row when they apply to that form. +- Use short, sentence-case action labels. Keep field errors beside their + inputs. Use visible labels and keep essential instructions available + without relying on pointer hover. +- Prefer the shared compact type and spacing. Use [the panel stylesheet][css] + and its theme tokens for type, color, spacing, and focus states. Avoid + fixed control widths, inline styles, and page-specific font sizes. + +## Review a UI change + +Compare the result with a Core page that serves the same purpose. In light +and dark mode, check desktop and narrow widths, keyboard focus, and fields +with validation errors. Try long domains, identifiers, and filenames. Text +should stay readable, controls should remain inside their cards, and wide +tables should scroll within their wrapper. Verify empty and populated states +for lists. For Premium changes, use the same checks against the supported +Core layout before introducing a new pattern. + +[workspace]: ../src/coulobre/hosting/templates/hosting/workspace_page.html +[css]: ../src/coulobre/hosting/static/hosting/panel.css -- 2.43.0