wu-sheng opened a new pull request, #10:
URL: https://github.com/apache/skywalking-horizon-ui/pull/10

   ## Three connected improvements
   
   Driven by "show what's relevant, never a blank page" + reduce duplicate OAP 
fan-out.
   
   ### 1. Overview visibility gated by layer availability
   
[`useOverviewDashboards.ts`](apps/ui/src/render/overview/useOverviewDashboards.ts)
 now derives each dashboard's layer set from **widgets' `layer` fields ∪ 
explicit `layers[]`** and gates the sidebar entry against the live 
`availableLayers` (any-match rule — at least one layer reporting services). A 
dashboard you create via "+ New" inherits this automatically — no 
hand-maintained `layers[]` needed. Refreshes on the existing 60s menu cadence + 
window focus, so entries appear / disappear as services start and stop 
reporting.
   
   ### 2. Server-global `ServiceLayerCatalog`
   New 
[`apps/bff/src/logic/services/service-layer-catalog.ts`](apps/bff/src/logic/services/service-layer-catalog.ts)
 — process-singleton, 60s TTL, single-flight, exposes `byLayer` + `byName` + 
`layers`. The sidebar menu's per-layer counts and the alarms layer-tagger share 
this cache instead of each running their own `listServices(layer)` fan-out. 
**OAP sees at most one fan-out per minute regardless of how many routes are 
polling**, and the two views can no longer drift relative to each other.
   
   - Deleted: `apps/bff/src/logic/alarms/service-layer-map.ts` (alarms-only 
predecessor).
   - Migrated: alarms route + config + menu route → catalog (`get()` / 
`invalidate()` unchanged for alarms; menu drops its own `fetchCountsForLayers` 
shim).
   
   ### 3. Landing cascade + `/landing-empty`
   Root `/` now cascades to a real destination so the user never sees a blank 
page:
   
   ```
   publicOverviews[0]        → /overview/<id>                  (services-backed 
overview)
     ↓
   availableLayers[0]        → /layer/<key>/<firstLayerTab>     (services on a 
layer)
     ↓
   layers[0]                 → /layer/<key>/<firstLayerTab>     (first bundled 
template,
                                                                 even with no 
services)
     ↓
                             → /landing-empty                   (the empty 
landing card)
   ```
   
   [`/landing-empty`](apps/ui/src/render/overview/OverviewLanding.vue) is a 
real bookmarkable route — viewer-friendly copy, no action buttons (the old 
"Open templates" jump 403'd for viewers). Two distinct empty states with 
distinct copy:
   
   - **No data is flowing yet** — *"Ask your operations team to verify that the 
agents or receivers for your services are configured and pointing at this OAP."*
   - **No dashboard configured yet** — *"Ask your operations team to set up a 
dashboard for you."*
   
   ### 4. Debug events default off
   [`debugPanel.ts`](apps/ui/src/controls/debugPanel.ts) — first-visit default 
is now **off** uniformly, not on for localhost. Same baseline for operators and 
developers so reproductions match what operators see. The localStorage 
stickiness is unchanged.
   
   ## Validation
   - `pnpm --filter ui run type-check`, `pnpm --filter 
@skywalking-horizon-ui/bff run type-check`, lint, `license-eye header check` — 
all green.
   - UI: 69 tests pass • BFF: 80 tests pass.
   - Exercised against the demo OAP: per-layer service counts come through the 
catalog; the menu honors disabled-layer status (carry-over from previous PR); 
the cascade lands cleanly when overviews + layers are absent.
   
   ## Notes for reviewers
   - The catalog reuses the existing `ServiceLayerMap`'s public shape for 
alarms (`get()` returns `{layers, byName}`); the new `byLayer` field is 
additive.
   - A legacy / booster-ui template living next to Horizon's in OAP is already 
silently skipped by `parseEnvelope` (foreign namespace), so this work doesn't 
change cross-tool coexistence.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to