mirror of
https://github.com/zvx-echo6/meshai.git
synced 2026-06-10 17:04:45 +02:00
Restructures the environmental config UI into the 7-family taxonomy on the
/environment page (Matt-approved Option C: unified families = config +
live status per adapter). The editable adapter config moves out of the
Config page's "Environmental" tab (now deprecated) onto /environment, where
each adapter sub-tab shows its AdapterPanel (on/off + feed_source + settings)
together with its live status (feed health + active events).
Frontend (dashboard-frontend/src):
- pages/Environment.tsx rewritten: 7 family tabs (Weather, Fire, RF
Propagation, Roads, Geohazards, Tracking, Mesh Health) -> per-family
adapter sub-tab strip -> AdapterPanel.
* AdapterPanel: header row = on/off Toggle + feed_source toggle
(native|central). When OFF, feed_source + all settings grey out
(disabled, not hidden).
* Native-only adapters (ducting, avalanche, roads511 -- no Central stream
per C.1's ADAPTER_SUBJECTS) show the feed_source toggle with 'central'
disabled + a 'Central not available for this adapter' tooltip/label.
* Missing-key adapters (firms, roads511) show an 'API key not configured
-- contact admin' notice; toggles still operate.
* Tracking = placeholder ('No adapters yet. ADS-B / AIS / satellite passes
are planned for v0.5.'). Mesh Health = no env adapters; a disabled
feed_source toggle with 'central' greyed for future migration.
* All existing per-adapter settings preserved verbatim (NWS zones/user_agent/
severity, ducting lat/lon, fires state, avalanche centers/season, USGS
sites, traffic corridors+key, roads511 base_url/key/endpoints/bbox, FIRMS
map_key/source/confidence/bbox). ALSO adds a usgs_quake panel
(tick/min_magnitude/region/bbox) -- usgs_quake (2.14) was never exposed in
the old GUI. feed_source field (C.1) now surfaced per adapter.
* Per-adapter live status: reuses /api/env/status feed health + /api/env/active
events (filtered by source; fires->nifc mapping). Refreshes every 30s.
- pages/Config.tsx: removed the now-duplicate 'Environmental' tab (SECTIONS
entry + render case + EnvironmentalSection function + unused Thermometer
import); exported the shared form primitives (Toggle, TextInput, NumberInput,
SelectInput, ListInput, NumberListInput, US_STATES) for reuse by Environment.tsx.
- Reuses the existing restart_required banner pattern.
- Rebuilt static: meshai/dashboard/static/{index.html, assets/index-9OZ6ZqzI.js,
index-B_J_Z7c8.css} (vite emptyOutDir replaced the old hashed bundle).
Rule 17 / no backend change: config is wired to the existing schema-driven
GET/PUT /api/config/environmental (the C.1 feed_source + central + usgs_quake
fields ride the generic dataclass coercion). No backend edited this phase.
Verification: (A) `npm run build` clean -- tsc strict + vite, only the
pre-existing >500kB single-chunk advisory (not introduced here). (B) static
committed; prod rebuilt picks it up. (C) GET / returns the new SPA shell
(index-9OZ6ZqzI.js); the bundle contains the new family strings (Geohazards,
RF Propagation, ADS-B, 'Central not available', 'API key not configured').
(D) GET /api/config/environmental returns all adapters with feed_source=native,
usgs_quake present, central{enabled:false} -- toggles bind to real data; all
native, nothing flipped. Rebuilt prod healthy.
*** BLOCKER FOUND (pre-existing, NOT introduced by C.2) -- flagged for C.2.1 ***
The save half of gate D fails: PUT /api/config/environmental returns
{"detail":"could not determine a constructor for the tag '!include' ..."}.
Root cause: the dashboard PUT handler (meshai/dashboard/api/config_routes.py)
calls meshai/config.py::save_config (monolithic; re-parses config.yaml with a
loader lacking the !include constructor) instead of the multi-file-aware
meshai/config_loader.py::save_section that exists for exactly the !include
layout. This breaks ALL GUI config saves in prod (every section, not just
environmental) and predates C.2 -- the old Config 'Environmental' tab had the
same broken save; C.1 did not touch save_config. The C.2 GET/render/toggle-bind
works; only persistence is blocked. Verified disk pristine (idempotent PUT
errored, wrote nothing; env_feeds.yaml md5 unchanged, restored from backup).
FIX (one line, but prod-wide blast radius -> wants its own phase + verification):
config_routes PUT should call config_loader.save_section(section, data, config_dir)
instead of config.save_config(...). Recommend C.2.1 backend fix before C.3.
C.3 (quake-to-central flip) should not proceed until C.2.1 unblocks GUI save,
since flipping feed_source from the GUI is the whole point.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| src | ||
| index.html | ||
| package.json | ||
| postcss.config.js | ||
| tailwind.config.ts | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||