Tell the assistant where the settings are, not just what they are called
The index reads tracked files and page markup is not one, so it could name a conf key and never say there was a button for it.
This commit is contained in:
@@ -94,6 +94,50 @@ require_once __DIR__ . '/config.php';
|
||||
|
||||
// confform.php — script→conf-section mapping, field parsing, and write-back.
|
||||
|
||||
// Which page shows conf sections by subject rather than by script, and the route a person would
|
||||
// be told to follow to reach it. Declared once because two things need it and they must agree:
|
||||
// the page itself builds its ?sections= query from this, and Tools/ui_map_build.php turns it into
|
||||
// navigation instructions the assistant can give. A route written down in only one of those two
|
||||
// places is a route that goes stale the first time a card moves.
|
||||
//
|
||||
// `match` is the whole-word needle matched against section headers — see api/confform.php.
|
||||
const VV_UI_SECTION_SURFACES = [
|
||||
[
|
||||
'match' => 'ai',
|
||||
'tab' => 'AI',
|
||||
'route' => 'AI tab → Settings → Configuration',
|
||||
],
|
||||
[
|
||||
'match' => 'partnership',
|
||||
'tab' => 'Partnership',
|
||||
// Array fields only — the card is one collapsible block per list, because these are
|
||||
// container lists dozens of lines long and a flat form would be unreadable.
|
||||
'route' => 'Partnership tab → Array Settings',
|
||||
],
|
||||
];
|
||||
|
||||
// Pages that edit named keys rather than whole sections — a purpose-built control for one
|
||||
// setting, not a form over a conf section. Only the route is declared: the keys themselves are
|
||||
// read out of the page source by Tools/ui_map_build.php, so a control added or removed changes
|
||||
// the map without anyone remembering to update a list.
|
||||
//
|
||||
// A page missing from here is not broken; its settings simply appear as conf-only in the map,
|
||||
// which is the honest answer until someone gives it a route.
|
||||
// `also` lists keys the page assembles at runtime, which no amount of reading the source will
|
||||
// reveal — settings.php writes HOST1_DISCORD_WEBHOOK through a PHP variable holding the host
|
||||
// slot. Written with HOSTN, substituted per machine, the same convention conf_upgrade uses. The
|
||||
// generator checks each one exists and complains if it does not, so a stale entry is loud rather
|
||||
// than a route to a control that was removed.
|
||||
const VV_UI_PAGE_ROUTES = [
|
||||
'settings.php' => ['route' => 'Settings tab',
|
||||
'also' => ['HOSTN_DISCORD_WEBHOOK', 'HOSTN_STORAGE_MODE_INTERNAL']],
|
||||
'fallback.php' => ['route' => 'Fallback tab'],
|
||||
'rsync.php' => ['route' => 'Rsync tab'],
|
||||
'arrs.php' => ['route' => 'Arrs tab'],
|
||||
'watchdog.php' => ['route' => 'Watchdog tab'],
|
||||
'docker.php' => ['route' => 'Docker tab'],
|
||||
];
|
||||
|
||||
// Map: script relative id → subsection names (must match # ━━━ Name ━━━ or # ── Name ── headers).
|
||||
const VV_SCRIPT_CONF_SECTIONS = [
|
||||
// Orchestrators
|
||||
|
||||
Reference in New Issue
Block a user