fix(17): WR-07 open a singleton's record from its list route

A settings link to a singleton controller only worked on a plain left
click; a new tab landed on the list route, which answers 404, and every
non-singleton link paid an extra /singleton request. The settings index
now links like any controller link, and the list view opens the
controller's one record when its list answers 404 and the singleton
route answers an id.
This commit is contained in:
2026-10-12 21:43:07 +02:00
parent fb10b06b21
commit 9d7c21d800
5 changed files with 73 additions and 49 deletions

View File

@@ -455,7 +455,7 @@ A controller that edits exactly one record, such as a site-wide definition, impl
- The controller needs a `config_form.yaml` and no `config_list.yaml`. Its list, create, bulk and delete routes answer 404 `not_found`, and the singleton route answers 404 on any other controller.
- A settings entry whose `Controller` names the singleton controller links to it; see [Settings](settings.md).
In the admin, clicking such a settings entry asks the singleton route for the id and opens the record's form directly. The form has no Delete button, and its back button, Cancel and Save and close return to the settings index. A settings link to a controller that is not a singleton gets a 404 from that route and opens the controller's list as before.
In the admin, a settings entry links to the controller's list route like any other controller link, so a click, a new tab and a bookmark behave the same. The list view gets the 404 from the list route, asks the singleton route for the id and replaces the route with the record's form. The form has no Delete button, and its back button, Cancel and Save and close return to the settings index. A link to a controller that is not a singleton opens its list without asking the singleton route.
## Record actions