You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2026/06/25 14:50:47 UTC

(skywalking-horizon-ui) branch feat/dashboard-tab-widgets updated (5c3d343 -> 4817e94)

This is an automated email from the ASF dual-hosted git repository.

wu-sheng pushed a change to branch feat/dashboard-tab-widgets
in repository https://gitbox.apache.org/repos/asf/skywalking-horizon-ui.git


    omit 5c3d343  feat(layer-dashboards): Clear-all to exit compare; fix dead record pop-out + compare-state desyncs; bound post-flatten cap
    omit 7b84d70  fix(layer-dashboards): compare-mode pop-out availability + lock the >40 chunking; trim comments
    omit 86b21ce  fix(layer-dashboards): compare/visibleWhen parity for tab children + unified widget-tree traversal
    omit 5157d4e  fix(layer-dashboards): tab feature hardening — 15 review findings (P1 tab-switch flash + id collisions, compare/pop-out parity, +P2/P3)
    omit 5438fb0  test(bff): regression tests for flattenTabWidgets + widgetSchema tab acceptance
    omit 1f9d91f  fix(layer-dashboards): tab correctness — empty-tab deadlock, in-tab visibleWhen, compare, BFF tab-awareness
    omit a3fb577  style(layer-dashboards): thicker runtime tab boundary line (2px, brighter)
    omit 200cf76  style(layer-dashboards): selected tab is a solid filled colour (editor + runtime)
    omit f94ca40  style(layer-dashboards): taller tab bar + larger tab labels (editor + runtime)
    omit 59ae1b4  fix(layer-dashboards): runtime tab boundary = top/bottom + four corners, no side lines
    omit a875551  fix(layer-dashboards): tab boundaries — framed tile in the editor, no-space outline at runtime
    omit 4524ecf  feat(layer-dashboards): tab visual rework — tabs in the header, underline frame, canvas re-shrinks
    omit 383d00d  fix(layer-dashboards): editor polish — sticky header, tab frame, in-tab resize / drag-out
    omit 9b651a5  feat(layer-dashboards): edit tab panels INLINE on the tile (no drill) + editor UX
    omit d47b8d6  refactor(layer-dashboards): tab = named panel of many widgets (not one widget)
    omit 70b8f1a  feat(layer-dashboards): richer tab authoring — kind picker, add-from-canvas, drag-in
    omit 7c14646  feat(layer-dashboards): tab widgets — several widgets in one slot, lazily loaded
     new 4817e94  feat(layer-dashboards): tab widgets — several widgets in one named-panel slot, lazily loaded

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (5c3d343)
            \
             N -- N -- N   refs/heads/feat/dashboard-tab-widgets (4817e94)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


(skywalking-horizon-ui) 01/01: feat(layer-dashboards): tab widgets — several widgets in one named-panel slot, lazily loaded

Posted by wu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wu-sheng pushed a commit to branch feat/dashboard-tab-widgets
in repository https://gitbox.apache.org/repos/asf/skywalking-horizon-ui.git

commit 4817e94592b4cc460d765a9e3003a14eb2fdeaca
Author: Wu Sheng <wu...@foxmail.com>
AuthorDate: Thu Jun 25 22:50:12 2026 +0800

    feat(layer-dashboards): tab widgets — several widgets in one named-panel slot, lazily loaded
    
    A layer-dashboard widget can now be a `tab` container: one grid slot holding any
    number of named tab panels, each its own little dashboard of card / line / top /
    record / table widgets in a 12-column sub-grid. Switching a tab swaps the whole
    set, and only the ACTIVE tab is queried — an unopened tab costs nothing and a
    previously-viewed one stays warm. A tab carries no MQE of its own and cannot
    nest another tab (one level deep).
    
    Authored inline in the Layer dashboards admin: add a widget, set its type to
    `tab`, size the slot; a segmented tab bar switches the active panel, a per-tab
    `+ widget` drops widgets in place, click a widget to edit it in the drawer,
    drag its corner to resize, or drag it out to the top level. Tabs are managed
    (add / rename / reorder / delete) from the drawer's Tabs list.
    
    Widgets inside a tab render at full parity with top-level widgets — multi-entity
    COMPARE (per-entity card rows / overlaid lines / grouped tables), the top/record
    POP-OUT, and `visibleWhen` gating (compare-aware union, never the container) all
    work, via a shared host render context. A unified widget-tree traversal
    (`walkWidgets` / `findWidgetById` / `collectWidgetIds`) is the single place that
    descends tab panels, so find-by-id / id-uniqueness / enrichment never miss a
    tab child.
    
    Querying: the SPA flattens to the active tab's leaves and chunks at the 40-widget
    request cap; the BFF flattens a tab to its first (default-active) panel for the
    template-fallback / direct-API paths, re-checks the cap after expansion for a
    hand-built body, and accepts the `tab` type + empty `expressions` in its schema.
    A half-authored (blank-MQE) leaf is dropped from the batch instead of 400-ing the
    scope. `topNOrder` is enriched for top/record widgets inside tabs too.
    
    Also: the compare bar gains a "Clear all" button to exit comparison (the CURRENT
    chip has no per-entity ×); the "OAP unreachable" banner / "refreshing" badge are
    compare-aware (a failed primary no longer mislabels a working cohort); and the
    dead single-entity `record` pop-out button is removed.
    
    Docs + CHANGELOG updated; new UI strings translated across all 8 locales.
---
 CHANGELOG.md                                       |    6 +
 apps/bff/src/http/query/dashboard.test.ts          |   65 ++
 apps/bff/src/http/query/dashboard.ts               |   83 +-
 apps/bff/src/i18n/seed.ts                          |    3 +
 apps/bff/src/i18n/validate.ts                      |    2 +-
 apps/bff/src/logic/layers/loader.test.ts           |   33 +
 apps/bff/src/logic/layers/loader.ts                |   22 +-
 apps/ui/src/api/scopes/layer.test.ts               |   55 +
 .../admin/layer-templates/LayerDashboardsAdmin.vue | 1170 ++++++++++++++++----
 apps/ui/src/i18n/locales/de.json                   |    8 +-
 apps/ui/src/i18n/locales/en.json                   |    8 +-
 apps/ui/src/i18n/locales/es.json                   |    8 +-
 apps/ui/src/i18n/locales/fr.json                   |    8 +-
 apps/ui/src/i18n/locales/ja.json                   |    8 +-
 apps/ui/src/i18n/locales/ko.json                   |    8 +-
 apps/ui/src/i18n/locales/pt.json                   |    8 +-
 apps/ui/src/i18n/locales/zh-CN.json                |    8 +-
 .../render/layer-dashboard/LayerDashboardsView.vue |  162 ++-
 .../render/layer-dashboard/useLayerDashboard.ts    |   30 +-
 apps/ui/src/render/widgets/TabWidget.vue           |  413 +++++++
 apps/ui/src/render/widgets/tabHostCtx.ts           |   79 ++
 docs/customization/layer-templates.md              |   42 +-
 packages/api-client/src/dashboard.ts               |   69 +-
 packages/api-client/src/index.ts                   |    2 +
 24 files changed, 2032 insertions(+), 268 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d986856..71980d6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -37,8 +37,14 @@ The version line is shared by every package in the monorepo (apps + shared packa
 
 ### Layer dashboard editor
 
+- **New `tab` widget — a sized slot with named tab panels, each holding its own widgets, edited inline.** A layer dashboard widget can now be a `tab` container: a grid slot you size with span / row span, holding any number of **named tabs**, where each tab is its own little dashboard — its own set of widgets (card / line / top / record / table) in a sub-grid. Switching a tab swaps the whole set, and only the active tab's widgets are queried (lazy) — an unopened tab costs nothing, and a p [...]
+- **`+ Add widget` now lets you pick the kind.** The add button opens a grouped menu — `Tab group` first, then the five widget kinds (card, line, top, record, table) — each with a one-line description, instead of always dropping in a card you then have to retype. The editor header stays pinned so the button is always reachable, and selecting a widget reserves a right-hand column for the edit drawer (the canvas re-shrinks to fit) with the drawer pinned in view as you scroll.
 - **The widget editor pins in place beside the canvas and always opens complete.** On the Layer dashboards admin, clicking a widget — anywhere on the board, including the bottom rows — now opens the per-widget editor pinned next to the canvas and fully visible, without scrolling the page (a sticky panel used to get clipped past the bottom of a tall board, hiding the editor's top or its `Up` / `Down` / `Delete` row). The move / delete controls sit in a pinned footer, and the editor tucks  [...]
 
+### Compare on a layer dashboard
+
+- **One-click exit from comparison.** The compare bar gains a **Clear all** button that drops every locked entity — including the current one, whose chip has no per-entity × — and returns the page to the single-entity view. Previously, when your only lock was the current entity, there was no way to leave compare from the bar.
+
 ## 0.7.0
 
 ### Browser errors & source maps
diff --git a/apps/bff/src/http/query/dashboard.test.ts b/apps/bff/src/http/query/dashboard.test.ts
index 1aa6b13..ea1f9ac 100644
--- a/apps/bff/src/http/query/dashboard.test.ts
+++ b/apps/bff/src/http/query/dashboard.test.ts
@@ -22,9 +22,12 @@ import {
   avgOf,
   parseLabeledSeries,
   parseTopList,
+  flattenTabWidgets,
+  widgetSchema,
   type Window,
   type MqeResultShape,
 } from './dashboard.js';
+import type { DashboardWidget } from '@skywalking-horizon-ui/api-client';
 
 const W: Window = { start: '2026-05-17 1000', end: '2026-05-17 1100', step: 'MINUTE' };
 
@@ -394,3 +397,65 @@ describe('parseTopList — owner-scope priority for display names', () => {
     expect(parseTopList({ type: 'X', results: [{ values: [] }] })).toBeNull();
   });
 });
