Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions docs/guides/settings-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Staged settings reference

Run the gallery and open `/static/settings`, `/server/settings` or `/wasm/settings` at its printed address. The five sections are Identity, Language and region, Content, Access and Danger zone. This is the C1 gallery route for [#76](https://github.com/fluentcms/FluentCMS.Components/issues/76), not the CMS and not a preview of the later controls.

## Try the save workflow

1. On the static route with JavaScript disabled, edit the name, description, locale and publication time. Enter `500` in Items per page and activate **Save changes**. The named native form posts those values with antiforgery. The form deliberately lets this invalid range reach the host, as in the reference screen. The host rejects it and returns the submitted edits with an error on Items per page.
2. Tab to **Go to the field** and activate it. Focus reaches the labelled number input without replacing the document or dropping its query and edits. Its description starts with the error and includes the help and the unit. Enter `45`, then save. **Settings saved** reports the received sample values.
3. Before submitting, **Discard changes** in a script-free browser resets to the values of the current document. After a response, those defaults are the ones in that response. In Server and WASM, Discard instead restores the last accepted in-memory sample, clears validation, and replaces the form's edit context. A full reload starts a new sample.
4. **Preview deleting the site** opens a native disclosure with a confirmation message. There is no delete command or endpoint. The logo input opens the browser's real chooser but has no form name: it sends no file or filename. The browser does not restore a selected file after a document is replaced, and this route makes no promise to keep file handles.

The form uses `DataAnnotationsValidator` on its sample model, not a component validator. Radio groups keep one label and help description on their field; individual options keep their own labels and descriptions. A native POST sends one choice per radio group, `true` for checked checkboxes and switches, and no entry for unchecked or disabled toggles. The badge marks values different from the last accepted sample. A successful save or interactive Discard clears it. A native reset without JavaScript restores the current document's inputs; it cannot remove a badge rendered on an invalid response. In the interactive host a small same-origin gallery module focuses the correction target; Blazor's fragment navigation otherwise only scrolls. Without JavaScript the same link is an ordinary browser fragment. Neither path promises to retain focus or an uncommitted edit across interactive takeover.

**Windows Playwright WebKit limitation.** This build uses a text fallback for publication time. With JavaScript disabled, a valid typed time can be posted; malformed text was posted and received as an empty optional time without a field error. In interactive modes, editing to `10:15` left the receiver at `09:00` because the fallback's change did not reach Blazor. The keyboard correction check without a time edit verifies focus and the page-size save, not temporal binding. This is not a Safari result.

## What is staged and who replaces it

| In this gallery | Replacement owner |
| --- | --- |
| Gallery chrome, native section links and an inline validation summary. No new shell, sticky band or tabs component. | [#85 — shared shell, navigation, tabs and persistent alert](https://github.com/fluentcms/FluentCMS.Components/issues/85). |
| Named inline save status; locale checkboxes and zone select instead of searchable choices; harmless deletion disclosure. | [#93 — notification, combobox and dialog retrofits](https://github.com/fluentcms/FluentCMS.Components/issues/93). |
| Labelled native logo chooser; no upload or storage. | [#95 — file drop zone and actual logo-upload retrofit](https://github.com/fluentcms/FluentCMS.Components/issues/95). |
| Existing gallery page navigation, with no imitation global search. | [#85 — native search in the shared shell](https://github.com/fluentcms/FluentCMS.Components/issues/85), then [#96 — global search and command palette parity](https://github.com/fluentcms/FluentCMS.Components/issues/96). |

## Relevant reference workarounds

The reference at [design/system/screens/settings.html](../../design/system/screens/settings.html) loads [screens.css](../../design/system/screens/screens.css). This gallery keeps the following ownership record for [#27](https://github.com/fluentcms/FluentCMS.Components/issues/27), without copying the complete reference stylesheet:

| Reference rule | In the staged route | Owner |
| --- | --- | --- |
| `screen-page`, `screen-form` | The gallery has a local 50rem reading measure for these five cards. | Shared shell and page measure in #85; page-container item in #27. |
| `screen-band`, `screen-band--sticky`, `screen-band--tabs` | A normal page header and section links. Save is not in a sticky shell band. | #85. |
| `screen-wide`, `screen-narrow`, `screen-search`, `screen-identity` | Not copied: the gallery has no application search/locale/avatar frame to collapse or truncate. | #85 for the frame and narrow header, #96 for search parity; shell and avatar notes in #27. |
| `screen-short` | Scoped maximum width only for Items per page and Time of a publication. | Input width follow-up under #27. |
| `screen-tall`, `screen-tall--start` | Scoped horizontal tall-row layout keeps a label and its help together. The native logo chooser is short and does not need the drop-zone offset. | Horizontal field behavior under #27; #95 for the logo retrofit. |
| Danger card/action | The card is ordinary; the native preview trigger carries danger styling. | #93 for the confirmation dialog, with the card tone/action question tracked in #27. |

## Automated checks

```powershell
dotnet test --project tests/FluentCMS.Components.Browser --filter-class 'FluentCMS.Components.Browser.Forms.SiteSettings*'
```

Run with `FLUENTCMS_MODES` unset to cover all three render modes. The scoped tests check the actual posted and retained values, range validation, native and interactive reset, keyboard focus, first interactive markup, axe and small-width targets. The visual comparison uses actual HTTP pages and records differences due to the staged controls and gallery chrome; it does not claim full reference parity.
1 change: 1 addition & 0 deletions gallery/Gallery.Client/GalleryPages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public static class GalleryPages
new("segmented", "Segmented"),
new("date-time", "Date and time"),
new("form-post", "Form submission"),
new("settings", "Site settings"),
new("tokens", "Tokens"),
new("theme-provider", "Theme provider"),
new("patterns", "Patterns"),
Expand Down
Loading