+
+const leaf = (id: string, type: DashboardWidget['type'] = 'card'): DashboardWidget => ({
+  id,
+  title: id,
+  type,
+  expressions: [`${id}_mqe`],
+});
+
+describe('flattenTabWidgets — tab containers expand to their leaf children', () => {
+  it('leaves a tab-free list untouched', () => {
+    const ws = [leaf('a'), leaf('b', 'line')];
+    expect(flattenTabWidgets(ws)).toEqual(ws);
+  });
+
+  it('expands a tab to ONLY the first (default-active) panel’s widgets — lazy, not every panel', () => {
+    const ws: DashboardWidget[] = [
+      leaf('top1'),
+      { id: 'grp', title: '', type: 'tab', expressions: [], tabs: [
+        { name: 'T1', widgets: [leaf('a'), leaf('b')] },
+        { name: 'T2', widgets: [leaf('c')] },
+      ] },
+      leaf('top2'),
+    ];
+    // 'c' (in the non-active second panel) is NOT queried — bounds the OAP request.
+    expect(flattenTabWidgets(ws).map((w) => w.id)).toEqual(['top1', 'a', 'b', 'top2']);
+    expect(flattenTabWidgets(ws).some((w) => w.type === 'tab')).toBe(false);
+  });
+
+  it('tolerates empty / missing tabs (no children → nothing emitted for the container)', () => {
+    const ws: DashboardWidget[] = [
+      { id: 'g1', title: '', type: 'tab', expressions: [], tabs: [{ name: 'T', widgets: [] }] },
+      { id: 'g2', title: '', type: 'tab', expressions: [] },
+    ];
+    expect(flattenTabWidgets(ws)).toEqual([]);
+  });
+
+  it('never recurses a nested tab into the leaf stream (one level deep)', () => {
+    const nested: DashboardWidget = { id: 'inner', title: '', type: 'tab', expressions: [], tabs: [] };
+    const ws: DashboardWidget[] = [
+      { id: 'outer', title: '', type: 'tab', expressions: [], tabs: [{ name: 'T', widgets: [leaf('a'), nested] }] },
+    ];
+    expect(flattenTabWidgets(ws).map((w) => w.id)).toEqual(['a']);
+  });
+});
+
+describe('widgetSchema — accepts the tab container', () => {
+  it('parses a tab widget with empty expressions + a tabs array', () => {
+    const r = widgetSchema.safeParse({
+      id: 'grp', title: 'Group', type: 'tab', expressions: [],
+      tabs: [{ name: 'Traffic', widgets: [{ id: 'c', title: 'C', type: 'card', expressions: ['m'] }] }],
+    });
+    expect(r.success).toBe(true);
+  });
+
+  it('still rejects a non-tab widget that is malformed (no expressions on a leaf inside a tab)', () => {
+    const r = widgetSchema.safeParse({
+      id: 'grp', title: 'Group', type: 'tab', expressions: [],
+      tabs: [{ name: 'T', widgets: [{ id: 'c', title: 'C', type: 'card', expressions: [] }] }],
+    });
+    expect(r.success).toBe(false);
+  });
+});
diff --git a/apps/bff/src/http/query/dashboard.ts b/apps/bff/src/http/query/dashboard.ts
index fed6c03..645bb2f 100644
--- a/apps/bff/src/http/query/dashboard.ts
+++ b/apps/bff/src/http/query/dashboard.ts
@@ -71,7 +71,10 @@ export interface DashboardRouteDeps {
 /** Shared with config/layer-template.ts — kept here because the
  *  runtime POST handler is the canonical user; the admin-template
  *  schema reuses widgetSchema for nested validation. */
-export const widgetSchema = z.object({
+/** A leaf widget — the five queryable kinds, used both at the top level and
+ *  inside a tab panel. `widgetSchema` below extends it to add the `tab`
+ *  container (one level deep: a tab's children are leaves). */
+const leafWidgetSchema = z.object({
   id: z.string().min(1),
   title: z.string(),
   tip: z.string().optional(),
@@ -121,6 +124,32 @@ export const widgetSchema = z.object({
   w: z.number().int().positive().optional(),
   h: z.number().int().positive().optional(),
 });
+
+/** Full widget schema: a leaf, plus the `tab` container. A `tab` carries no MQE
+ *  of its own (so `expressions` may be empty) and holds named panels of leaf
+ *  widgets in `tabs`. The SPA flattens to the active tab before posting; the
+ *  BFF also flattens (see `flattenTabWidgets`) so the pipeline only sees leaves. */
+export const widgetSchema = leafWidgetSchema
+  .extend({
+    type: z.enum(['card', 'line', 'top', 'record', 'table', 'tab']),
+    // Relaxed to allow the empty array a `tab` container carries; the refine
+    // below keeps every NON-tab leaf at ≥1 expression (an empty-MQE leaf would
+    // otherwise pass here and render blank).
+    expressions: z.array(z.string().min(1)).max(16),
+    tabs: z
+      .array(z.object({ name: z.string(), widgets: z.array(leafWidgetSchema).max(40) }))
+      .max(20)
+      .optional(),
+  })
+  .superRefine((w, ctx) => {
+    if (w.type !== 'tab' && w.expressions.length === 0) {
+      ctx.addIssue({
+        code: z.ZodIssueCode.custom,
+        path: ['expressions'],
+        message: 'a non-tab widget requires at least one expression',
+      });
+    }
+  });
 /** Shared with config/dashboard.ts (GET-config handler). */
 export const scopeSchema = z.enum([
   'service',
@@ -134,6 +163,9 @@ export const scopeSchema = z.enum([
   'ebpfProfiling',
   'asyncProfiling',
 ]);
+/** Per-request queryable-widget cap (mirrors the SPA's chunk size). Enforced on
+ *  the body pre-expansion (zod) AND on the leaf count after tab flattening. */
+const MAX_REQUEST_WIDGETS = 40;
 const bodySchema = z.object({
   service: z.string().optional(),
   /** Selected instance name. Honored only when `scope === 'instance'`
@@ -150,8 +182,10 @@ const bodySchema = z.object({
   // (CLAUDE.md warns about backend-specific thresholds). The UI is
   // responsible for chunking widget sets larger than this across
   // multiple requests; the BFF refuses oversized bodies up-front so
-  // an accidentally-huge template never reaches OAP.
-  widgets: z.array(widgetSchema).max(40).optional(),
+  // an accidentally-huge template never reaches OAP. The cap is
+  // re-checked AFTER tab expansion (a container counts as 1 here but
+  // flattens to many leaves) — see the handler.
+  widgets: z.array(widgetSchema).max(MAX_REQUEST_WIDGETS).optional(),
   scope: scopeSchema.optional(),
   /** Global time-range, forwarded by the SPA's time picker. When all
    *  three are present the BFF queries OAP at the requested precision
@@ -541,6 +575,26 @@ function isSelfGate(w: DashboardWidget, vw: VisibleWhen): boolean {
   return vw.kind === 'mqe' && w.expressions.includes(vw.expression);
 }
 
+/** Expand `tab` containers to their leaf children so the pipeline only sees
+ *  queryable leaves (a tab carries no MQE). Covers the template-resolved
+ *  fallback + direct API callers; the SPA already flattens to the active tab.
+ *  Emits only the FIRST (default-active) panel — matching the lazy contract,
+ *  so a tab group never fans into a larger OAP request than the UI issues. */
+export function flattenTabWidgets(widgets: DashboardWidget[]): DashboardWidget[] {
+  const out: DashboardWidget[] = [];
+  for (const w of widgets) {
+    if (w.type === 'tab') {
+      const firstPanel = (w.tabs ?? [])[0];
+      for (const child of firstPanel?.widgets ?? []) {
+        if (child.type !== 'tab') out.push(child);
+      }
+    } else {
+      out.push(w);
+    }
+  }
+  return out;
+}
+
 export function registerDashboardQueryRoute(app: FastifyInstance, deps: DashboardRouteDeps): void {
   const auth = requireAuth(deps);
   app.post(
@@ -561,13 +615,24 @@ export function registerDashboardQueryRoute(app: FastifyInstance, deps: Dashboar
       // Blocked (template store unreachable / layer disabled) → no
       // BFF-derived widgets and no in-code defaults; the grid stays empty.
       // An explicit `widgets[]` in the body still runs — the caller owns it.
-      const widgets: DashboardWidget[] =
+      const widgets: DashboardWidget[] = flattenTabWidgets(
         parsed.data.widgets ??
-        (eff.blocked
-          ? []
-          : eff.template
-            ? widgetsForScope(eff.template, scope)
-            : defaultWidgetsFor(eff.template, layerKey));
+          (eff.blocked
+            ? []
+            : eff.template
+              ? widgetsForScope(eff.template, scope)
+              : defaultWidgetsFor(eff.template, layerKey)),
+      );
+      // Re-apply the cap AFTER expansion for a body-PROVIDED set: a tab counts
+      // as 1 in the zod cap but flattens to many leaves, so a hand-built body
+      // could fan past it. The SPA pre-flattens + chunks, so this never trips
+      // it; the template fallback is trusted (and the OAP batch is bulk-chunked).
+      if (parsed.data.widgets && widgets.length > MAX_REQUEST_WIDGETS) {
+        return reply.code(400).send({
+          error: 'too_many_widgets',
+          detail: `${widgets.length} widgets after tab expansion exceeds ${MAX_REQUEST_WIDGETS}`,
+        });
+      }
       let serviceName = parsed.data.service ?? '';
       let serviceId = '';
       let normal = true;
diff --git a/apps/bff/src/i18n/seed.ts b/apps/bff/src/i18n/seed.ts
index e74ccdf..4f6f5d1 100644
--- a/apps/bff/src/i18n/seed.ts
+++ b/apps/bff/src/i18n/seed.ts
@@ -61,6 +61,9 @@ const STRING_FIELDS = new Set([
   'tip',
   'label',
   'group',
+  // A `tab` widget's panel labels (`tabs[].name`) — the only `name` field in a
+  // template; translatable like a widget title.
+  'name',
 ]);
 
 /** Field names whose value is an object of `{ key: translatableString }`.
diff --git a/apps/bff/src/i18n/validate.ts b/apps/bff/src/i18n/validate.ts
index 4dad90e..f02ccfe 100644
--- a/apps/bff/src/i18n/validate.ts
+++ b/apps/bff/src/i18n/validate.ts
@@ -60,7 +60,7 @@ interface Finding {
   message: string;
 }
 
-const STRING_FIELDS = new Set(['alias', 'title', 'description', 'tip', 'label', 'group']);
+const STRING_FIELDS = new Set(['alias', 'title', 'description', 'tip', 'label', 'group', 'name']);
 const STRING_VALUE_OBJECTS = new Set(['aliases', 'slots', 'valueMap']);
 const STRING_ARRAYS = new Set(['expressionLabels', 'tableHeaders']);
 
diff --git a/apps/bff/src/logic/layers/loader.test.ts b/apps/bff/src/logic/layers/loader.test.ts
index 455c101..436225f 100644
--- a/apps/bff/src/logic/layers/loader.test.ts
+++ b/apps/bff/src/logic/layers/loader.test.ts
@@ -107,6 +107,39 @@ describe('widgetsForScope — scope-resolution + fallback chain', () => {
     expect(out.find((w) => w.id === 'sla')?.topNOrder).toBe('asc');
     expect(out.find((w) => w.id === 'cpm-line')).toBe(line); // unchanged reference
   });
+
+  it('resolves topNOrder on a top / record widget INSIDE a tab panel', () => {
+    const tabbed: DashboardWidget = {
+      id: 'grp',
+      title: '',
+      type: 'tab',
+      expressions: [],
+      tabs: [
+        {
+          name: 'Lists',
+          widgets: [
+            { id: 'asc-top', title: 'asc', type: 'top', expressions: ['top_n(service_instance_sla,10,asc)/100'] },
+            { id: 'plain-card', title: 'c', type: 'card', expressions: ['latest(service_cpm)'] },
+          ],
+        },
+      ],
+    };
+    const out = widgetsForScope(tpl({ dashboards: { service: [tabbed] } }), 'service');
+    const child = out[0].tabs?.[0].widgets.find((w) => w.id === 'asc-top');
+    expect(child?.topNOrder).toBe('asc'); // a tab child keeps its declared direction
+  });
+
+  it('leaves a tab with no top / record children reference-unchanged', () => {
+    const tabbed: DashboardWidget = {
+      id: 'grp',
+      title: '',
+      type: 'tab',
+      expressions: [],
+      tabs: [{ name: 'Cards', widgets: [{ id: 'c', title: 'c', type: 'card', expressions: ['latest(service_cpm)'] }] }],
+    };
+    const out = widgetsForScope(tpl({ dashboards: { service: [tabbed] } }), 'service');
+    expect(out[0]).toBe(tabbed); // no top/record anywhere → allocation-free pass-through
+  });
 });
 
 describe('topologyConfigFor / endpointDependencyConfigFor / tracesConfigFor — defaults', () => {
diff --git a/apps/bff/src/logic/layers/loader.ts b/apps/bff/src/logic/layers/loader.ts
index 94474dc..e7652f8 100644
--- a/apps/bff/src/logic/layers/loader.ts
+++ b/apps/bff/src/logic/layers/loader.ts
@@ -583,21 +583,31 @@ export function topNOrderOf(
  *  Enriches `top` / `record` widgets with the resolved `topNOrder` (from
  *  their first `top_n(…)`) so the multi-entity compare grid merges the
  *  per-entity "All" list in the MQE's own direction — without the UI parsing
- *  MQE or inferring asc/des from one entity's (possibly flat) values. */
+ *  MQE or inferring asc/des from one entity's (possibly flat) values. Recurses
+ *  into `tab` panels, which carry top / record widgets too. */
 export function widgetsForScope(
   template: LayerTemplate,
   scope: DashboardScope,
 ): DashboardWidget[] {
   const d = template.dashboards;
   const raw = !d ? (template.widgets ?? []) : (d[scope] ?? d.service ?? template.widgets ?? []);
-  // Pass the resolved array straight through unless a top / record widget
-  // needs its sort direction resolved — keeps the common case allocation-free
-  // (and reference-stable) and only copies the widgets that gain `topNOrder`.
-  if (!raw.some((w) => w.type === 'top' || w.type === 'record')) return raw;
-  return raw.map((w) => {
+  const enrichLeaf = (w: DashboardWidget): DashboardWidget => {
     if (w.type !== 'top' && w.type !== 'record') return w;
     const order = topNOrderOf(w.expressions);
     return order ? { ...w, topNOrder: order } : w;
+  };
+  const tabHasTopRecord = (w: DashboardWidget): boolean =>
+    w.type === 'tab' && (w.tabs ?? []).some((t) => t.widgets.some((c) => c.type === 'top' || c.type === 'record'));
+  // Pass the resolved array straight through unless some top / record widget
+  // (top-level OR inside a tab) needs its sort direction resolved — keeps the
+  // common case allocation-free (and reference-stable).
+  if (!raw.some((w) => w.type === 'top' || w.type === 'record' || tabHasTopRecord(w))) return raw;
+  return raw.map((w) => {
+    if (w.type === 'tab') {
+      if (!tabHasTopRecord(w)) return w;
+      return { ...w, tabs: (w.tabs ?? []).map((t) => ({ ...t, widgets: t.widgets.map(enrichLeaf) })) };
+    }
+    return enrichLeaf(w);
   });
 }
 
diff --git a/apps/ui/src/api/scopes/layer.test.ts b/apps/ui/src/api/scopes/layer.test.ts
index d7752c7..80f3f18 100644
--- a/apps/ui/src/api/scopes/layer.test.ts
+++ b/apps/ui/src/api/scopes/layer.test.ts
@@ -132,6 +132,61 @@ describe('LayerApi.dashboard', () => {
   });
 });
 
+describe('LayerApi.dashboard — chunking oversize widget sets', () => {
+  const widgetStub = (n: number) =>
+    Array.from({ length: n }, (_, i) => ({
+      id: `w${i}`,
+      title: `W${i}`,
+      type: 'card' as const,
+      expressions: [`m${i}`],
+    }));
+  function respStub() {
+    const calls: Array<{ widgets: { id: string }[] }> = [];
+    const bff = {
+      request: vi.fn(async (_m: string, _p: string, body?: { widgets?: { id: string }[] }) => {
+        const ws = body?.widgets ?? [];
+        calls.push({ widgets: ws });
+        return {
+          layer: 'g', service: 's', generatedAt: 0, step: 'MINUTE',
+          durationStart: '', durationEnd: '', reachable: true,
+          widgets: ws.map((w) => ({ id: w.id })),
+        } as unknown;
+      }),
+    } as unknown as BffClient;
+    return { bff, calls };
+  }
+
+  it('sends a single request at exactly the cap (40)', async () => {
+    const { bff, calls } = respStub();
+    await new LayerApi(bff).dashboard('g', { widgets: widgetStub(40) });
+    expect(calls).toHaveLength(1);
+  });
+
+  it('splits >40 into ceil(n/40) chunks of ≤40 and merges widgets in order', async () => {
+    const { bff, calls } = respStub();
+    const resp = await new LayerApi(bff).dashboard('g', { widgets: widgetStub(95) });
+    expect(calls.map((c) => c.widgets.length)).toEqual([40, 40, 15]);
+    expect(resp.widgets.map((w) => w.id)).toEqual(widgetStub(95).map((w) => w.id));
+  });
+
+  it('AND-folds reachable and surfaces the first chunk error', async () => {
+    let n = 0;
+    const bff = {
+      request: vi.fn(async (_m: string, _p: string, body?: { widgets?: { id: string }[] }) => {
+        const bad = n++ === 1;
+        return {
+          layer: 'g', service: 's', generatedAt: 0, step: 'MINUTE', durationStart: '', durationEnd: '',
+          widgets: (body?.widgets ?? []).map((w) => ({ id: w.id })),
+          reachable: !bad, ...(bad ? { error: 'chunk-1-failed' } : {}),
+        } as unknown;
+      }),
+    } as unknown as BffClient;
+    const resp = await new LayerApi(bff).dashboard('g', { widgets: widgetStub(85) });
+    expect(resp.reachable).toBe(false);
+    expect(resp.error).toBe('chunk-1-failed');
+  });
+});
+
 describe('LayerApi.dashboardConfig', () => {
   it('GETs without query when scope omitted', async () => {
     const { bff, calls } = makeStub();
diff --git a/apps/ui/src/features/admin/layer-templates/LayerDashboardsAdmin.vue b/apps/ui/src/features/admin/layer-templates/LayerDashboardsAdmin.vue
index 41d0666..fa0db15 100644
--- a/apps/ui/src/features/admin/layer-templates/LayerDashboardsAdmin.vue
+++ b/apps/ui/src/features/admin/layer-templates/LayerDashboardsAdmin.vue
@@ -35,6 +35,7 @@ import type {
   ClusterByRule,
   DashboardScope,
   DashboardWidget,
+  DashboardTab,
   EndpointDependencyConfig,
   ProcessTopologyConfig,
   DeploymentConfig,
@@ -44,6 +45,7 @@ import type {
   TopologyConfig,
   TopologyMetricDef,
 } from '@skywalking-horizon-ui/api-client';
+import { collectWidgetIds } from '@skywalking-horizon-ui/api-client';
 
 /** Admin-only scopes that aren't dashboard-widget scopes. `networkProfiling`
  *  is the process-topology edge editor; `deployment` is the
@@ -619,7 +621,7 @@ function positionDrawer(): void {
   const split = el?.closest('.editor-split') as HTMLElement | null;
   const main = document.querySelector('.sw-main');
   if (!el || !card || !split || !main) return;
-  // Hide the fixed drawer when the editor card is scrolled out of view, so it
+  // Hide the floating drawer when the editor card is scrolled out of view, so it
   // doesn't float over the scope-config cards above it.
   const cr = card.getBoundingClientRect();
   if (cr.bottom < 80 || cr.top > window.innerHeight) {
@@ -627,7 +629,12 @@ function positionDrawer(): void {
     return;
   }
   el.style.display = 'flex';
-  const top = Math.max(0, Math.round(main.getBoundingClientRect().top));
+  // The canvas shrinks to reserve a 360px column on the right (so widget
+  // proportions read at their real size); the drawer overlays that column,
+  // pinned BELOW the sticky header so it doesn't cover + Add widget.
+  const headEl = card.querySelector('.card-head') as HTMLElement | null;
+  const mainTop = Math.round(main.getBoundingClientRect().top);
+  const top = Math.max(0, headEl ? Math.round(headEl.getBoundingClientRect().bottom) : mainTop, mainTop);
   el.style.top = `${top}px`;
   el.style.right = 'auto';
   el.style.left = `${Math.round(split.getBoundingClientRect().right - DRAWER_COL)}px`;
@@ -703,17 +710,42 @@ function setWidgetsFor(scope: AdminScope, widgets: DashboardWidget[]): void {
   }
 }
 
-function addWidget(): void {
+/** Every widget id in the draft — all scopes + tab children. Ids are the wire
+ *  key results are addressed by, so generators below scan this to avoid the
+ *  collisions a count-based id hits after a delete + re-add. */
+function allWidgetIds(): Set<string> {
+  const ids = new Set<string>();
+  const tpl = draft.template;
+  if (!tpl) return ids;
+  const dashboards = (tpl as unknown as { dashboards?: Record<string, DashboardWidget[]> }).dashboards;
+  if (dashboards) for (const ws of Object.values(dashboards)) collectWidgetIds(ws, ids);
+  if (tpl.widgets) collectWidgetIds(tpl.widgets, ids);
+  return ids;
+}
+/** Smallest `${prefix}${k}` (k≥1) not already used as a widget id anywhere in
+ *  the draft — collision-proof regardless of delete/move/re-add history. */
+function nextFreeId(prefix: string): string {
+  const used = allWidgetIds();
+  for (let k = 1; ; k++) {
+    const cand = `${prefix}${k}`;
+    if (!used.has(cand)) return cand;
+  }
+}
+
+function addWidget(type: DashboardWidget['type'] = 'card'): void {
   const widgets = [...widgetsFor(activeScope.value)];
   const idx = widgets.length;
-  widgets.push({
-    id: `widget_${idx + 1}`,
-    title: `Widget ${idx + 1}`,
-    type: 'card',
-    expressions: [''],
-    span: 4,
-    rowSpan: 1,
-  });
+  const id = nextFreeId('widget_');
+  if (type === 'tab') {
+    // A tab container carries no MQE; it seeds one empty named tab. Wider/taller
+    // default slot since it hosts a sub-grid of widgets.
+    widgets.push({
+      id, title: `Widget ${idx + 1}`, type, expressions: [], span: 6, rowSpan: 4,
+      tabs: [{ name: 'Tab 1', widgets: [] }],
+    });
+  } else {
+    widgets.push({ id, title: `Widget ${idx + 1}`, type, expressions: [''], span: 4, rowSpan: 1 });
+  }
   setWidgetsFor(activeScope.value, widgets);
 }
 
@@ -743,16 +775,74 @@ function moveWidget(i: number, dir: -1 | 1): void {
  * ------------------------------------------------------------------- */
 
 const selectedIdx = ref<number | null>(null);
-/* Re-fit the drawer to the viewport when it opens / the target widget changes
- * (content height differs); the scroll + resize listeners keep it fitted after. */
-watch(selectedIdx, () => void nextTick(positionDrawer));
-
-/** When the user switches scope or layer we drop the selection so the
- *  drawer doesn't refer to a widget that no longer exists. */
+/* ----------------------------------------------------------------------- *
+ * Tab widgets edit INLINE. A `tab` widget holds named tabs, each with its own
+ * widgets; the canvas tile renders a segmented bar + the active tab's widgets
+ * as editable sub-tiles in place. Selecting a sub-tile (`subSel`) opens it in
+ * the same drawer as a top-level widget (`selectedIdx`). No drilling / separate
+ * canvas — the tab's slot IS its layout area.
+ * ----------------------------------------------------------------------- */
+/** Which tab is shown inline per `tab` widget (by widget id; default first). */
+const activeTabByWidget = ref<Record<string, number>>({});
+function activeTabOf(id: string): number {
+  return activeTabByWidget.value[id] ?? 0;
+}
+/** Selection of a widget INSIDE a tab panel — vs `selectedIdx` for a top-level
+ *  widget. Exactly one of the two is set; both null = nothing selected. */
+const subSel = ref<{ widgetId: string; tabIdx: number; subIdx: number } | null>(null);
+function setActiveTabOf(id: string, ti: number): void {
+  activeTabByWidget.value = { ...activeTabByWidget.value, [id]: ti };
+  if (subSel.value?.widgetId === id) subSel.value = null;
+}
+/* Re-fit the drawer to the viewport when the selection (top-level or in-tab)
+ * changes; the scroll + resize listeners keep it fitted after. */
+watch([selectedIdx, subSel], () => void nextTick(positionDrawer));
+
+/** When the user switches scope or layer we drop the selection so the drawer
+ *  doesn't refer to a widget that no longer exists. */
 watch([activeScope, selectedKey], () => {
   selectedIdx.value = null;
+  subSel.value = null;
+  // A different scope/layer has its own tab widgets; a stale per-id active-tab
+  // index could point past the new scope's tab count.
+  activeTabByWidget.value = {};
 });
 
+/** Resolve a `tab` widget by id within the active scope. */
+function tabWidgetById(id: string): DashboardWidget | null {
+  return widgetsFor(activeScope.value).find((w) => w.id === id && w.type === 'tab') ?? null;
+}
+/** Widgets of a tab widget's panel `tabIdx`. */
+function subWidgetsOf(id: string, tabIdx: number): DashboardWidget[] {
+  return tabWidgetById(id)?.tabs?.[tabIdx]?.widgets ?? [];
+}
+/** Write a tab panel's widget list back to the draft (preserving the others). */
+function commitSubWidgets(id: string, tabIdx: number, widgets: DashboardWidget[]): void {
+  const scope = [...widgetsFor(activeScope.value)];
+  const i = scope.findIndex((w) => w.id === id && w.type === 'tab');
+  const tw = i >= 0 ? scope[i] : null;
+  if (tw?.tabs && tw.tabs[tabIdx]) {
+    const tabs = [...tw.tabs];
+    tabs[tabIdx] = { ...tabs[tabIdx], widgets };
+    scope[i] = { ...tw, tabs };
+    setWidgetsFor(activeScope.value, scope);
+  }
+}
+/** Select a widget inside a tab panel (opens its config in the drawer). */
+function selectSub(widgetId: string, tabIdx: number, subIdx: number): void {
+  selectedIdx.value = null;
+  subSel.value = { widgetId, tabIdx, subIdx };
+}
+/** Add a leaf widget into a tab's active panel. */
+function addToTab(widgetId: string, type: DashboardWidget['type']): void {
+  const ti = activeTabOf(widgetId);
+  const widgets = [...subWidgetsOf(widgetId, ti)];
+  const n = widgets.length + 1;
+  widgets.push({ id: nextFreeId(`${widgetId}_t${ti}_w`), title: `Widget ${n}`, type, expressions: [''], span: 6, rowSpan: 2 });
+  commitSubWidgets(widgetId, ti, widgets);
+  subSel.value = { widgetId, tabIdx: ti, subIdx: widgets.length - 1 };
+}
+
 const canvasEl = ref<HTMLDivElement | null>(null);
 
 /** Active resize session: tracks the starting span/rowSpan + pixel
@@ -760,6 +850,7 @@ const canvasEl = ref<HTMLDivElement | null>(null);
 const resize = reactive<{
   active: boolean;
   idx: number;
+  sub: { widgetId: string; tabIdx: number; subIdx: number } | null;
   startX: number;
   startY: number;
   startSpan: number;
@@ -769,6 +860,7 @@ const resize = reactive<{
 }>({
   active: false,
   idx: -1,
+  sub: null,
   startX: 0,
   startY: 0,
   startSpan: 1,
@@ -817,12 +909,47 @@ function onResizeStart(e: MouseEvent, i: number): void {
   window.addEventListener('mousemove', onResizeMove);
   window.addEventListener('mouseup', onResizeEnd);
 }
+const SUBGRID_ROW_PX = 84;
+const SUBGRID_GAP_PX = 6;
+/** Resize a widget INSIDE a tab — same drag as the top level, but snapped to
+ *  the tab's own 12-col sub-grid pitch (measured from the .cw-subgrid). */
+function onSubResizeStart(e: MouseEvent, widgetId: string, tabIdx: number, subIdx: number): void {
+  e.preventDefault();
+  e.stopPropagation();
+  const sw = subWidgetsOf(widgetId, tabIdx)[subIdx];
+  const grid = (e.target as HTMLElement).closest('.cw-subgrid') as HTMLElement | null;
+  if (!sw || !grid) return;
+  const rect = grid.getBoundingClientRect();
+  const cellW = (rect.width - SUBGRID_GAP_PX * (CANVAS_COLS - 1)) / CANVAS_COLS;
+  resize.active = true;
+  resize.idx = -1;
+  resize.sub = { widgetId, tabIdx, subIdx };
+  resize.startX = e.clientX;
+  resize.startY = e.clientY;
+  resize.startSpan = widgetSpan(sw);
+  resize.startRowSpan = widgetRowSpan(sw);
+  resize.cellW = cellW + SUBGRID_GAP_PX;
+  resize.cellH = SUBGRID_ROW_PX + SUBGRID_GAP_PX;
+  selectSub(widgetId, tabIdx, subIdx);
+  window.addEventListener('mousemove', onResizeMove);
+  window.addEventListener('mouseup', onResizeEnd);
+}
 function onResizeMove(e: MouseEvent): void {
   if (!resize.active) return;
   const dx = e.clientX - resize.startX;
   const dy = e.clientY - resize.startY;
   const newSpan = Math.max(1, Math.min(CANVAS_COLS, resize.startSpan + Math.round(dx / resize.cellW)));
   const newRowSpan = Math.max(1, Math.min(8, resize.startRowSpan + Math.round(dy / resize.cellH)));
+  if (resize.sub) {
+    const { widgetId, tabIdx, subIdx } = resize.sub;
+    const ws = [...subWidgetsOf(widgetId, tabIdx)];
+    const w = ws[subIdx];
+    if (w && (w.span !== newSpan || w.rowSpan !== newRowSpan)) {
+      ws[subIdx] = { ...w, span: newSpan, rowSpan: newRowSpan };
+      commitSubWidgets(widgetId, tabIdx, ws);
+    }
+    return;
+  }
   const widgets = [...currentWidgets.value];
   const w = widgets[resize.idx];
   if (!w) return;
@@ -833,6 +960,7 @@ function onResizeMove(e: MouseEvent): void {
 }
 function onResizeEnd(): void {
   resize.active = false;
+  resize.sub = null;
   window.removeEventListener('mousemove', onResizeMove);
   window.removeEventListener('mouseup', onResizeEnd);
 }
@@ -845,10 +973,12 @@ const reorder = reactive<{
   active: boolean;
   from: number;
   over: number;
+  sub: { widgetId: string; tabIdx: number; subIdx: number } | null;
 }>({
   active: false,
   from: -1,
   over: -1,
+  sub: null,
 });
 
 function onReorderStart(e: DragEvent, i: number): void {
@@ -857,12 +987,55 @@ function onReorderStart(e: DragEvent, i: number): void {
   reorder.active = true;
   reorder.from = i;
   reorder.over = i;
+  reorder.sub = null;
   selectedIdx.value = i;
   if (e.dataTransfer) {
     e.dataTransfer.effectAllowed = 'move';
     e.dataTransfer.setData('text/plain', String(i));
   }
 }
+/** Start dragging a widget that lives INSIDE a tab — dropping it on the
+ *  top-level canvas (or a top-level widget) moves it OUT of the tab. */
+function onSubReorderStart(e: DragEvent, widgetId: string, tabIdx: number, subIdx: number): void {
+  reorder.active = true;
+  reorder.from = -1;
+  reorder.over = -1;
+  reorder.sub = { widgetId, tabIdx, subIdx };
+  selectSub(widgetId, tabIdx, subIdx);
+  if (e.dataTransfer) {
+    e.dataTransfer.effectAllowed = 'move';
+    e.dataTransfer.setData('text/plain', 'sub');
+  }
+}
+/** Move the dragged in-tab widget out to the scope's top-level grid. */
+function moveSubToScope(insertAt: number | null): void {
+  if (!reorder.sub) return;
+  const { widgetId, tabIdx, subIdx } = reorder.sub;
+  const scope = [...widgetsFor(activeScope.value)];
+  const twIdx = scope.findIndex((w) => w.id === widgetId && w.type === 'tab');
+  const tw = twIdx >= 0 ? scope[twIdx] : null;
+  const sub = tw?.tabs?.[tabIdx]?.widgets[subIdx];
+  if (!tw?.tabs || !sub) return;
+  const tabs = [...tw.tabs];
+  tabs[tabIdx] = { ...tabs[tabIdx], widgets: tabs[tabIdx].widgets.filter((_, j) => j !== subIdx) };
+  scope[twIdx] = { ...tw, tabs };
+  const at = insertAt == null ? scope.length : Math.min(insertAt, scope.length);
+  scope.splice(at, 0, sub);
+  setWidgetsFor(activeScope.value, scope);
+  subSel.value = null;
+  selectedIdx.value = scope.indexOf(sub);
+}
+/** Drop on the canvas background (not on a widget) — moves a dragged in-tab
+ *  widget OUT to the end of the top-level grid. */
+function onCanvasDrop(e: DragEvent): void {
+  if (!reorder.active || !reorder.sub) return;
+  e.preventDefault();
+  moveSubToScope(null);
+  reorder.active = false;
+  reorder.from = -1;
+  reorder.over = -1;
+  reorder.sub = null;
+}
 function onReorderOver(e: DragEvent, i: number): void {
   if (!reorder.active) return;
   e.preventDefault();
@@ -872,14 +1045,41 @@ function onReorderOver(e: DragEvent, i: number): void {
 function onReorderDrop(e: DragEvent, i: number): void {
   if (!reorder.active) return;
   e.preventDefault();
+  // Dragging a widget OUT of a tab, dropped over a top-level widget → insert
+  // it into the scope at that position.
+  if (reorder.sub) {
+    moveSubToScope(i);
+    reorder.active = false;
+    reorder.from = -1;
+    reorder.over = -1;
+    reorder.sub = null;
+    return;
+  }
   const from = reorder.from;
   const to = i;
   if (from !== to) {
     const widgets = [...currentWidgets.value];
-    const [moved] = widgets.splice(from, 1);
-    widgets.splice(to, 0, moved);
-    setWidgetsFor(activeScope.value, widgets);
-    selectedIdx.value = to;
+    const target = widgets[to];
+    const dragged = widgets[from];
+    if (target && dragged && target.type === 'tab' && dragged.type !== 'tab') {
+      // Dropped a leaf onto a tab container → MOVE it into that tab's ACTIVE
+      // panel (it leaves the top-level grid).
+      widgets.splice(from, 1);
+      const tabs = [...(target.tabs ?? [])];
+      if (tabs.length === 0) tabs.push({ name: 'Tab 1', widgets: [] });
+      const ti = Math.min(activeTabOf(target.id), tabs.length - 1);
+      tabs[ti] = { ...tabs[ti], widgets: [...tabs[ti].widgets, dragged] };
+      const tIdx = widgets.indexOf(target);
+      widgets[tIdx] = { ...target, tabs };
+      setWidgetsFor(activeScope.value, widgets);
+      selectedIdx.value = tIdx;
+    } else {
+      // Plain reorder.
+      widgets.splice(from, 1);
+      widgets.splice(to, 0, dragged);
+      setWidgetsFor(activeScope.value, widgets);
+      selectedIdx.value = to;
+    }
   }
   reorder.active = false;
   reorder.from = -1;
@@ -889,6 +1089,7 @@ function onReorderEnd(): void {
   reorder.active = false;
   reorder.from = -1;
   reorder.over = -1;
+  reorder.sub = null;
 }
 
 onBeforeUnmount(() => {
@@ -896,19 +1097,109 @@ onBeforeUnmount(() => {
   window.removeEventListener('mouseup', onResizeEnd);
 });
 
-/** Convenience: the currently-selected widget. Used by the drawer. */
+/** Convenience: the currently-selected widget — a top-level widget
+ *  (`selectedIdx`) OR a widget inside a tab panel (`subSel`). Used by the
+ *  drawer; the same form edits either with no indirection. */
 const selectedWidget = computed<DashboardWidget | null>(() => {
+  if (subSel.value) {
+    return subWidgetsOf(subSel.value.widgetId, subSel.value.tabIdx)[subSel.value.subIdx] ?? null;
+  }
   if (selectedIdx.value === null) return null;
-  return currentWidgets.value[selectedIdx.value] ?? null;
+  return widgetsFor(activeScope.value)[selectedIdx.value] ?? null;
 });
 
 function selectWidget(i: number): void {
+  subSel.value = null;
   selectedIdx.value = i;
 }
 
-function setWidgetFormat(v: string): void {
+const editingWidget = computed<DashboardWidget | null>(() => selectedWidget.value);
+
+/** Move-up / move-down bounds for the drawer footer — handles a top-level
+ *  widget (`selectedIdx`) or a widget inside a tab panel (`subSel`). */
+const selCanMoveUp = computed<boolean>(() =>
+  subSel.value ? subSel.value.subIdx > 0 : (selectedIdx.value !== null && selectedIdx.value > 0),
+);
+const selCanMoveDown = computed<boolean>(() => {
+  if (subSel.value) {
+    return subSel.value.subIdx < subWidgetsOf(subSel.value.widgetId, subSel.value.tabIdx).length - 1;
+  }
+  return selectedIdx.value !== null && selectedIdx.value < currentWidgets.value.length - 1;
+});
+
+/** Type changes seed a `tab` widget's first (empty) named panel + clear its
+ *  own (meaningless) expressions, and restore an expression slot when leaving
+ *  `tab`. A tab can't be created while drilled inside another tab. */
+function onWidgetTypeChange(value: string): void {
   const w = selectedWidget.value;
   if (!w) return;
+  w.type = value as DashboardWidget['type'];
+  if (w.type === 'tab') {
+    if (!w.tabs || w.tabs.length === 0) w.tabs = [{ name: 'Tab 1', widgets: [] }];
+    w.expressions = [];
+  } else {
+    if (!w.expressions || w.expressions.length === 0) w.expressions = [''];
+    // Leaving 'tab' — drop the now-orphaned panels (a non-tab widget must never
+    // carry `tabs`, or flattenTabWidgets would still expand them) and forget its
+    // inline active-tab index.
+    if (w.tabs) {
+      w.tabs = undefined;
+      if (w.id in activeTabByWidget.value) {
+        const next = { ...activeTabByWidget.value };
+        delete next[w.id];
+        activeTabByWidget.value = next;
+      }
+    }
+  }
+}
+
+/* ---- Tab-panel management (by tab widget id). Each tab is a { name, widgets[] }
+ *      panel; these run from the inline segmented tab bar on the canvas tile. ---- */
+function tabWidgetMut(widgetId: string): { tw: DashboardWidget; tabs: DashboardTab[] } | null {
+  const tw = tabWidgetById(widgetId);
+  if (!tw) return null;
+  return { tw, tabs: [...(tw.tabs ?? [])] };
+}
+function addTabToWidget(widgetId: string): void {
+  const m = tabWidgetMut(widgetId);
+  if (!m) return;
+  m.tabs.push({ name: `Tab ${m.tabs.length + 1}`, widgets: [] });
+  m.tw.tabs = m.tabs;
+  setActiveTabOf(widgetId, m.tabs.length - 1);
+}
+function renameTabOf(widgetId: string, ti: number, name: string): void {
+  const m = tabWidgetMut(widgetId);
+  if (!m || !m.tabs[ti]) return;
+  m.tabs[ti] = { ...m.tabs[ti], name };
+  m.tw.tabs = m.tabs;
+}
+function deleteTabOf(widgetId: string, ti: number): void {
+  const m = tabWidgetMut(widgetId);
+  if (!m) return;
+  m.tabs.splice(ti, 1);
+  m.tw.tabs = m.tabs;
+  if (subSel.value?.widgetId === widgetId) subSel.value = null;
+  // Keep the active panel pointing at the SAME tab: deleting one before it
+  // shifts every later index down by one; deleting at/after only needs a clamp.
+  const active = activeTabOf(widgetId);
+  if (ti < active) setActiveTabOf(widgetId, active - 1);
+  else if (active >= m.tabs.length) setActiveTabOf(widgetId, Math.max(0, m.tabs.length - 1));
+}
+function moveTabOf(widgetId: string, ti: number, dir: -1 | 1): void {
+  const m = tabWidgetMut(widgetId);
+  if (!m) return;
+  const tj = ti + dir;
+  if (tj < 0 || tj >= m.tabs.length) return;
+  [m.tabs[ti], m.tabs[tj]] = [m.tabs[tj], m.tabs[ti]];
+  m.tw.tabs = m.tabs;
+  const a = activeTabOf(widgetId);
+  if (a === ti) setActiveTabOf(widgetId, tj);
+  else if (a === tj) setActiveTabOf(widgetId, ti);
+}
+
+function setWidgetFormat(v: string): void {
+  const w = editingWidget.value;
+  if (!w) return;
   if (v === 'int' || v === 'decimal' || v === 'compact' || v === 'duration' || v === 'enum') w.format = v;
   else delete w.format;
 }
@@ -916,24 +1207,24 @@ function setWidgetFormat(v: string): void {
 // `format: 'enum'` value→label editor — the valueMap is a coded-value → label
 // table (e.g. 1 → OK). Keys are renamed on blur to avoid focus loss mid-edit.
 const valueMapEntries = computed<Array<[string, string]>>(() => {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   return w?.valueMap ? Object.entries(w.valueMap) : [];
 });
 function setValueMapLabel(key: string, label: string): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w) return;
   if (!w.valueMap) w.valueMap = {};
   w.valueMap[key] = label;
 }
 function setValueMapKey(oldKey: string, newKey: string): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w || !w.valueMap || newKey === oldKey || newKey in w.valueMap) return;
   const label = w.valueMap[oldKey];
   delete w.valueMap[oldKey];
   w.valueMap[newKey] = label;
 }
 function addValueMapRow(): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w) return;
   if (!w.valueMap) w.valueMap = {};
   let k = 0;
@@ -941,20 +1232,39 @@ function addValueMapRow(): void {
   w.valueMap[String(k)] = '';
 }
 function removeValueMapRow(key: string): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w || !w.valueMap) return;
   delete w.valueMap[key];
   if (Object.keys(w.valueMap).length === 0) delete w.valueMap;
 }
 
 /** Drawer commits edits in place on the live draft via v-model — no
- *  separate apply step. The button row offers a delete shortcut. */
+ *  separate apply step. The button row offers a delete shortcut. Works on a
+ *  top-level widget or a widget inside a tab panel. */
 function deleteSelected(): void {
+  if (subSel.value) {
+    const { widgetId, tabIdx, subIdx } = subSel.value;
+    const ws = [...subWidgetsOf(widgetId, tabIdx)];
+    ws.splice(subIdx, 1);
+    commitSubWidgets(widgetId, tabIdx, ws);
+    subSel.value = null;
+    return;
+  }
   if (selectedIdx.value === null) return;
   deleteWidget(selectedIdx.value);
   selectedIdx.value = null;
 }
 function moveSelected(dir: -1 | 1): void {
+  if (subSel.value) {
+    const { widgetId, tabIdx, subIdx } = subSel.value;
+    const ws = [...subWidgetsOf(widgetId, tabIdx)];
+    const j = subIdx + dir;
+    if (j < 0 || j >= ws.length) return;
+    [ws[subIdx], ws[j]] = [ws[j], ws[subIdx]];
+    commitSubWidgets(widgetId, tabIdx, ws);
+    subSel.value = { widgetId, tabIdx, subIdx: j };
+    return;
+  }
   if (selectedIdx.value === null) return;
   const i = selectedIdx.value;
   moveWidget(i, dir);
@@ -964,8 +1274,8 @@ function moveSelected(dir: -1 | 1): void {
 
 /** When a new widget is added, immediately select it so the drawer
  *  opens with empty fields ready for input. */
-async function addAndSelectWidget(): Promise<void> {
-  addWidget();
+async function addAndSelectWidget(type: DashboardWidget['type'] = 'card'): Promise<void> {
+  addWidget(type);
   await nextTick();
   selectedIdx.value = currentWidgets.value.length - 1;
   await nextTick();
@@ -978,6 +1288,21 @@ async function addAndSelectWidget(): Promise<void> {
     ?.scrollIntoView({ behavior: 'smooth', block: 'center' });
 }
 
+/** The five leaf widget kinds offered by the "+ Add widget" picker. The `tab`
+ *  group is a container offered separately (first, above a divider). */
+const WIDGET_KINDS: ReadonlyArray<{ type: DashboardWidget['type']; label: string; hint: string }> = [
+  { type: 'card', label: 'Card', hint: 'A single scalar number' },
+  { type: 'line', label: 'Line', hint: 'A time-series chart' },
+  { type: 'top', label: 'Top list', hint: 'A sorted top-N list' },
+  { type: 'record', label: 'Record', hint: 'Tabular records (slow SQL, statements)' },
+  { type: 'table', label: 'Table', hint: 'A labeled key → value table' },
+];
+const addMenuOpen = ref(false);
+function pickAddKind(type: DashboardWidget['type']): void {
+  addMenuOpen.value = false;
+  void addAndSelectWidget(type);
+}
+
 /* ------------------------------------------------------------------- *
  * Per-expression rows. Each MQE expression carries its own label / unit
  * / y-axis on one row, so the three used to be index-aligned by line
@@ -989,7 +1314,7 @@ async function addAndSelectWidget(): Promise<void> {
  *  multi-series `line` widgets; a single-expression card/line hides
  *  them to keep the row compact. */
 const showExprMeta = computed(() => {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   return !!w && (w.type === 'top' || (w.expressions?.length ?? 0) > 1);
 });
 function padTo<T>(arr: T[] | undefined, len: number, fill: T): T[] {
@@ -998,40 +1323,40 @@ function padTo<T>(arr: T[] | undefined, len: number, fill: T): T[] {
   return a;
 }
 function updateExpr(i: number, v: string): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w) return;
   const a = [...w.expressions];
   a[i] = v;
   w.expressions = a;
 }
 function updateExprLabel(i: number, v: string): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w) return;
   const a = padTo(w.expressionLabels, w.expressions.length, '');
   a[i] = v;
   w.expressionLabels = a;
 }
 function updateExprUnit(i: number, v: string): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w) return;
   const a = padTo(w.expressionUnits, w.expressions.length, '');
   a[i] = v;
   w.expressionUnits = a;
 }
 function updateExprAxis(i: number, v: number): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w) return;
   const a = padTo(w.expressionAxes, w.expressions.length, 0);
   a[i] = v === 1 ? 1 : 0;
   w.expressionAxes = a;
 }
 function addExpr(): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w) return;
   w.expressions = [...w.expressions, ''];
 }
 function removeExpr(i: number): void {
-  const w = selectedWidget.value;
+  const w = editingWidget.value;
   if (!w || w.expressions.length <= 1) return;
   const drop = <T>(arr: T[] | undefined): T[] | undefined =>
     arr ? arr.filter((_, j) => j !== i) : arr;
@@ -1828,12 +2153,12 @@ function visibleWhenHint(scope: DashboardScope): string {
 
 const vwKindModel = computed<VwKind>({
   get() {
-    const vw = selectedWidget.value?.visibleWhen;
+    const vw = editingWidget.value?.visibleWhen;
     if (!vw) return 'none';
     return vw.kind === 'entity' ? 'entity' : 'mqe';
   },
   set(k) {
-    const w = selectedWidget.value;
+    const w = editingWidget.value;
     if (!w) return;
     if (k === 'none') w.visibleWhen = undefined;
     else if (k === 'mqe') w.visibleWhen = { kind: 'mqe', expression: w.expressions?.[0] ?? '', op: 'exists' };
@@ -1842,12 +2167,12 @@ const vwKindModel = computed<VwKind>({
 });
 const vwTarget = computed<string>({
   get() {
-    const vw = selectedWidget.value?.visibleWhen;
+    const vw = editingWidget.value?.visibleWhen;
     if (!vw) return '';
     return vw.kind === 'mqe' ? vw.expression : vw.attribute;
   },
   set(v) {
-    const vw = selectedWidget.value?.visibleWhen;
+    const vw = editingWidget.value?.visibleWhen;
     if (!vw) return;
     if (vw.kind === 'mqe') vw.expression = v;
     else vw.attribute = v;
@@ -1855,10 +2180,10 @@ const vwTarget = computed<string>({
 });
 const vwOp = computed<string>({
   get() {
-    return selectedWidget.value?.visibleWhen?.op ?? 'exists';
+    return editingWidget.value?.visibleWhen?.op ?? 'exists';
   },
   set(op) {
-    const w = selectedWidget.value;
+    const w = editingWidget.value;
     const vw = w?.visibleWhen;
     if (!w || !vw) return;
     if (vw.kind === 'mqe') {
@@ -1875,16 +2200,16 @@ const vwOp = computed<string>({
   },
 });
 const vwNeedsValue = computed(() => {
-  const op = selectedWidget.value?.visibleWhen?.op;
+  const op = editingWidget.value?.visibleWhen?.op;
   return op === 'gt' || op === 'lt' || op === 'eq';
 });
 const vwValue = computed<string>({
   get() {
-    const vw = selectedWidget.value?.visibleWhen;
+    const vw = editingWidget.value?.visibleWhen;
     return vw && 'value' in vw ? String(vw.value) : '';
   },
   set(v) {
-    const vw = selectedWidget.value?.visibleWhen;
+    const vw = editingWidget.value?.visibleWhen;
     if (!vw || !('value' in vw)) return;
     if (vw.kind === 'mqe') vw.value = Number(v) || 0;
     else vw.value = v;
@@ -3711,12 +4036,47 @@ const namingTest = computed<NamingTestResult>(() => {
         </section>
 
         <section v-else ref="editorCardEl" class="sw-card editor-card">
-          <div class="card-head">
+          <!-- Sticky header: pins to the top while the canvas scrolls, so
+               + Add widget stays reachable. -->
+          <div class="card-head sticky-head">
             <h4>{{ scopeLabel(activeScope) }} widgets</h4>
             <span class="sub">
               click a widget to edit · drag corner to resize · drag header to reorder
             </span>
-            <button class="sw-btn add" type="button" @click="addAndSelectWidget">+ Add widget</button>
+            <div class="add-widget-wrap">
+              <button
+                class="sw-btn add"
+                type="button"
+                :aria-expanded="addMenuOpen"
+                @click="addMenuOpen = !addMenuOpen"
+              >+ Add widget ▾</button>
+              <div v-if="addMenuOpen" class="add-menu-backdrop" @click="addMenuOpen = false" />
+              <div v-if="addMenuOpen" class="add-menu" role="menu">
+                <!-- Container first, then a divider, then the five leaf kinds. -->
+                <button type="button" class="add-menu-item" role="menuitem" @click="pickAddKind('tab')">
+                  <span class="ami-type t-tab">tab</span>
+                  <span class="ami-text">
+                    <span class="ami-label">Tab group</span>
+                    <span class="ami-hint">Several widgets in one slot, as tabs</span>
+                  </span>
+                </button>
+                <div class="add-menu-div" />
+                <button
+                  v-for="k in WIDGET_KINDS"
+                  :key="k.type"
+                  type="button"
+                  class="add-menu-item"
+                  role="menuitem"
+                  @click="pickAddKind(k.type)"
+                >
+                  <span class="ami-type" :class="`t-${k.type}`">{{ k.type }}</span>
+                  <span class="ami-text">
+                    <span class="ami-label">{{ k.label }}</span>
+                    <span class="ami-hint">{{ k.hint }}</span>
+                  </span>
+                </button>
+              </div>
+            </div>
           </div>
 
           <div class="editor-split" :class="{ 'has-drawer': !!selectedWidget }">
@@ -3724,6 +4084,8 @@ const namingTest = computed<NamingTestResult>(() => {
               ref="canvasEl"
               class="canvas"
               :class="{ resizing: resize.active }"
+              @dragover.prevent
+              @drop="onCanvasDrop"
             >
               <div v-if="currentWidgets.length === 0" class="canvas-empty">
                 No widgets yet. Click "+ Add widget" or drag here later — the canvas
@@ -3735,8 +4097,10 @@ const namingTest = computed<NamingTestResult>(() => {
                 class="canvas-widget"
                 :class="{
                   selected: selectedIdx === i,
+                  'is-tab': w.type === 'tab',
                   dragging: reorder.active && reorder.from === i,
-                  'drop-target': reorder.active && reorder.over === i && reorder.from !== i,
+                  'drop-target': reorder.active && reorder.over === i && reorder.from !== i && !(!reorder.sub && w.type === 'tab' && currentWidgets[reorder.from]?.type !== 'tab'),
+                  'drop-into-tab': reorder.active && !reorder.sub && reorder.over === i && reorder.from !== i && w.type === 'tab' && currentWidgets[reorder.from]?.type !== 'tab',
                 }"
                 :style="widgetGridStyle(w)"
                 @click="selectWidget(i)"
@@ -3745,11 +4109,18 @@ const namingTest = computed<NamingTestResult>(() => {
               >
                 <header
                   class="cw-head"
-                  :draggable="true"
-                  @dragstart="onReorderStart($event, i)"
+                  :class="{ 'tab-head': w.type === 'tab' }"
+                  :draggable="w.type !== 'tab'"
+                  @dragstart="w.type !== 'tab' && onReorderStart($event, i)"
                   @dragend="onReorderEnd"
                 >
-                  <span class="cw-grip" aria-hidden="true">
+                  <span
+                    class="cw-grip"
+                    :draggable="w.type === 'tab' ? true : undefined"
+                    aria-hidden="true"
+                    @dragstart="w.type === 'tab' && onReorderStart($event, i)"
+                    @dragend="onReorderEnd"
+                  >
                     <svg viewBox="0 0 10 14" width="6" height="10">
                       <circle cx="2" cy="2" r="1" fill="currentColor"/>
                       <circle cx="8" cy="2" r="1" fill="currentColor"/>
@@ -3759,7 +4130,22 @@ const namingTest = computed<NamingTestResult>(() => {
                       <circle cx="8" cy="12" r="1" fill="currentColor"/>
                     </svg>
                   </span>
-                  <h5>{{ w.title || w.id || 'untitled' }}</h5>
+                  <!-- Tab widget: the tab bar IS the header — tabs + the type chip
+                       sit in the head row, with the boundary line under them. -->
+                  <div v-if="w.type === 'tab'" class="cw-segbar" @click.stop @mousedown.stop>
+                    <div class="seg">
+                      <button
+                        v-for="(tab, ti) in w.tabs ?? []"
+                        :key="ti"
+                        type="button"
+                        class="seg-pill"
+                        :class="{ on: ti === activeTabOf(w.id) }"
+                        @click.stop="setActiveTabOf(w.id, ti)"
+                      >{{ tab.name || `Tab ${ti + 1}` }} <span class="seg-n">{{ tab.widgets.length }}</span></button>
+                    </div>
+                    <button type="button" class="seg-add" title="Add a tab" @click.stop="addTabToWidget(w.id)">+ tab</button>
+                  </div>
+                  <h5 v-else>{{ w.title || w.id || 'untitled' }}</h5>
                   <span class="cw-type" :class="`t-${w.type}`">{{ w.type }}</span>
                 </header>
                 <div class="cw-body">
@@ -3782,11 +4168,10 @@ const namingTest = computed<NamingTestResult>(() => {
                       <span v-if="w.unit" class="unit">{{ w.unit }}</span>
                     </div>
                   </template>
-                  <template v-else-if="w.type === 'record' && w.expressions.length > 0">
-                    <!-- Record preview — mock slow-statement-like rows.
-                         The real runtime renderer will surface trace
-                         id / segment id columns; for the admin canvas
-                         we show the statement + latency only. -->
+                  <template v-else-if="(w.type === 'record' || w.type === 'table') && w.expressions.length > 0">
+                    <!-- Record / table preview — mock name → value rows. The
+                         real record renderer surfaces trace / segment id
+                         columns; the canvas shows the name + value only. -->
                     <ul class="cw-records">
                       <li
                         v-for="(r, ri) in mockRecordRows(w, Math.max(3, widgetRowSpan(w) * 2))"
@@ -3800,6 +4185,51 @@ const namingTest = computed<NamingTestResult>(() => {
                       </li>
                     </ul>
                   </template>
+                  <template v-else-if="w.type === 'tab'">
+                    <!-- Inline tab editing: the segmented bar lives in the header;
+                         here we render the active panel's widgets, edited in place
+                         (click to select → drawer). -->
+                    <div class="cw-subgrid" @click.stop>
+                      <div
+                        v-for="(sw, j) in subWidgetsOf(w.id, activeTabOf(w.id))"
+                        :key="`${sw.id}-${j}`"
+                        class="canvas-widget sub"
+                        :class="{ selected: subSel && subSel.widgetId === w.id && subSel.tabIdx === activeTabOf(w.id) && subSel.subIdx === j }"
+                        :style="widgetGridStyle(sw)"
+                        @click.stop="selectSub(w.id, activeTabOf(w.id), j)"
+                      >
+                        <header
+                          class="cw-head sub-head"
+                          :draggable="true"
+                          title="Drag out of the tab to move to the top level"
+                          @dragstart.stop="onSubReorderStart($event, w.id, activeTabOf(w.id), j)"
+                          @dragend="onReorderEnd"
+                        >
+                          <h5>{{ sw.title || sw.id || 'untitled' }}</h5>
+                          <span class="cw-type" :class="`t-${sw.type}`">{{ sw.type }}</span>
+                        </header>
+                        <div class="cw-body sub-body">
+                          <template v-if="sw.type === 'card'">
+                            <div class="cw-card-value"><span class="num">{{ fmtMetric(mockCardValue(sw)) }}</span><span v-if="sw.unit" class="unit">{{ sw.unit }}</span></div>
+                          </template>
+                          <template v-else-if="sw.type === 'line' && sw.expressions.length > 0">
+                            <TimeChart :series="mockLineSeries(sw)" :unit="sw.unit" :height="Math.max(48, widgetRowSpan(sw) * 100 - 44)" />
+                          </template>
+                          <template v-else-if="sw.type === 'top' && sw.expressions.length > 0">
+                            <TopList :groups="mockTopGroups(sw, Math.max(3, widgetRowSpan(sw) * 3))" :unit="sw.unit" />
+                          </template>
+                          <p v-else class="cw-empty">{{ sw.expressions.length ? sw.type : 'add an MQE in the drawer' }}</p>
+                        </div>
+                        <span class="cw-resize" title="Drag to resize" @mousedown.stop="onSubResizeStart($event, w.id, activeTabOf(w.id), j)">
+                          <svg viewBox="0 0 12 12" width="12" height="12" fill="currentColor">
+                            <circle cx="3" cy="9" r="0.8"/><circle cx="6" cy="9" r="0.8"/><circle cx="9" cy="9" r="0.8"/>
+                            <circle cx="6" cy="6" r="0.8"/><circle cx="9" cy="6" r="0.8"/><circle cx="9" cy="3" r="0.8"/>
+                          </svg>
+                        </span>
+                      </div>
+                      <button type="button" class="cw-subadd" title="Add a widget to this tab" @click.stop="addToTab(w.id, 'card')">+ widget</button>
+                    </div>
+                  </template>
                   <p v-else class="cw-empty">
                     Add an MQE expression in the drawer to preview.
                   </p>
@@ -3830,21 +4260,22 @@ const namingTest = computed<NamingTestResult>(() => {
             <aside v-if="selectedWidget" ref="drawerEl" class="drawer">
               <div class="drawer-head">
                 <h4>Edit widget</h4>
-                <span class="sub">{{ scopeLabel(activeScope) }} · #{{ (selectedIdx ?? 0) + 1 }}</span>
-                <button class="sw-btn ghost close" type="button" title="Close" @click="selectedIdx = null">✕</button>
+                <span class="sub">{{ scopeLabel(activeScope) }}<template v-if="subSel"> · in tab</template><template v-if="selectedWidget.type === 'tab'"> · tab group</template></span>
+                <button class="sw-btn ghost close" type="button" title="Close" @click="selectedIdx = null; subSel = null">✕</button>
               </div>
               <div class="drawer-body">
                 <div class="d-row">
-                  <label>
+                  <label :class="{ grow: selectedWidget.type === 'tab' }">
                     <span>id</span>
                     <input class="mono" v-model="selectedWidget.id" />
                   </label>
-                  <label class="grow">
+                  <!-- A tab group has no title of its own — the tabs are the labels. -->
+                  <label v-if="selectedWidget.type !== 'tab'" class="grow">
                     <span>Title</span>
                     <input v-model="selectedWidget.title" />
                   </label>
                 </div>
-                <div class="d-row">
+                <div v-if="selectedWidget.type !== 'tab'" class="d-row">
                   <label class="grow">
                     <span>Tip (hover hint)</span>
                     <input v-model="selectedWidget.tip" placeholder="—" />
@@ -3853,28 +4284,33 @@ const namingTest = computed<NamingTestResult>(() => {
                 <div class="d-row">
                   <label>
                     <span>Type</span>
-                    <select v-model="selectedWidget.type">
+                    <select :value="selectedWidget.type" @change="onWidgetTypeChange(($event.target as HTMLSelectElement).value)">
                       <option value="card">card</option>
                       <option value="line">line</option>
                       <option value="top">top</option>
                       <option value="record">record</option>
+                      <option value="table">table</option>
+                      <!-- A tab can't nest a tab — not offered for a widget inside a tab. -->
+                      <option v-if="!subSel" value="tab">tab</option>
                     </select>
                   </label>
-                  <label>
-                    <span>Unit</span>
-                    <input v-model="selectedWidget.unit" placeholder="—" />
-                  </label>
-                  <label>
-                    <span>Format</span>
-                    <select :value="selectedWidget.format ?? ''" @change="setWidgetFormat(($event.target as HTMLSelectElement).value)">
-                      <option value="">auto</option>
-                      <option value="int">int</option>
-                      <option value="decimal">decimal</option>
-                      <option value="compact">compact</option>
-                      <option value="duration">duration</option>
-                      <option v-if="selectedWidget.type === 'card'" value="enum">enum</option>
-                    </select>
-                  </label>
+                  <template v-if="selectedWidget.type !== 'tab'">
+                    <label>
+                      <span>Unit</span>
+                      <input v-model="selectedWidget.unit" placeholder="—" />
+                    </label>
+                    <label>
+                      <span>Format</span>
+                      <select :value="selectedWidget.format ?? ''" @change="setWidgetFormat(($event.target as HTMLSelectElement).value)">
+                        <option value="">auto</option>
+                        <option value="int">int</option>
+                        <option value="decimal">decimal</option>
+                        <option value="compact">compact</option>
+                        <option value="duration">duration</option>
+                        <option v-if="selectedWidget.type === 'card'" value="enum">enum</option>
+                      </select>
+                    </label>
+                  </template>
                   <label>
                     <span>Span</span>
                     <input type="number" min="1" max="12" v-model.number="selectedWidget.span" />
@@ -3884,135 +4320,166 @@ const namingTest = computed<NamingTestResult>(() => {
                     <input type="number" min="1" max="8" v-model.number="selectedWidget.rowSpan" />
                   </label>
                 </div>
-                <div v-if="selectedWidget.format === 'enum'" class="d-section">
-                  <span class="d-label">Value map (enum → label)</span>
-                  <div class="vm-rows">
-                    <div v-for="(row, i) in valueMapEntries" :key="i" class="vm-row">
-                      <input
-                        class="mono vm-key"
-                        :value="row[0]"
-                        @change="setValueMapKey(row[0], ($event.target as HTMLInputElement).value)"
-                        placeholder="0"
-                      />
-                      <span class="vm-arrow">→</span>
-                      <input
-                        class="vm-label"
-                        :value="row[1]"
-                        @input="setValueMapLabel(row[0], ($event.target as HTMLInputElement).value)"
-                        placeholder="Failed"
-                      />
-                      <button type="button" class="expr-del" title="Remove" @click="removeValueMapRow(row[0])">×</button>
+
+                <!-- TAB widget: manage its named panels. Switching / editing each
+                     panel's widgets happens inline on the canvas tile. -->
+                <template v-if="selectedWidget.type === 'tab'">
+                  <div class="d-section">
+                    <span class="d-label">Tabs</span>
+                    <div class="tab-mgr">
+                      <div v-for="(tab, ti) in selectedWidget.tabs ?? []" :key="ti" class="tab-mgr-row">
+                        <input
+                          class="tm-name"
+                          :value="tab.name"
+                          placeholder="Tab name"
+                          @input="renameTabOf(selectedWidget.id, ti, ($event.target as HTMLInputElement).value)"
+                        />
+                        <span class="tm-count">{{ tab.widgets.length }}w</span>
+                        <button type="button" class="tm-ctl" title="Show on canvas" @click="setActiveTabOf(selectedWidget.id, ti)">show</button>
+                        <button type="button" class="tm-ctl" title="Move up" @click="moveTabOf(selectedWidget.id, ti, -1)">↑</button>
+                        <button type="button" class="tm-ctl" title="Move down" @click="moveTabOf(selectedWidget.id, ti, 1)">↓</button>
+                        <button type="button" class="tm-ctl del" title="Delete tab" @click="deleteTabOf(selectedWidget.id, ti)">×</button>
+                      </div>
                     </div>
+                    <button type="button" class="sw-btn ghost small" @click="addTabToWidget(selectedWidget.id)">+ tab</button>
+                    <p class="d-hint">Each tab holds its own widgets — switch tabs and add / edit their widgets right on the canvas tile. Only the active tab is queried at runtime.</p>
                   </div>
-                  <button type="button" class="sw-btn ghost small" @click="addValueMapRow">+ value</button>
-                  <p class="d-hint">Map a coded value to a label (e.g. 1 → OK). Card widgets only; labels are translatable per locale.</p>
-                </div>
-                <div class="d-section">
-                  <span class="d-label">MQE expressions</span>
-                  <div v-if="showExprMeta" class="expr-cols">
-                    <span class="expr-col-mqe">expression</span>
-                    <span class="expr-col-label">{{ selectedWidget.type === 'top' ? 'tab label' : 'series label' }}</span>
-                    <span class="expr-col-unit">unit</span>
-                    <span v-if="selectedWidget.type === 'line'" class="expr-col-axis">axis</span>
-                    <span class="expr-col-del"></span>
-                  </div>
-                  <div class="expr-rows">
-                    <div v-for="(expr, i) in selectedWidget.expressions" :key="i" class="expr-row">
-                      <MqeExpressionInput
-                        class="expr-mqe"
-                        :model-value="expr"
-                        placeholder="instance_jvm_cpu"
-                        :title="`Expression ${i + 1}`"
-                        @update:model-value="updateExpr(i, $event)"
-                      />
-                      <input
-                        v-if="showExprMeta"
-                        class="expr-label"
-                        :value="selectedWidget.expressionLabels?.[i] ?? ''"
-                        @input="updateExprLabel(i, ($event.target as HTMLInputElement).value)"
-                        :placeholder="selectedWidget.type === 'top' ? 'Traffic' : 'p99'"
-                      />
-                      <input
-                        v-if="showExprMeta"
-                        class="mono expr-unit"
-                        :value="selectedWidget.expressionUnits?.[i] ?? ''"
-                        @input="updateExprUnit(i, ($event.target as HTMLInputElement).value)"
-                        :placeholder="selectedWidget.unit || 'ms'"
-                      />
-                      <select
-                        v-if="showExprMeta && selectedWidget.type === 'line'"
-                        class="mono expr-axis"
-                        :value="String(selectedWidget.expressionAxes?.[i] ?? 0)"
-                        @change="updateExprAxis(i, Number(($event.target as HTMLSelectElement).value))"
-                        title="Y-axis (Left / Right) — for dual-axis line widgets"
-                      >
-                        <option value="0">L</option>
-                        <option value="1">R</option>
-                      </select>
-                      <button
-                        type="button"
-                        class="expr-del"
-                        title="Remove expression"
-                        :disabled="selectedWidget.expressions.length <= 1"
-                        @click="removeExpr(i)"
-                      >×</button>
+                </template>
+
+                <!-- NORMAL widget: the content form. -->
+                <template v-else>
+                  <template v-if="editingWidget">
+                    <div v-if="editingWidget.format === 'enum'" class="d-section">
+                      <span class="d-label">Value map (enum → label)</span>
+                      <div class="vm-rows">
+                        <div v-for="(row, i) in valueMapEntries" :key="i" class="vm-row">
+                          <input
+                            class="mono vm-key"
+                            :value="row[0]"
+                            @change="setValueMapKey(row[0], ($event.target as HTMLInputElement).value)"
+                            placeholder="0"
+                          />
+                          <span class="vm-arrow">→</span>
+                          <input
+                            class="vm-label"
+                            :value="row[1]"
+                            @input="setValueMapLabel(row[0], ($event.target as HTMLInputElement).value)"
+                            placeholder="Failed"
+                          />
+                          <button type="button" class="expr-del" title="Remove" @click="removeValueMapRow(row[0])">×</button>
+                        </div>
+                      </div>
+                      <button type="button" class="sw-btn ghost small" @click="addValueMapRow">+ value</button>
+                      <p class="d-hint">Map a coded value to a label (e.g. 1 → OK). Card widgets only; labels are translatable per locale.</p>
                     </div>
-                  </div>
-                  <button type="button" class="sw-btn ghost small expr-add" @click="addExpr">+ expression</button>
-                  <p class="d-hint">
-                    For <code>top</code> widgets each expression is a switchable tab; for
-                    <code>line</code> each is a series. Label / unit / axis apply per expression.
-                  </p>
-                </div>
-                <div class="d-section">
-                  <span class="d-label" :title="visibleWhenHint(activeScope)">
-                    Visible when (optional)
-                  </span>
-                  <div class="vw-row">
-                    <select class="mono" v-model="vwKindModel">
-                      <option value="none">Always visible</option>
-                      <option value="mqe">MQE metric…</option>
-                      <option value="entity">Entity attribute…</option>
-                    </select>
-                    <template v-if="vwKindModel === 'mqe'">
-                      <MqeExpressionInput
-                        class="vw-target"
-                        v-model="vwTarget"
-                        placeholder="instance_jvm_cpu"
-                        title="Gate expression"
-                      />
-                      <select class="mono" v-model="vwOp">
-                        <option value="exists">has value</option>
-                        <option value="gt">&gt;</option>
-                        <option value="lt">&lt;</option>
-                      </select>
-                    </template>
-                    <template v-else-if="vwKindModel === 'entity'">
-                      <input class="mono vw-target" v-model="vwTarget" placeholder="language" />
-                      <select class="mono" v-model="vwOp">
-                        <option value="exists">exists</option>
-                        <option value="eq">equals</option>
-                      </select>
-                    </template>
-                    <input
-                      v-if="vwNeedsValue"
-                      class="mono vw-val"
-                      v-model="vwValue"
-                      :type="vwKindModel === 'mqe' ? 'number' : 'text'"
-                      :placeholder="vwKindModel === 'entity' ? 'JAVA' : '0'"
-                    />
-                  </div>
-                  <p v-if="vwKindModel === 'mqe' && !vwTarget.trim()" class="d-hint" style="color: var(--sw-warn)">
-                    Set a metric expression — an empty gate is ignored and the widget always shows.
-                  </p>
-                  <p class="d-hint" style="white-space: pre-line">{{ visibleWhenHint(activeScope) }}</p>
-                </div>
-                <div class="d-section">
-                  <label class="d-check">
-                    <input type="checkbox" v-model="selectedWidget.layerScope" />
-                    <span>Layer-scoped (run MQE across the whole layer, ignore selected service)</span>
-                  </label>
-                </div>
+                    <div class="d-section">
+                      <span class="d-label">MQE expressions</span>
+                      <div v-if="showExprMeta" class="expr-cols">
+                        <span class="expr-col-mqe">expression</span>
+                        <span class="expr-col-label">{{ editingWidget.type === 'top' ? 'tab label' : 'series label' }}</span>
+                        <span class="expr-col-unit">unit</span>
+                        <span v-if="editingWidget.type === 'line'" class="expr-col-axis">axis</span>
+                        <span class="expr-col-del"></span>
+                      </div>
+                      <div class="expr-rows">
+                        <div v-for="(expr, i) in editingWidget.expressions" :key="i" class="expr-row">
+                          <MqeExpressionInput
+                            class="expr-mqe"
+                            :model-value="expr"
+                            placeholder="instance_jvm_cpu"
+                            :title="`Expression ${i + 1}`"
+                            @update:model-value="updateExpr(i, $event)"
+                          />
+                          <input
+                            v-if="showExprMeta"
+                            class="expr-label"
+                            :value="editingWidget.expressionLabels?.[i] ?? ''"
+                            @input="updateExprLabel(i, ($event.target as HTMLInputElement).value)"
+                            :placeholder="editingWidget.type === 'top' ? 'Traffic' : 'p99'"
+                          />
+                          <input
+                            v-if="showExprMeta"
+                            class="mono expr-unit"
+                            :value="editingWidget.expressionUnits?.[i] ?? ''"
+                            @input="updateExprUnit(i, ($event.target as HTMLInputElement).value)"
+                            :placeholder="editingWidget.unit || 'ms'"
+                          />
+                          <select
+                            v-if="showExprMeta && editingWidget.type === 'line'"
+                            class="mono expr-axis"
+                            :value="String(editingWidget.expressionAxes?.[i] ?? 0)"
+                            @change="updateExprAxis(i, Number(($event.target as HTMLSelectElement).value))"
+                            title="Y-axis (Left / Right) — for dual-axis line widgets"
+                          >
+                            <option value="0">L</option>
+                            <option value="1">R</option>
+                          </select>
+                          <button
+                            type="button"
+                            class="expr-del"
+                            title="Remove expression"
+                            :disabled="editingWidget.expressions.length <= 1"
+                            @click="removeExpr(i)"
+                          >×</button>
+                        </div>
+                      </div>
+                      <button type="button" class="sw-btn ghost small expr-add" @click="addExpr">+ expression</button>
+                      <p class="d-hint">
+                        For <code>top</code> widgets each expression is a switchable tab; for
+                        <code>line</code> each is a series. Label / unit / axis apply per expression.
+                      </p>
+                    </div>
+                    <div class="d-section">
+                      <span class="d-label" :title="visibleWhenHint(activeScope)">
+                        Visible when (optional)
+                      </span>
+                      <div class="vw-row">
+                        <select class="mono" v-model="vwKindModel">
+                          <option value="none">Always visible</option>
+                          <option value="mqe">MQE metric…</option>
+                          <option value="entity">Entity attribute…</option>
+                        </select>
+                        <template v-if="vwKindModel === 'mqe'">
+                          <MqeExpressionInput
+                            class="vw-target"
+                            v-model="vwTarget"
+                            placeholder="instance_jvm_cpu"
+                            title="Gate expression"
+                          />
+                          <select class="mono" v-model="vwOp">
+                            <option value="exists">has value</option>
+                            <option value="gt">&gt;</option>
+                            <option value="lt">&lt;</option>
+                          </select>
+                        </template>
+                        <template v-else-if="vwKindModel === 'entity'">
+                          <input class="mono vw-target" v-model="vwTarget" placeholder="language" />
+                          <select class="mono" v-model="vwOp">
+                            <option value="exists">exists</option>
+                            <option value="eq">equals</option>
+                          </select>
+                        </template>
+                        <input
+                          v-if="vwNeedsValue"
+                          class="mono vw-val"
+                          v-model="vwValue"
+                          :type="vwKindModel === 'mqe' ? 'number' : 'text'"
+                          :placeholder="vwKindModel === 'entity' ? 'JAVA' : '0'"
+                        />
+                      </div>
+                      <p v-if="vwKindModel === 'mqe' && !vwTarget.trim()" class="d-hint" style="color: var(--sw-warn)">
+                        Set a metric expression — an empty gate is ignored and the widget always shows.
+                      </p>
+                      <p class="d-hint" style="white-space: pre-line">{{ visibleWhenHint(activeScope) }}</p>
+                    </div>
+                    <div class="d-section">
+                      <label class="d-check">
+                        <input type="checkbox" v-model="editingWidget.layerScope" />
+                        <span>Layer-scoped (run MQE across the whole layer, ignore selected service)</span>
+                      </label>
+                    </div>
+                  </template>
+                </template>
               </div>
               <!-- Pinned footer: move/delete stay visible no matter how long
                    the form scrolls (the body above owns the overflow). -->
@@ -4021,14 +4488,14 @@ const namingTest = computed<NamingTestResult>(() => {
                   <button
                     class="sw-btn"
                     type="button"
-                    :disabled="(selectedIdx ?? 0) === 0"
+                    :disabled="!selCanMoveUp"
                     title="Move up"
                     @click="moveSelected(-1)"
                   >↑ Up</button>
                   <button
                     class="sw-btn"
                     type="button"
-                    :disabled="(selectedIdx ?? 0) >= currentWidgets.length - 1"
+                    :disabled="!selCanMoveDown"
                     title="Move down"
                     @click="moveSelected(1)"
                   >↓ Down</button>
@@ -5081,7 +5548,9 @@ const namingTest = computed<NamingTestResult>(() => {
 }
 .alias-input.sm { height: 28px; font-size: 12px; max-width: none; }
 
-.editor-card { padding: 0; }
+/* overflow: visible overrides .sw-card's `overflow: hidden`, which would
+ * otherwise clip the sticky header inside the card (so it wouldn't pin). */
+.editor-card { padding: 0; overflow: visible; }
 /* Topology / endpoint-dep config preview — read-only JSON view. */
 .topo-cfg-body { padding: 12px 14px 16px; }
 .topo-cfg-help {
@@ -5314,6 +5783,14 @@ const namingTest = computed<NamingTestResult>(() => {
   padding: 12px 16px;
   border-bottom: 1px solid var(--sw-line);
 }
+/* Editor header pins to the top while the canvas scrolls, so + Add widget
+ * stays reachable (the canvas can be far taller than the viewport). */
+.editor-card .card-head.sticky-head {
+  position: sticky;
+  top: 0;
+  z-index: 6;
+  background: var(--sw-bg-1);
+}
 .card-head h4 {
   margin: 0;
   font-size: 12px;
@@ -5349,6 +5826,8 @@ const namingTest = computed<NamingTestResult>(() => {
   gap: 0;
   min-height: 480px;
 }
+/* When a widget is selected the canvas shrinks to reserve the drawer column,
+ * so widgets render at their true proportions next to the editor. */
 .editor-split.has-drawer {
   grid-template-columns: 1fr 360px;
 }
@@ -5368,9 +5847,7 @@ const namingTest = computed<NamingTestResult>(() => {
   grid-auto-rows: 120px;
   gap: 8px;
   min-height: 480px;
-  border-right: 1px solid var(--sw-line);
 }
-.editor-split:not(.has-drawer) .canvas { border-right: none; }
 .canvas.resizing {
   cursor: nwse-resize;
   user-select: none;
@@ -5415,6 +5892,156 @@ const namingTest = computed<NamingTestResult>(() => {
   border-color: var(--sw-accent-line);
   box-shadow: inset 0 0 0 1px var(--sw-accent-line);
 }
+/* Dropping a leaf widget onto a tab container moves it IN as a tab — a
+ * distinct green target so the gesture reads differently from a reorder. */
+.canvas-widget.drop-into-tab {
+  border-color: #34d399;
+  box-shadow: inset 0 0 0 2px #34d399, 0 0 0 4px rgba(52, 211, 153, 0.18);
+}
+.canvas-widget.drop-into-tab::after {
+  content: 'drop to add as a tab';
+  position: absolute;
+  inset: auto 0 0 0;
+  text-align: center;
+  font-size: 10px;
+  font-weight: 600;
+  color: #34d399;
+  background: rgba(52, 211, 153, 0.12);
+  padding: 2px 0;
+  pointer-events: none;
+}
+/* Tab container tile: an OPEN frame — top/bottom rules with rounded corner
+ * brackets, no full left/right side, so the inner widgets keep full width.
+ * The ::before/::after are short "caps" (top + bottom) that draw the corner
+ * brackets and leave the middle of the sides open. */
+/* Tab container tile (editor): a real frame so its extent is clear and the
+ * resize handle is grabbable; the tab bar sits in the header with an underline,
+ * and the bordered body below is the tab's internal content area. */
+.canvas-widget.is-tab {
+  background: var(--sw-bg-1);
+  border: 1px solid var(--sw-line);
+  border-radius: 7px;
+  overflow: hidden;
+}
+.canvas-widget.is-tab:hover { border-color: var(--sw-line-2); }
+.canvas-widget.is-tab.selected {
+  border-color: var(--sw-accent);
+  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
+}
+/* The tab bar IS the header. Its bottom rule is the ONLY frame — the line under
+ * the tab names. The grip (drag handle), tabs, and the `tab` chip share the row. */
+.canvas-widget.is-tab > .cw-head {
+  background: transparent;
+  border-left: none;
+  border-bottom: 1px solid var(--sw-line);
+  align-items: stretch;
+  gap: 4px;
+  padding: 0 6px 0 4px;
+  cursor: default;
+}
+.canvas-widget.is-tab > .cw-head .cw-grip { align-self: center; cursor: grab; }
+.canvas-widget.is-tab > .cw-head .cw-type { align-self: center; }
+/* Internal content area — a slightly inset panel so the tab's own widgets read
+ * as a group distinct from the surrounding canvas. */
+.canvas-widget.is-tab > .cw-body {
+  padding: 8px;
+  background: var(--sw-bg-0);
+}
+.cw-segbar {
+  display: flex;
+  align-items: stretch;
+  gap: 2px;
+  flex: 1;
+  min-width: 0;
+  overflow-x: auto;
+}
+.cw-segbar .seg {
+  display: inline-flex;
+  gap: 2px;
+  flex-wrap: nowrap;
+}
+.seg-pill {
+  display: inline-flex;
+  align-items: center;
+  gap: 5px;
+  border: none;
+  border-bottom: 2px solid transparent;
+  margin-bottom: -1px;
+  background: transparent;
+  color: var(--sw-fg-2);
+  cursor: pointer;
+  font-family: inherit;
+  font-size: 13.5px;
+  font-weight: 600;
+  padding: 8px 14px;
+  white-space: nowrap;
+}
+.seg-pill:hover { color: var(--sw-fg-0); }
+.seg-pill.on {
+  color: var(--sw-fg-0);
+  background: var(--sw-accent-soft);
+  border-bottom-color: var(--sw-accent);
+  border-radius: 6px 6px 0 0;
+}
+.seg-pill .seg-n {
+  font-size: 9px;
+  font-weight: 500;
+  color: var(--sw-fg-3);
+  background: var(--sw-bg-3);
+  border-radius: 6px;
+  padding: 0 4px;
+}
+.seg-add {
+  border: none;
+  background: transparent;
+  color: var(--sw-fg-3);
+  cursor: pointer;
+  font-family: inherit;
+  font-size: 11px;
+  padding: 5px 9px;
+  margin-left: 2px;
+}
+.seg-add:hover { color: var(--sw-accent); }
+/* The active tab's widgets — a 12-col sub-grid of editable tiles, full width. */
+.cw-subgrid {
+  flex: 1;
+  min-height: 0;
+  display: grid;
+  grid-template-columns: repeat(12, 1fr);
+  grid-auto-rows: 84px;
+  gap: 6px;
+  padding: 0 0 8px;
+  align-content: start;
+}
+.canvas-widget.sub {
+  min-height: 0;
+  background: var(--sw-bg-1);
+  border-radius: 5px;
+}
+.canvas-widget.sub.selected {
+  border-color: var(--sw-accent);
+  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18);
+}
+.canvas-widget.sub .sub-head {
+  cursor: pointer;
+  padding: 3px 8px;
+}
+.canvas-widget.sub .sub-head h5 { font-size: 10px; }
+.canvas-widget.sub .sub-body { padding: 4px 8px; }
+.cw-subadd {
+  grid-column: span 3;
+  border: 1.5px dashed var(--sw-line-2);
+  border-radius: 5px;
+  background: transparent;
+  color: var(--sw-fg-3);
+  cursor: pointer;
+  font: inherit;
+  font-size: 11px;
+  display: grid;
+  place-items: center;
+  min-height: 60px;
+}
+.cw-subadd:hover { border-color: var(--sw-accent); color: var(--sw-accent); }
 .cw-head {
   display: flex;
   align-items: center;
@@ -5458,6 +6085,119 @@ const namingTest = computed<NamingTestResult>(() => {
 .cw-type.t-top    { color: #a78bfa; background: rgba(167, 139, 250, 0.12); }
 .cw-type.t-card   { color: var(--sw-accent-2); background: var(--sw-accent-soft); }
 .cw-type.t-record { color: #22d3ee; background: rgba(34, 211, 238, 0.12); }
+.cw-type.t-tab    { color: #34d399; background: rgba(52, 211, 153, 0.12); }
+/* Tabs manager in the drawer (rename / reorder / delete / open each panel). */
+.tab-mgr {
+  display: flex;
+  flex-direction: column;
+  gap: 4px;
+  margin-bottom: 4px;
+}
+.tab-mgr-row {
+  display: flex;
+  align-items: center;
+  gap: 4px;
+}
+.tab-mgr-row .tm-name {
+  flex: 1;
+  min-width: 0;
+}
+.tab-mgr-row .tm-count {
+  font-size: 10px;
+  color: var(--sw-fg-3);
+  white-space: nowrap;
+}
+.tab-mgr-row .tm-open { font-size: 10px; white-space: nowrap; }
+.tab-mgr-row .tm-ctl {
+  border: 1px solid var(--sw-line);
+  background: var(--sw-bg-1);
+  color: var(--sw-fg-2);
+  cursor: pointer;
+  font-size: 11px;
+  line-height: 1;
+  padding: 2px 5px;
+  border-radius: 3px;
+}
+.tab-mgr-row .tm-ctl:hover { border-color: var(--sw-line-2); color: var(--sw-fg-0); }
+.tab-mgr-row .tm-ctl.del:hover { color: var(--sw-err); border-color: var(--sw-err); }
+/* Rich "+ Add widget" picker. */
+.add-widget-wrap {
+  position: relative;
+}
+.add-menu-backdrop {
+  position: fixed;
+  inset: 0;
+  z-index: 30;
+}
+.add-menu {
+  position: absolute;
+  top: calc(100% + 4px);
+  right: 0;
+  z-index: 31;
+  min-width: 230px;
+  background: var(--sw-bg-1);
+  border: 1px solid var(--sw-line-2);
+  border-radius: 6px;
+  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
+  padding: 4px;
+  display: flex;
+  flex-direction: column;
+  gap: 2px;
+}
+.add-menu-div {
+  height: 1px;
+  background: var(--sw-line);
+  margin: 3px 6px;
+}
+.add-menu-item {
+  display: flex;
+  align-items: center;
+  gap: 8px;
+  padding: 6px 8px;
+  border: none;
+  border-radius: 4px;
+  background: transparent;
+  color: var(--sw-fg-1);
+  cursor: pointer;
+  text-align: left;
+  font: inherit;
+}
+.add-menu-item:hover {
+  background: var(--sw-bg-2);
+}
+.add-menu-item .ami-type {
+  flex: 0 0 auto;
+  font-size: 9.5px;
+  font-family: var(--sw-mono);
+  text-transform: uppercase;
+  letter-spacing: 0.04em;
+  padding: 1px 5px;
+  border-radius: 3px;
+  background: var(--sw-bg-3);
+  color: var(--sw-fg-2);
+  min-width: 46px;
+  text-align: center;
+}
+.add-menu-item .ami-type.t-line   { color: #60a5fa; background: rgba(96, 165, 250, 0.12); }
+.add-menu-item .ami-type.t-top    { color: #a78bfa; background: rgba(167, 139, 250, 0.12); }
+.add-menu-item .ami-type.t-card   { color: var(--sw-accent-2); background: var(--sw-accent-soft); }
+.add-menu-item .ami-type.t-record { color: #22d3ee; background: rgba(34, 211, 238, 0.12); }
+.add-menu-item .ami-type.t-table  { color: #f59e0b; background: rgba(245, 158, 11, 0.12); }
+.add-menu-item .ami-type.t-tab    { color: #34d399; background: rgba(52, 211, 153, 0.12); }
+.add-menu-item .ami-text {
+  display: flex;
+  flex-direction: column;
+  min-width: 0;
+}
+.add-menu-item .ami-label {
+  font-size: 11.5px;
+  font-weight: 600;
+  color: var(--sw-fg-0);
+}
+.add-menu-item .ami-hint {
+  font-size: 10px;
+  color: var(--sw-fg-3);
+}
 .cw-body {
   flex: 1;
   min-height: 0;
@@ -5564,7 +6304,11 @@ const namingTest = computed<NamingTestResult>(() => {
   display: flex;
   flex-direction: column;
   background: var(--sw-bg-1);
-  border-left: 1px solid var(--sw-line);
+  /* Butts flush UNDER the sticky header (positionDrawer starts it at the
+   * header's bottom) and carries borders on every edge so the header + drawer
+   * read as one connected editor surface, not two floating pieces. */
+  border: 1px solid var(--sw-line);
+  border-top: none;
   /* Pinned to the viewport (positionDrawer sets top/left/width/height) so the
    * editor is always fully visible IN PLACE wherever you click in the canvas,
    * overlaying the reserved grid column — a sticky drawer clips past the bottom
diff --git a/apps/ui/src/i18n/locales/de.json b/apps/ui/src/i18n/locales/de.json
index d836a09..da89ed0 100644
--- a/apps/ui/src/i18n/locales/de.json
+++ b/apps/ui/src/i18n/locales/de.json
@@ -1527,5 +1527,11 @@
   "from catalog": "aus dem Katalog",
   "+ add to list": "+ zur Liste hinzufügen",
   "staged · {n}": "vorgemerkt · {n}",
-  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "Eine Metrik, die dieses OAP nicht definiert — ein anderes OAP hat sie in den gemeinsamen Speicher geschrieben. Gib ihre Wertspalte und ihren Werttyp an (aus dem OAP, das sie definiert), und Horizon stellt die Werte dar."
+  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "Eine Metrik, die dieses OAP nicht definiert — ein anderes OAP hat sie in den gemeinsamen Speicher geschrieben. Gib ihre Wertspalte und ihren Werttyp an (aus dem OAP, das sie definiert), und Horizon stellt die Werte dar.",
+  "no data": "keine Daten",
+  "Pop out — full list": "Herauslösen — vollständige Liste",
+  "No widgets visible in this tab.": "Keine Widgets in diesem Tab sichtbar.",
+  "This tab has no widgets.": "Keine Widgets in diesem Tab.",
+  "Clear all": "Alle löschen",
+  "Clear all and exit comparison": "Alle löschen und Vergleich beenden"
 }
diff --git a/apps/ui/src/i18n/locales/en.json b/apps/ui/src/i18n/locales/en.json
index a18f22b..cb27a5b 100644
--- a/apps/ui/src/i18n/locales/en.json
+++ b/apps/ui/src/i18n/locales/en.json
@@ -1527,5 +1527,11 @@
   "from catalog": "from catalog",
   "+ add to list": "+ add to list",
   "staged · {n}": "staged · {n}",
-  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values."
+  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.",
+  "no data": "no data",
+  "Pop out — full list": "Pop out — full list",
+  "No widgets visible in this tab.": "No widgets visible in this tab.",
+  "This tab has no widgets.": "This tab has no widgets.",
+  "Clear all": "Clear all",
+  "Clear all and exit comparison": "Clear all and exit comparison"
 }
diff --git a/apps/ui/src/i18n/locales/es.json b/apps/ui/src/i18n/locales/es.json
index 62c377f..eb106de 100644
--- a/apps/ui/src/i18n/locales/es.json
+++ b/apps/ui/src/i18n/locales/es.json
@@ -1527,5 +1527,11 @@
   "from catalog": "del catálogo",
   "+ add to list": "+ añadir a la lista",
   "staged · {n}": "en cola · {n}",
-  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "Una métrica que este OAP no define — otro OAP la escribió en el almacenamiento compartido. Indica su columna y tipo de valor (del OAP que la define) y Horizon grafica los valores."
+  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "Una métrica que este OAP no define — otro OAP la escribió en el almacenamiento compartido. Indica su columna y tipo de valor (del OAP que la define) y Horizon grafica los valores.",
+  "no data": "sin datos",
+  "Pop out — full list": "Expandir — lista completa",
+  "No widgets visible in this tab.": "No hay widgets visibles en esta pestaña.",
+  "This tab has no widgets.": "Esta pestaña no contiene widgets.",
+  "Clear all": "Borrar todo",
+  "Clear all and exit comparison": "Borrar todo y salir de la comparación"
 }
diff --git a/apps/ui/src/i18n/locales/fr.json b/apps/ui/src/i18n/locales/fr.json
index 7d797db..5818403 100644
--- a/apps/ui/src/i18n/locales/fr.json
+++ b/apps/ui/src/i18n/locales/fr.json
@@ -1527,5 +1527,11 @@
   "from catalog": "depuis le catalogue",
   "+ add to list": "+ ajouter à la liste",
   "staged · {n}": "en attente · {n}",
-  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "Une métrique que cet OAP ne définit pas — un autre OAP l'a écrite dans le stockage partagé. Indiquez sa colonne et son type de valeur (depuis l'OAP qui la définit) et Horizon trace les valeurs."
+  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "Une métrique que cet OAP ne définit pas — un autre OAP l'a écrite dans le stockage partagé. Indiquez sa colonne et son type de valeur (depuis l'OAP qui la définit) et Horizon trace les valeurs.",
+  "no data": "aucune donnée",
+  "Pop out — full list": "Détacher — liste complète",
+  "No widgets visible in this tab.": "Aucun widget visible dans cet onglet.",
+  "This tab has no widgets.": "Aucun widget dans cet onglet.",
+  "Clear all": "Tout effacer",
+  "Clear all and exit comparison": "Tout effacer et quitter la comparaison"
 }
diff --git a/apps/ui/src/i18n/locales/ja.json b/apps/ui/src/i18n/locales/ja.json
index 6f474f6..25b67b6 100644
--- a/apps/ui/src/i18n/locales/ja.json
+++ b/apps/ui/src/i18n/locales/ja.json
@@ -1527,5 +1527,11 @@
   "from catalog": "カタログから",
   "+ add to list": "+ リストに追加",
   "staged · {n}": "ステージ済み · {n}",
-  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "この OAP が定義していないメトリクス —— 別の OAP が共有ストレージに書き込んだものです。値カラムと型(定義元の OAP のカタログに記載)を指定すると、Horizon が値をグラフ化します。"
+  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "この OAP が定義していないメトリクス —— 別の OAP が共有ストレージに書き込んだものです。値カラムと型(定義元の OAP のカタログに記載)を指定すると、Horizon が値をグラフ化します。",
+  "no data": "データなし",
+  "Pop out — full list": "ポップアウト — 全リスト",
+  "No widgets visible in this tab.": "このタブに表示できるウィジェットはありません。",
+  "This tab has no widgets.": "このタブにはウィジェットがありません。",
+  "Clear all": "すべてクリア",
+  "Clear all and exit comparison": "すべてクリアして比較を終了"
 }
diff --git a/apps/ui/src/i18n/locales/ko.json b/apps/ui/src/i18n/locales/ko.json
index 58177f9..aead661 100644
--- a/apps/ui/src/i18n/locales/ko.json
+++ b/apps/ui/src/i18n/locales/ko.json
@@ -1527,5 +1527,11 @@
   "from catalog": "카탈로그에서",
   "+ add to list": "+ 목록에 추가",
   "staged · {n}": "대기 · {n}",
-  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "이 OAP가 정의하지 않은 메트릭 —— 다른 OAP가 공유 스토리지에 기록한 것입니다. 값 컬럼과 유형(정의한 OAP의 카탈로그 참고)을 입력하면 Horizon이 값을 차트로 표시합니다."
+  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "이 OAP가 정의하지 않은 메트릭 —— 다른 OAP가 공유 스토리지에 기록한 것입니다. 값 컬럼과 유형(정의한 OAP의 카탈로그 참고)을 입력하면 Horizon이 값을 차트로 표시합니다.",
+  "no data": "데이터 없음",
+  "Pop out — full list": "팝아웃 — 전체 목록",
+  "No widgets visible in this tab.": "이 탭에 표시할 위젯이 없습니다.",
+  "This tab has no widgets.": "이 탭에는 위젯이 없습니다.",
+  "Clear all": "모두 지우기",
+  "Clear all and exit comparison": "모두 지우고 비교 종료"
 }
diff --git a/apps/ui/src/i18n/locales/pt.json b/apps/ui/src/i18n/locales/pt.json
index cb337c2..27d3113 100644
--- a/apps/ui/src/i18n/locales/pt.json
+++ b/apps/ui/src/i18n/locales/pt.json
@@ -1527,5 +1527,11 @@
   "from catalog": "do catálogo",
   "+ add to list": "+ adicionar à lista",
   "staged · {n}": "na fila · {n}",
-  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "Uma métrica que este OAP não define — outro OAP a gravou no armazenamento compartilhado. Informe a coluna e o tipo de valor (do OAP que a define) e o Horizon plota os valores."
+  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "Uma métrica que este OAP não define — outro OAP a gravou no armazenamento compartilhado. Informe a coluna e o tipo de valor (do OAP que a define) e o Horizon plota os valores.",
+  "no data": "sem dados",
+  "Pop out — full list": "Expandir — lista completa",
+  "No widgets visible in this tab.": "Nenhum widget visível nesta aba.",
+  "This tab has no widgets.": "Nenhum widget nesta aba.",
+  "Clear all": "Limpar tudo",
+  "Clear all and exit comparison": "Limpar tudo e sair da comparação"
 }
diff --git a/apps/ui/src/i18n/locales/zh-CN.json b/apps/ui/src/i18n/locales/zh-CN.json
index facffc4..ea6d75e 100644
--- a/apps/ui/src/i18n/locales/zh-CN.json
+++ b/apps/ui/src/i18n/locales/zh-CN.json
@@ -1527,5 +1527,11 @@
   "from catalog": "来自目录",
   "+ add to list": "+ 加入列表",
   "staged · {n}": "暂存 · {n}",
-  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "本 OAP 未定义的指标 —— 由另一个 OAP 写入共享存储。填写它的值列和类型(来自定义该指标的 OAP),Horizon 即可绘制其数值。"
+  "A metric this OAP doesn't define — another OAP wrote it to the shared storage. Supply its value column and type (from the OAP that defines it) and Horizon charts the values.": "本 OAP 未定义的指标 —— 由另一个 OAP 写入共享存储。填写它的值列和类型(来自定义该指标的 OAP),Horizon 即可绘制其数值。",
+  "no data": "无数据",
+  "Pop out — full list": "弹出 — 完整列表",
+  "No widgets visible in this tab.": "此标签页中没有可见的组件。",
+  "This tab has no widgets.": "此标签页中暂无组件。",
+  "Clear all": "全部清除",
+  "Clear all and exit comparison": "清除全部并退出对比"
 }
diff --git a/apps/ui/src/render/layer-dashboard/LayerDashboardsView.vue b/apps/ui/src/render/layer-dashboard/LayerDashboardsView.vue
index adb83be..8750a3e 100644
--- a/apps/ui/src/render/layer-dashboard/LayerDashboardsView.vue
+++ b/apps/ui/src/render/layer-dashboard/LayerDashboardsView.vue
@@ -28,12 +28,15 @@
 <script setup lang="ts">
 import { computed } from 'vue';
 import { useRoute } from 'vue-router';
-import type { LayerDef } from '@skywalking-horizon-ui/api-client';
+import type { LayerDef, DashboardWidget } from '@skywalking-horizon-ui/api-client';
+import { findWidgetById } from '@skywalking-horizon-ui/api-client';
 import TimeChart from '@/components/charts/TimeChart.vue';
 import TopList from '@/components/charts/TopList.vue';
 import RecordList from '@/render/widgets/RecordList.vue';
 import WidgetTip from '@/components/primitives/WidgetTip.vue';
 import TableWidget from '@/render/widgets/TableWidget.vue';
+import TabWidget from '@/render/widgets/TabWidget.vue';
+import type { TabHostCtx } from '@/render/widgets/tabHostCtx';
 import { colorForMetric } from '@/utils/metricColor';
 import { useLayerDashboard, useLayerDashboardConfig } from '@/render/layer-dashboard/useLayerDashboard';
 import { useLayerPageOrchestrator } from '@/render/layer-dashboard/useLayerPageOrchestrator';
@@ -404,7 +407,43 @@ const noEntityToChart = computed<boolean>(() => {
   if (scope.value === 'endpoint') return !endpointResolvable.value;
   return false;
 });
-const widgetsForQuery = computed(() => config.value?.widgets ?? []);
+// Active tab per `tab`-type widget (by widget id; default first tab). Owned
+// here because it drives the lazy flatten below — only the active tab's
+// widgets are queried. Declared above its consumer (widgetsForQuery) per the
+// TDZ rule.
+const activeTabByWidget = ref<Record<string, number>>({});
+function activeTabIndex(widgetId: string): number {
+  return activeTabByWidget.value[widgetId] ?? 0;
+}
+/** Clamp a stored active-tab index to the widget's current tab count. The index
+ *  persists by widget id and a different scope template may reuse the same id
+ *  with fewer tabs, leaving it out of range — clamp so the query, the rendered
+ *  panel, and TabWidget's highlight all agree on the same tab. */
+function clampedTabIndex(w: DashboardWidget): number {
+  const n = w.tabs?.length ?? 0;
+  if (n === 0) return 0;
+  return Math.min(Math.max(activeTabIndex(w.id), 0), n - 1);
+}
+function activeTabWidgets(w: DashboardWidget): DashboardWidget[] {
+  if (w.type !== 'tab') return [];
+  return w.tabs?.[clampedTabIndex(w)]?.widgets ?? [];
+}
+function setActiveTab(widgetId: string, index: number): void {
+  activeTabByWidget.value = { ...activeTabByWidget.value, [widgetId]: index };
+}
+// Lazy flatten: a `tab` widget contributes ONLY its active tab's widgets to
+// the metrics request, so inactive tabs never hit OAP. Switching a tab changes
+// this list → the query refires for the newly-active tab's widgets (vue-query
+// keeps the prior response via keepPreviousData, so siblings don't blink and
+// switching back is instant). A half-authored leaf (blank MQE) is dropped from
+// the batch — the BFF rejects an empty expression and would 400 the whole
+// scope; the widget still renders (as "no data"), it just isn't queried.
+const widgetsForQuery = computed<DashboardWidget[]>(() =>
+  (config.value?.widgets ?? [])
+    .flatMap((w) => (w.type === 'tab' ? activeTabWidgets(w) : [w]))
+    .map((w) => ({ ...w, expressions: (w.expressions ?? []).filter((e) => e.trim().length > 0) }))
+    .filter((w) => w.expressions.length > 0),
+);
 // Hold the metrics fetch until the config bundle has resolved WITH widgets.
 // A resolved-but-empty config means "no dashboard for this layer/scope",
 // so we don't fire (which would otherwise make the BFF substitute its own
@@ -585,6 +624,11 @@ function unlockChip(key: string): void {
   // belong to a service other than the current primary.
   if (compareScope.value) selectionStore.removeKey(compareScope.value, key);
 }
+// Exit compare: drop every lock for the scope (incl. the non-removable CURRENT
+// chip) → the bar hides and the page returns to the single-entity view.
+function clearCohort(): void {
+  if (compareScope.value) selectionStore.clearLocks(compareScope.value);
+}
 
 // --- Multi-entity INLINE rendering -------------------------------------
 // In compare mode every widget keeps its normal tile and renders all N
@@ -663,7 +707,8 @@ interface TopGroup {
 // without an explicit order.
 function multiTopGroups(wid: string): TopGroup[] {
   const ents = compareEntities.value;
-  const desc = widgets.value.find((w) => w.id === wid)?.topNOrder !== 'asc';
+  // Whole-tree lookup — a top/record widget (carrying topNOrder) can live in a tab.
+  const desc = findWidgetById(widgets.value, wid)?.topNOrder !== 'asc';
   const all: TopItem[] = ents.flatMap((e) =>
     topItemsFor(wid, e).map((it) => ({ name: `${entityLabel(e)} · ${it.name}`, value: it.value })),
   );
@@ -735,7 +780,13 @@ const resultsById = computed(() => {
   for (const r of data.value?.widgets ?? []) out.set(r.id, r);
   return out;
 });
-const reachable = computed(() => data.value?.reachable !== false);
+const reachable = computed(() => {
+  const primaryOk = data.value?.reachable !== false;
+  if (!compareMode.value || primaryOk) return primaryOk;
+  // Compare: a failed primary must not flag "unreachable" over a cohort grid
+  // still rendering pinned-entity data (or still arriving).
+  return compareLoading.value || compareEntities.value.some((e) => resultByEntity.value.get(e) !== undefined);
+});
 const errorText = computed(() => data.value?.error ?? (error.value ? String(error.value) : null));
 
 /** Map a widget's grid footprint into the new 12-col flow grid. Honors
@@ -792,6 +843,8 @@ function popOutTopList(id: string): void {
   topListRefs.get(id)?.openExpanded();
 }
 function hasTopData(w: { id: string; type: string }): boolean {
+  // Compare mode renders from the per-entity fan-out — the primary may be empty.
+  if (compareMode.value) return hasMultiTopData(w.id);
   const r = resultsById.value.get(w.id);
   if (!r) return false;
   if (w.type === 'top') return !!(r.topGroups?.length || r.topList?.length);
@@ -830,12 +883,40 @@ function isHidden(id: string): boolean {
   // otherwise keep it visible while results are still arriving.
   return allLoaded && compareEntities.value.length > 0;
 }
+
+// Render context handed to TabWidget so a widget inside a tab renders exactly
+// like a top-level one — same color, same compare fan-out, same pop-out. The
+// helpers below are the very ones the top-level grid uses; `compare` is null
+// unless a cohort is locked. (See tabHostCtx.ts.)
+const tabHostCtx = computed<TabHostCtx>(() => ({
+  widgetColor,
+  setTopListRef,
+  popOutTopList,
+  hasTopData,
+  isHidden,
+  compare: compareMode.value
+    ? {
+        entities: compareEntities.value,
+        tableEntities: compareTableEntities.value,
+        loading: compareLoading.value,
+        hue: compareHue,
+        label: entityLabel,
+        cardText: cardTextFor,
+        cardValue: cardValueFor,
+        lineSeries: multiLineSeries,
+        lineLen,
+        topGroups: multiTopGroups,
+        hasTop: hasMultiTopData,
+        tableRows: compareTableRows,
+      }
+    : null,
+}));
 </script>
 
 <template>
   <div class="dash-tab">
-    <header v-if="isFetching || !reachable" class="dash-head">
-      <span v-if="isFetching" class="badge fetch">refreshing</span>
+    <header v-if="isFetching || compareLoading || !reachable" class="dash-head">
+      <span v-if="isFetching || compareLoading" class="badge fetch">refreshing</span>
       <span v-else-if="!reachable" class="badge err">OAP unreachable</span>
     </header>
 
@@ -1025,7 +1106,7 @@ function isHidden(id: string): boolean {
          branch below only shows once config has actually loaded and the
          layer genuinely defines none. -->
     <div
-      v-if="reachable && !noEntityToChart && (configLoading || (!dataIsFresh && widgets.length > 0))"
+      v-if="reachable && !noEntityToChart && (configLoading || (!dataIsFresh && widgets.length > 0 && widgetsForQuery.length > 0))"
       class="empty reading"
     >
       <span class="reading-dot" />
@@ -1040,8 +1121,8 @@ function isHidden(id: string): boolean {
             / <b>{{ selectedEndpoint }}</b>
           </template>
         </template>
-        <span v-if="widgets.length > 0" class="reading-progress">
-          · loading {{ widgets.length }} metric{{ widgets.length === 1 ? '' : 's' }}
+        <span v-if="widgetsForQuery.length > 0" class="reading-progress">
+          · loading {{ widgetsForQuery.length }} metric{{ widgetsForQuery.length === 1 ? '' : 's' }}
         </span>
       </span>
     </div>
@@ -1079,6 +1160,12 @@ function isHidden(id: string): boolean {
           >×</button>
         </div>
       </div>
+      <button
+        type="button"
+        class="cohort-clear"
+        :title="t('Clear all and exit comparison')"
+        @click="clearCohort"
+      >{{ t('Clear all') }}</button>
     </div>
     <!-- Tile grid keeps its normal layout in compare mode; each widget
          renders all N entities inline (card rows / overlaid lines /
@@ -1088,9 +1175,11 @@ function isHidden(id: string): boolean {
         v-for="w in widgets.filter((wi) => !isHidden(wi.id))"
         :key="w.id"
         class="widget sw-card"
+        :class="{ 'is-tab': w.type === 'tab' }"
         :style="{ ...gridStyle(w), '--widget-accent': widgetColor(w) }"
       >
-        <div class="w-head">
+        <!-- Tab widgets carry no title — the tab bar is their header. -->
+        <div v-if="w.type !== 'tab'" class="w-head">
           <!-- Title + tip group, kept adjacent so the tip chip sits
                next to the title text rather than floating away when
                the right-side affordances exist. -->
@@ -1105,7 +1194,7 @@ function isHidden(id: string): boolean {
                  their bodies don't reprint it. -->
             <span v-if="w.unit && w.type !== 'card'" class="unit">{{ w.unit }}</span>
             <button
-              v-if="(w.type === 'top' || w.type === 'record') && hasTopData(w)"
+              v-if="(w.type === 'top' || (w.type === 'record' && compareMode)) && hasTopData(w)"
               type="button"
               class="w-popout"
               title="Pop out — full list"
@@ -1214,6 +1303,17 @@ function isHidden(id: string): boolean {
             />
             <span v-else class="muted">{{ (compareMode ? compareLoading : (isFetching && !resultsById.has(w.id))) ? 'loading…' : 'no data' }}</span>
           </template>
+          <template v-else-if="w.type === 'tab'">
+            <TabWidget
+              :widget="w"
+              :active-index="clampedTabIndex(w)"
+              :results="resultsById"
+              :is-fetching="isFetching"
+              :compare-mode="compareMode"
+              :host="tabHostCtx"
+              @switch="setActiveTab(w.id, $event)"
+            />
+          </template>
         </div>
       </div>
     </div>
@@ -1464,6 +1564,23 @@ function isHidden(id: string): boolean {
 .cohort-x:hover {
   color: var(--sw-err);
 }
+.cohort-clear {
+  margin-left: auto;
+  padding: 3px 10px;
+  border: 1px solid var(--sw-line-2);
+  border-radius: 12px;
+  background: transparent;
+  color: var(--sw-fg-2);
+  font-size: 10.5px;
+  text-transform: uppercase;
+  letter-spacing: 0.05em;
+  cursor: pointer;
+  white-space: nowrap;
+}
+.cohort-clear:hover {
+  border-color: var(--sw-err);
+  color: var(--sw-err);
+}
 .ib-row:last-child { border-bottom: none; }
 .ib-row.on {
   background: var(--sw-accent-soft);
@@ -1634,6 +1751,29 @@ function isHidden(id: string): boolean {
   min-width: 0;
   overflow: hidden;
 }
+/* Tab container (runtime): no title (the tab bar is the header). The boundary is
+ * top + bottom rules with four rounded corner brackets and NO left/right side —
+ * drawn as absolute caps so it takes no layout width and the inner widgets stay
+ * flush-aligned. */
+.widget.is-tab {
+  position: relative;
+  background: transparent;
+  border: none;
+  overflow: visible;
+}
+.widget.is-tab::before,
+.widget.is-tab::after {
+  content: '';
+  position: absolute;
+  left: 0;
+  right: 0;
+  height: 12px;
+  border: 2px solid var(--sw-line-2);
+  pointer-events: none;
+}
+.widget.is-tab::before { top: 0; border-bottom: none; border-radius: 8px 8px 0 0; }
+.widget.is-tab::after { bottom: 0; border-top: none; border-radius: 0 0 8px 8px; }
+.widget.is-tab > .w-body { padding: 0; }
 .w-head {
   display: flex;
   align-items: center;
diff --git a/apps/ui/src/render/layer-dashboard/useLayerDashboard.ts b/apps/ui/src/render/layer-dashboard/useLayerDashboard.ts
index ce2e54a..5377819 100644
--- a/apps/ui/src/render/layer-dashboard/useLayerDashboard.ts
+++ b/apps/ui/src/render/layer-dashboard/useLayerDashboard.ts
@@ -28,7 +28,7 @@
  */
 
 import { computed, ref, type Ref } from 'vue';
-import { useQueries, useQuery } from '@tanstack/vue-query';
+import { keepPreviousData, useQueries, useQuery } from '@tanstack/vue-query';
 import { useAutoRefreshSubscribe } from '../../controls/useAutoRefreshSubscribe';
 import { bffClient } from '@/api/client';
 import {
@@ -113,13 +113,9 @@ export function useLayerDashboard(
    *  time-picker change refires the widget batch the same way a
    *  service/instance pick does. */
   range?: Ref<DashboardRange | null>,
-  /** Optional widget list. When supplied the SPA chunks it into
-   *  groups (matching booster-ui's DashboardMaxQueryWidgets = 6)
-   *  and fires N parallel BFF calls instead of one — exposes the
-   *  per-chunk completion as `widgetsArrived` so the loading
-   *  indicator can tick "x fired / y all". When omitted, falls
-   *  back to a single BFF call that resolves widgets server-side
-   *  (used by callers that don't have the config bundle handy). */
+  /** Optional widget list, sent as the BFF batch (`LayerApi.dashboard` splits a
+   *  >cap set into parallel requests + merges). When omitted the BFF resolves
+   *  widgets server-side — for callers without the config bundle. */
   widgetsList?: Ref<DashboardWidget[]>,
   /** Optional config-bundle readiness gate. When supplied, the metrics
    *  query waits until it is true, so the dashboard fires ONCE with the
@@ -167,14 +163,9 @@ export function useLayerDashboard(
     if (!r) return null;
     return `${r.step}:${Math.floor(r.startMs / 60_000)}:${Math.floor(r.endMs / 60_000)}`;
   });
-  // Total widget count for the loading indicator — only used to
-  // surface "N metrics loading" while the BFF batch is in flight.
-  // We don't chunk on the SPA side (each BFF call would re-run
-  // `listServices` to resolve the entity, doubling the latency for
-  // no real win — the BFF already chunks the OAP GraphQL trips
-  // internally via Promise.all, see http/query/dashboard.ts step 2).
-  // Single BFF call → one entity resolution + chunked MQE batches
-  // server-side → one merged response.
+  // Widget count for the "N metrics loading" hint. Chunking is NOT done here:
+  // `LayerApi.dashboard` splits an oversized widget set into parallel requests,
+  // and the BFF bulk-chunks the OAP trips per batch (http/query/dashboard.ts).
   const progress = ref<{ arrived: number; total: number }>({ arrived: 0, total: 0 });
 
   const q = useQuery({
@@ -246,6 +237,13 @@ export function useLayerDashboard(
     refetchInterval: refetchIntervalRef,
     refetchOnWindowFocus: computed(() => METRIC_SCOPES.has(scope?.value ?? 'service')),
     retry: 1,
+    // A tab switch changes the queryKey (only the active tab's widgets are in
+    // the batch — lazy), which would otherwise drop `data` to undefined while
+    // the new panel fetches and blank EVERY sibling widget on the page. Keep
+    // the prior response so siblings hold their values; the newly-activated
+    // tab's own cells fall through to their per-cell "loading…" state (the
+    // cascade-clear indicator lives inside the tab, not over the whole grid).
+    placeholderData: keepPreviousData,
   });
 
   // --- Multi-entity fan-out (Option B) -------------------------------
diff --git a/apps/ui/src/render/widgets/TabWidget.vue b/apps/ui/src/render/widgets/TabWidget.vue
new file mode 100644
index 0000000..9d9c672
--- /dev/null
+++ b/apps/ui/src/render/widgets/TabWidget.vue
@@ -0,0 +1,413 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+-->
+<!--
+  Tabbed container widget. Occupies one grid slot; each tab (a `name` + its
+  own `widgets`) is a little dashboard. The active tab's widgets render in a
+  12-col sub-grid; switching a tab swaps the whole set. Only the active tab's
+  widgets are queried — the host flattens them into the metrics request, so
+  inactive tabs cost nothing until opened. The active index is owned by the
+  host (it drives that flatten); this component is presentational and emits
+  `switch` on a tab click. Children render through the SAME host helpers as
+  top-level widgets (`host`: color, pop-out, the multi-entity compare fan-out),
+  so a widget dragged into a tab behaves exactly as it did outside.
+-->
+<script setup lang="ts">
+import { computed } from 'vue';
+import { useI18n } from 'vue-i18n';
+import type { DashboardWidget, DashboardTab, DashboardWidgetResult } from '@skywalking-horizon-ui/api-client';
+import TimeChart from '@/components/charts/TimeChart.vue';
+import TopList from '@/components/charts/TopList.vue';
+import RecordList from '@/render/widgets/RecordList.vue';
+import TableWidget from '@/render/widgets/TableWidget.vue';
+import { useTimeRangeStore } from '@/controls/timeRange';
+import { bucketTimeLabel, fmtMetricAs, type MetricFormat } from '@/utils/formatters';
+import type { TabHostCtx } from '@/render/widgets/tabHostCtx';
+
+const props = defineProps<{
+  widget: DashboardWidget;
+  activeIndex: number;
+  /** Results of every queried widget, keyed by id — the active tab's
+   *  widgets resolve their own result from here. */
+  results: Map<string, DashboardWidgetResult>;
+  isFetching: boolean;
+  /** True when the dashboard is comparing a locked cohort. */
+  compareMode?: boolean;
+  /** Host render helpers (color / pop-out / compare fan-out). */
+  host: TabHostCtx;
+}>();
+const emit = defineEmits<{ (e: 'switch', index: number): void }>();
+
+const { t } = useI18n({ useScope: 'global' });
+const timeRange = useTimeRangeStore();
+
+const tabs = computed<DashboardTab[]>(() => props.widget.tabs ?? []);
+// Clamp a stale / out-of-range active index so the highlighted tab and the
+// rendered panel always agree (a different scope template may reuse this
+// widget id with fewer tabs than the persisted index assumes).
+const effectiveIndex = computed<number>(() => {
+  const n = tabs.value.length;
+  return n === 0 ? 0 : Math.min(Math.max(props.activeIndex, 0), n - 1);
+});
+const activeTab = computed<DashboardTab | null>(() => tabs.value[effectiveIndex.value] ?? null);
+const activeWidgets = computed<DashboardWidget[]>(() => activeTab.value?.widgets ?? []);
+// Gate children by the host's canonical `visibleWhen` rule (compare-aware
+// union), not a local primary-only check. Only the children — never the slot.
+const visibleWidgets = computed<DashboardWidget[]>(() =>
+  activeWidgets.value.filter((w) => !props.host.isHidden(w.id)),
+);
+/** Compare helpers when a cohort is locked, else null (single-entity view). */
+const compare = computed(() => (props.compareMode ? props.host.compare : null));
+
+function resultOf(w: DashboardWidget): DashboardWidgetResult | undefined {
+  return props.results.get(w.id);
+}
+function cellStyle(w: DashboardWidget): Record<string, string> {
+  const span = w.span ?? 4;
+  const rowSpan = w.rowSpan ?? 2;
+  return { gridColumn: `span ${Math.max(1, Math.min(12, span))}`, gridRow: `span ${Math.max(1, rowSpan)}` };
+}
+function chartHeight(w: DashboardWidget): number {
+  return Math.max(60, (w.rowSpan ?? 2) * 110 - 46);
+}
+function xLabelsForLen(len: number): string[] {
+  if (len <= 0) return [];
+  const { startMs, endMs } = timeRange.range;
+  const step = timeRange.step;
+  if (len === 1) return [bucketTimeLabel(step, endMs)];
+  return Array.from({ length: len }, (_, i) => bucketTimeLabel(step, startMs + ((endMs - startMs) * i) / (len - 1)));
+}
+function cardText(w: DashboardWidget): string {
+  const v = resultOf(w)?.value ?? null;
+  if (v != null && w.format === 'enum' && w.valueMap) {
+    const label = w.valueMap[String(Math.round(v))];
+    if (label != null) return label;
+  }
+  return fmtMetricAs(v, w.format as MetricFormat | undefined);
+}
+function lineDataLen(w: DashboardWidget): number {
+  return compare.value ? compare.value.lineLen(w.id) : (resultOf(w)?.series?.[0]?.data.length ?? 0);
+}
+/** Whether a top/record child has a list worth a pop-out (single or compare). */
+function hasTopData(w: DashboardWidget): boolean {
+  return props.host.hasTopData(w);
+}
+function loadingOrEmpty(w: DashboardWidget): string {
+  const loading = compare.value ? compare.value.loading : props.isFetching && !props.results.has(w.id);
+  return loading ? t('loading…') : t('no data');
+}
+</script>
+
+<template>
+  <div class="tab-widget">
+    <div class="tw-strip" role="tablist">
+      <button
+        v-for="(tab, i) in tabs"
+        :key="i"
+        type="button"
+        class="tw-tab"
+        :class="{ on: i === effectiveIndex }"
+        role="tab"
+        :aria-selected="i === effectiveIndex"
+        @click="emit('switch', i)"
+      >{{ tab.name || `Tab ${i + 1}` }}</button>
+    </div>
+    <div class="tw-panel">
+      <div v-if="visibleWidgets.length" class="tw-grid">
+        <div v-for="w in visibleWidgets" :key="w.id" class="tw-cell" :style="cellStyle(w)">
+          <div class="tw-cell-head">
+            <span class="tw-cell-title">{{ w.title }}</span>
+            <span class="tw-cell-right">
+              <span v-if="w.unit && w.type !== 'card'" class="tw-cell-unit">{{ w.unit }}</span>
+              <!-- record only pops out in compare mode (its single-entity body is
+                   a RecordList, which has no expandable list to pop). -->
+              <button
+                v-if="(w.type === 'top' || (w.type === 'record' && compare)) && hasTopData(w)"
+                type="button"
+                class="tw-popout"
+                :title="t('Pop out — full list')"
+                :aria-label="t('Pop out — full list')"
+                @click="host.popOutTopList(w.id)"
+              >⤢</button>
+            </span>
+          </div>
+          <div class="tw-cell-body" :class="`type-${w.type}`">
+            <template v-if="!compare && resultOf(w)?.error">
+              <span class="muted">{{ resultOf(w)!.error }}</span>
+            </template>
+            <template v-else-if="w.type === 'card'">
+              <div v-if="compare" class="tw-card-compare">
+                <div v-for="e in compare.entities" :key="e" class="tw-cc-row">
+                  <span class="tw-cc-dot" :style="{ background: compare.hue(e) }" />
+                  <span class="tw-cc-name" :title="compare.label(e)">{{ compare.label(e) }}</span>
+                  <span class="tw-cc-val" :class="{ muted: compare.cardValue(w.id, e) == null }">{{ compare.cardText(w, e) }}</span>
+                </div>
+              </div>
+              <div v-else class="card-value">
+                <span class="num" :class="{ muted: resultOf(w)?.value == null }">
+                  {{ results.has(w.id) ? cardText(w) : (isFetching ? '…' : fmtMetricAs(null, w.format)) }}
+                </span>
+                <span v-if="w.unit" class="unit">{{ w.unit }}</span>
+              </div>
+            </template>
+            <template v-else-if="w.type === 'line'">
+              <TimeChart
+                v-if="compare ? compare.lineSeries(w.id).length : resultOf(w)?.series?.length"
+                :series="compare ? compare.lineSeries(w.id) : resultOf(w)!.series!"
+                :unit="w.unit"
+                :height="chartHeight(w)"
+                :accent="host.widgetColor(w)"
+                :format="w.format"
+                :x-labels="xLabelsForLen(lineDataLen(w))"
+              />
+              <span v-else class="muted">{{ loadingOrEmpty(w) }}</span>
+            </template>
+            <template v-else-if="w.type === 'top'">
+              <TopList
+                v-if="compare && compare.hasTop(w.id)"
+                :ref="(el) => host.setTopListRef(w.id, el)"
+                :groups="compare.topGroups(w.id)"
+                :unit="w.unit"
+                :color="host.widgetColor(w)"
+                :title="w.title"
+              />
+              <TopList
+                v-else-if="!compare && resultOf(w)?.topGroups?.length"
+                :ref="(el) => host.setTopListRef(w.id, el)"
+                :groups="resultOf(w)!.topGroups!"
+                :unit="w.unit"
+                :color="host.widgetColor(w)"
+                :title="w.title"
+              />
+              <TopList
+                v-else-if="!compare && resultOf(w)?.topList?.length"
+                :ref="(el) => host.setTopListRef(w.id, el)"
+                :items="resultOf(w)!.topList!"
+                :unit="w.unit"
+                :color="host.widgetColor(w)"
+                :title="w.title"
+              />
+              <span v-else class="muted">{{ loadingOrEmpty(w) }}</span>
+            </template>
+            <template v-else-if="w.type === 'record'">
+              <TopList
+                v-if="compare && compare.hasTop(w.id)"
+                :ref="(el) => host.setTopListRef(w.id, el)"
+                :groups="compare.topGroups(w.id)"
+                :unit="w.unit"
+                :color="host.widgetColor(w)"
+                :title="w.title"
+              />
+              <RecordList
+                v-else-if="!compare && resultOf(w)?.records?.length"
+                :items="resultOf(w)!.records!"
+                :unit="w.unit"
+                :color="host.widgetColor(w)"
+              />
+              <span v-else class="muted">{{ loadingOrEmpty(w) }}</span>
+            </template>
+            <template v-else-if="w.type === 'table'">
+              <TableWidget
+                v-if="compare ? compare.tableRows(w.id).length : resultOf(w)?.table?.length"
+                :rows="compare ? compare.tableRows(w.id) : resultOf(w)!.table!"
+                :entities="compare ? compare.tableEntities : undefined"
+                :label-top-n="w.labelTopN"
+                :headers="w.tableHeaders"
+                :show-values="w.showTableValues !== false"
+                :unit="w.unit"
+                :format="w.format"
+              />
+              <span v-else class="muted">{{ loadingOrEmpty(w) }}</span>
+            </template>
+          </div>
+        </div>
+      </div>
+      <div v-else class="tw-empty">{{ activeWidgets.length ? t('No widgets visible in this tab.') : t('This tab has no widgets.') }}</div>
+    </div>
+  </div>
+</template>
+
+<style scoped>
+.tab-widget {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  min-height: 0;
+}
+.tw-strip {
+  display: flex;
+  gap: 2px;
+  padding: 0;
+  /* The ONE frame: a line under the tab names. */
+  border-bottom: 1px solid var(--sw-line);
+  flex: 0 0 auto;
+  overflow-x: auto;
+}
+.tw-tab {
+  padding: 8px 15px;
+  font-size: 13.5px;
+  font-weight: 600;
+  color: var(--sw-fg-2);
+  background: transparent;
+  border: none;
+  border-bottom: 2px solid transparent;
+  margin-bottom: -1px;
+  cursor: pointer;
+  font-family: inherit;
+  white-space: nowrap;
+}
+.tw-tab:hover { color: var(--sw-fg-0); }
+.tw-tab.on {
+  color: var(--sw-fg-0);
+  background: var(--sw-accent-soft);
+  border-bottom-color: var(--sw-accent);
+  border-radius: 6px 6px 0 0;
+}
+/* Content sits flush under the tab line — no side frame, so its widgets align. */
+.tw-panel {
+  flex: 1;
+  min-height: 0;
+  overflow: auto;
+  padding: 8px 0 2px;
+}
+.tw-grid {
+  display: grid;
+  grid-template-columns: repeat(12, minmax(0, 1fr));
+  grid-auto-rows: 110px;
+  gap: 6px;
+}
+.tw-cell {
+  display: flex;
+  flex-direction: column;
+  min-height: 0;
+  background: var(--sw-bg-0);
+  border: 1px solid var(--sw-line);
+  border-radius: 5px;
+  overflow: hidden;
+}
+.tw-cell-head {
+  display: flex;
+  align-items: baseline;
+  gap: 6px;
+  padding: 4px 8px;
+  border-bottom: 1px solid var(--sw-line);
+}
+.tw-cell-title {
+  font-size: 10.5px;
+  font-weight: 600;
+  color: var(--sw-fg-1);
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+.tw-cell-right {
+  display: inline-flex;
+  align-items: center;
+  gap: 6px;
+  margin-left: auto;
+}
+.tw-cell-unit {
+  font-size: 9.5px;
+  color: var(--sw-fg-3);
+}
+.tw-popout {
+  border: none;
+  background: transparent;
+  color: var(--sw-fg-3);
+  cursor: pointer;
+  font-size: 12px;
+  line-height: 1;
+  padding: 0 2px;
+}
+.tw-popout:hover { color: var(--sw-accent); }
+.tw-cell-body {
+  flex: 1;
+  display: flex;
+  flex-direction: column;
+  min-height: 0;
+  padding: 6px 8px;
+  overflow: hidden;
+}
+.tw-cell-body.type-card {
+  align-items: center;
+  justify-content: center;
+}
+.tw-cell-body :deep(.top-list),
+.tw-cell-body :deep(.top-list .rows) {
+  flex: 1;
+  min-height: 0;
+}
+.card-value {
+  display: flex;
+  align-items: baseline;
+  gap: 4px;
+}
+.card-value .num {
+  font-size: 22px;
+  font-weight: 700;
+  color: var(--sw-fg-0);
+  font-variant-numeric: tabular-nums;
+  letter-spacing: -0.02em;
+}
+.card-value .num.muted { color: var(--sw-fg-3); }
+.card-value .unit {
+  font-size: 10px;
+  color: var(--sw-fg-3);
+}
+/* Per-entity compare rows for a card child (mirrors the top-level card-compare). */
+.tw-card-compare {
+  display: flex;
+  flex-direction: column;
+  gap: 3px;
+  width: 100%;
+  padding: 0 2px;
+}
+.tw-cc-row {
+  display: flex;
+  align-items: baseline;
+  gap: 6px;
+  font-size: 11px;
+}
+.tw-cc-dot {
+  flex: 0 0 auto;
+  width: 7px;
+  height: 7px;
+  border-radius: 2px;
+  align-self: center;
+}
+.tw-cc-name {
+  color: var(--sw-fg-2);
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+}
+.tw-cc-val {
+  margin-left: auto;
+  font-weight: 700;
+  color: var(--sw-fg-0);
+  font-variant-numeric: tabular-nums;
+}
+.tw-cc-val.muted { color: var(--sw-fg-3); font-weight: 400; }
+.muted {
+  color: var(--sw-fg-3);
+  font-size: 11px;
+}
+.tw-empty {
+  margin: auto;
+  color: var(--sw-fg-3);
+  font-size: 11px;
+}
+</style>
diff --git a/apps/ui/src/render/widgets/tabHostCtx.ts b/apps/ui/src/render/widgets/tabHostCtx.ts
new file mode 100644
index 0000000..1ff23db
--- /dev/null
+++ b/apps/ui/src/render/widgets/tabHostCtx.ts
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import type {
+  DashboardWidget,
+  DashboardTableRow,
+  DashboardTopItem,
+} from '@skywalking-horizon-ui/api-client';
+
+/** A widget moved INTO a tab must render identically to a top-level widget —
+ *  including the multi-entity compare view and the top/record pop-out. Rather
+ *  than re-derive that logic inside the tab component (which drifts), the host
+ *  (LayerDashboardsView) passes its own render helpers down through this
+ *  context. These mirror the helpers the top-level grid already uses. */
+
+/** One overlaid line per locked entity (mirrors the host's `multiLineSeries`). */
+export interface CompareSeries {
+  label: string;
+  data: Array<number | null>;
+  yAxisIndex?: number;
+  unit?: string;
+  color: string;
+}
+/** A per-entity (or "All") sorted list group (mirrors `multiTopGroups`). */
+export interface CompareTopGroup {
+  label: string;
+  expression: string;
+  items: DashboardTopItem[];
+}
+/** A locked entity tagged for TableWidget's grouped compare rendering. */
+export interface CompareEntity {
+  key: string;
+  name: string;
+  hue: string;
+}
+
+/** Compare-mode helpers — present only while a cohort is locked. */
+export interface TabCompareCtx {
+  entities: string[];
+  tableEntities: CompareEntity[];
+  loading: boolean;
+  hue: (key: string) => string;
+  label: (key: string) => string;
+  cardText: (w: DashboardWidget, key: string) => string;
+  cardValue: (id: string, key: string) => number | null;
+  lineSeries: (id: string) => CompareSeries[];
+  lineLen: (id: string) => number;
+  topGroups: (id: string) => CompareTopGroup[];
+  hasTop: (id: string) => boolean;
+  tableRows: (id: string) => Array<DashboardTableRow & { entityKey: string }>;
+}
+
+/** The full render context the host hands a TabWidget so its children behave
+ *  like top-level widgets. `compare` is null in single-entity mode. */
+export interface TabHostCtx {
+  widgetColor: (w: DashboardWidget) => string;
+  /** Register a top/record TopList instance so the host can pop it out. */
+  setTopListRef: (id: string, el: unknown) => void;
+  popOutTopList: (id: string) => void;
+  hasTopData: (w: DashboardWidget) => boolean;
+  /** The host's canonical `visibleWhen` filter (single-entity flag; compare =
+   *  per-entity union). Tab children reuse it rather than re-checking primary. */
+  isHidden: (id: string) => boolean;
+  compare: TabCompareCtx | null;
+}
diff --git a/docs/customization/layer-templates.md b/docs/customization/layer-templates.md
index b727b28..3e02e43 100644
--- a/docs/customization/layer-templates.md
+++ b/docs/customization/layer-templates.md
@@ -191,8 +191,9 @@ A layer without an explicit `instance` widget set will reuse `service` widgets o
 | `id` | Unique widget id within the dashboard. |
 | `title` | Widget title shown in the card header. |
 | `tip` | Optional hover hint. |
-| `type` | Widget kind, usually `card`, `line`, `top`, `record`, or `table`. |
-| `expressions[]` | MQE expressions to run. |
+| `type` | Widget kind, usually `card`, `line`, `top`, `record`, `table`, or `tab` (a container of named tab panels, each holding its own widgets — see [Tab widgets](#tab-widgets)). |
+| `tabs[]` | `tab` widgets only: the tab panels. Each is `{ "name": "…", "widgets": [ … ] }` — a label plus its own set of widgets. |
+| `expressions[]` | MQE expressions to run. A `tab` container has none of its own. |
 | `expressionLabels[]` | Tab labels for `top`, legend labels for `line`. |
 | `expressionUnits[]` | Per-expression unit override. |
 | `expressionAxes[]` | `0` for left axis, `1` for right axis on dual-axis line charts. |
@@ -226,6 +227,43 @@ The widget type **must match the MQE shape**:
 
 A `line` widget with a scalar-collapsed MQE renders a one-point chart and confuses operators. The widget editor warns; the schema does not enforce.
 
+### Tab widgets
+
+A `tab` widget is a sized grid slot that holds several **named tab panels**, each with its own set of widgets — its own little dashboard. Use it when several groups of widgets belong in one place — one tab per subsystem, or traffic vs. errors vs. saturation — without spending a slot on each.
+
+A tab is just a `name` plus its own `widgets`. Switching a tab swaps the whole sub-grid; the widgets inside lay out in a 12-column grid within the slot. Only the **active** tab is queried — switching to a tab loads its widgets on demand and then keeps them warm, so an unopened tab costs nothing and flipping back is instant. A tab's widgets are ordinary widgets (`card` / `line` / `top` / `record` / `table`); a tab cannot contain another tab (one level deep).
+
+To author one in the admin: add a widget, set its **Type** to `tab`, and size its slot (span / row span). The tile shows a **segmented tab bar** — click a tab to make it active, **+ tab** to add one — and the active tab's widgets are edited **inline, right on the tile**: a per-tab **+ widget** drops a widget into the active tab, and clicking a widget opens its config in the drawer. Manage the tabs themselves (rename / reorder / delete) from the drawer's **Tabs** list when the tab widget  [...]
+
+The stored shape — a container with empty `expressions` and a `tabs[]` array of `{ name, widgets }` panels:
+
+```json
+{
+  "id": "svc_signals",
+  "title": "Service signals",
+  "type": "tab",
+  "span": 6,
+  "rowSpan": 4,
+  "expressions": [],
+  "tabs": [
+    {
+      "name": "Golden signals",
+      "widgets": [
+        { "id": "sig_traffic", "title": "Traffic", "type": "line", "unit": "rpm", "span": 6, "rowSpan": 2, "expressions": ["service_cpm"] },
+        { "id": "sig_latency", "title": "Latency", "type": "line", "unit": "ms", "span": 6, "rowSpan": 2, "expressions": ["service_resp_time"] },
+        { "id": "sig_apdex", "title": "Apdex", "type": "card", "format": "decimal", "span": 4, "rowSpan": 2, "expressions": ["service_apdex/10000"] }
+      ]
+    },
+    {
+      "name": "Endpoints",
+      "widgets": [
+        { "id": "sig_top_api", "title": "Top APIs", "type": "top", "span": 12, "rowSpan": 3, "expressions": ["top_n(endpoint_cpm,20,des)"] }
+      ]
+    }
+  ]
+}
+```
+
 ## `topology`
 
 Config for the **Topology** map (the service-map view): which MQE metrics decorate each service node and each service-to-service call edge — and, optionally, the **instance map** drill-down. Edited in the admin under the layer's **Topology** scope (node-metric / server-edge / client-edge editors). Without a block, a sensible default metric set is used.
diff --git a/packages/api-client/src/dashboard.ts b/packages/api-client/src/dashboard.ts
index 0b6419c..bf13824 100644
--- a/packages/api-client/src/dashboard.ts
+++ b/packages/api-client/src/dashboard.ts
@@ -49,8 +49,11 @@
  *            graph for label-dimensioned meters (pod phase per service,
  *            node condition, deployment replicas, …) that a scalar card
  *            or a time-series line cannot represent.
+ *   tab    — a container: one grid slot holding several full widgets (any
+ *            of the above) shown as switchable tabs. It carries no MQE of
+ *            its own (see `tabs`); only the active tab's child is queried.
  */
-export type DashboardWidgetType = 'card' | 'line' | 'top' | 'record' | 'table';
+export type DashboardWidgetType = 'card' | 'line' | 'top' | 'record' | 'table' | 'tab';
 
 /**
  * Structured widget visibility predicate. When set on a widget, the BFF
@@ -122,8 +125,21 @@ export interface DashboardWidget {
   type: DashboardWidgetType;
   /** One or more MQE expressions. `card` collapses to a scalar (avg);
    *  `line` renders one labeled series per expression; `top` treats
-   *  every expression as a switchable view (see `expressionLabels`). */
+   *  every expression as a switchable view (see `expressionLabels`). A
+   *  `tab` container has none of its own — it carries an empty array and
+   *  defers to the widgets inside its `tabs`. */
   expressions: string[];
+  /**
+   * `tab` container ONLY: the named tab panels. Each {@link DashboardTab} is
+   * just a `name` plus its own set of `widgets` — its own little dashboard.
+   * Switching the active tab swaps the whole sub-grid; only the active tab's
+   * widgets are queried (lazy). The widgets inside a tab are ordinary
+   * widgets (card / line / top / table / record) and must NOT themselves be
+   * `tab` (one level deep). The container occupies one grid slot
+   * (`span` / `rowSpan`); each tab's widgets lay out in a 12-col sub-grid
+   * inside it.
+   */
+  tabs?: DashboardTab[];
   /**
    * Optional human-readable label per entry in `expressions`. For
    * `top` widgets these drive the in-widget switcher tabs (e.g.
@@ -220,6 +236,55 @@ export interface DashboardWidget {
   h?: number;
 }
 
+/**
+ * One tab panel inside a `tab` widget: a `name` plus its own set of widgets.
+ * A tab carries no MQE of its own — its content is entirely the `widgets` it
+ * holds, which lay out in a 12-col sub-grid when the tab is active. Switching
+ * the active tab swaps the whole set; only the active tab's widgets are queried.
+ */
+export interface DashboardTab {
+  /** Tab label shown in the tab bar. */
+  name: string;
+  /** The widgets shown while this tab is active. Ordinary widgets — never `tab`. */
+  widgets: DashboardWidget[];
+}
+
+// Widget-tree traversal — the one place that descends a `tab` container's
+// panels (one level; tabs don't nest). Use instead of re-writing the descent.
+
+/** Walk every widget: each top-level widget, then any tab's children. Tab
+ *  containers are yielded too — filter `type !== 'tab'` for queryable leaves. */
+export function* walkWidgets(
+  widgets: readonly DashboardWidget[] | undefined,
+): Generator<DashboardWidget> {
+  for (const w of widgets ?? []) {
+    yield w;
+    if (w.type === 'tab') {
+      for (const tab of w.tabs ?? []) {
+        for (const child of tab.widgets) yield child;
+      }
+    }
+  }
+}
+
+/** Find a widget by id anywhere in the tree (top-level or in a tab panel). */
+export function findWidgetById(
+  widgets: readonly DashboardWidget[] | undefined,
+  id: string,
+): DashboardWidget | undefined {
+  for (const w of walkWidgets(widgets)) if (w.id === id) return w;
+  return undefined;
+}
+
+/** Collect every widget id; pass `into` to accumulate across lists (scopes). */
+export function collectWidgetIds(
+  widgets: readonly DashboardWidget[] | undefined,
+  into: Set<string> = new Set<string>(),
+): Set<string> {
+  for (const w of walkWidgets(widgets)) into.add(w.id);
+  return into;
+}
+
 export interface DashboardConfig {
   /** Layer enum (UPPER_SNAKE). */
   layer: string;
diff --git a/packages/api-client/src/index.ts b/packages/api-client/src/index.ts
index 8668b24..8c6fadb 100644
--- a/packages/api-client/src/index.ts
+++ b/packages/api-client/src/index.ts
@@ -45,6 +45,7 @@ export type {
   DashboardResponse,
   DashboardScope,
   DashboardSeries,
+  DashboardTab,
   DashboardTopItem,
   DashboardTableRow,
   DashboardWidget,
@@ -52,6 +53,7 @@ export type {
   DashboardWidgetType,
   VisibleWhen,
 } from './dashboard.js';
+export { walkWidgets, findWidgetById, collectWidgetIds } from './dashboard.js';
 export type {
   TopologyMetricDef,
   TopologyConfig,