Problem / motivation
GroupWidget is the dashboard's nested-layout container (panel / collapsible / tabbed — the project's named "tabs, collapsible groups" core value). Last run added the names read side via #280 (getTabNames() / hasTab() / getActiveTab()), but the contents read side is still missing:
getNestedWidgets() (libs/Dashboard/GroupWidget.m:248) returns a flat cell of all widgets (Children + every tab's widgets concatenated). It cannot answer "what is in the Details tab?".
- Panel-mode
Children is public (GroupWidget.m:40), but tabbed-mode contents live in the private Tabs{i}.widgets struct field (struct('name',…,'widgets',{{…}}), :41/:84/:90). To read one tab's widgets, a caller must know and traverse that internal struct shape.
- There is no title-based widget lookup across the group.
Verified grep -rnE "getTabWidgets|getWidgetByTitle|getChildWidgets" libs/ examples/ returns nothing.
The natural call after getTabNames() (#280) is "now give me that tab's widgets" — which has no public API today. This is the documented read-side follow-on to #280 and the directly-analogous container to #274 (DashboardPage per-page getWidget/getWidgetByTitle).
Proposed feature
Three small read-only methods on GroupWidget, completing the read side opened by #280:
Rough sketch
Single file, libs/Dashboard/GroupWidget.m, in methods (Access = public), reusing the existing private findTab (:429) and the existing Children/Tabs state:
function ws = getTabWidgets(obj, tabName)
%GETTABWIDGETS Return the named tab's widgets as a cell (tabbed mode).
tIdx = obj.findTab(tabName);
if tIdx == 0
error('GroupWidget:unknownTab', 'Unknown tab "%s"', tabName);
end
ws = obj.Tabs{tIdx}.widgets;
end
function ws = getChildWidgets(obj)
%GETCHILDWIDGETS Return the panel/collapsible Children cell.
ws = obj.Children;
end
function w = getWidgetByTitle(obj, title)
%GETWIDGETBYTITLE First widget in this group whose Title matches, or [].
w = [];
all = obj.getNestedWidgets();
for i = 1:numel(all)
if isprop(all{i}, 'Title') && strcmp(all{i}.Title, title)
w = all{i};
return;
end
end
end
getTabWidgets errors GroupWidget:unknownTab, consistent with the existing removeTab/removeChild siblings.
Value
Medium. Addressable per-tab access is the primitive a "jump to tab then act on its contents" control, a FastSenseCompanion inspector, or a structural test assertion needs — without coupling to the private Tabs struct layout. getWidgetByTitle mirrors the DashboardPage convenience (#274) and is the obvious lookup once a group holds many widgets.
Constraints check
- Toolbox-free: yes — plain cell indexing +
strcmp/isprop.
- Backward-compatible: yes — purely additive read-only methods; no existing method touched; no
toStruct/fromStruct change (Tabs/Children already round-trip).
- Pure MATLAB/Octave: yes.
- Contract: works entirely through the existing
DashboardWidget/GroupWidget contract.
Effort estimate
S — single file (GroupWidget.m), three small methods over existing state.
Dedup
Clean. #280 is names-only introspection (the sibling, not the contents read); #274 is DashboardPage (different class); #239 is .m-export child config. No issue/PR touches per-tab widget access or title lookup on GroupWidget.
AI-proposed via /feature-scout — needs a human product decision before implementation.
Problem / motivation
GroupWidgetis the dashboard's nested-layout container (panel / collapsible / tabbed — the project's named "tabs, collapsible groups" core value). Last run added the names read side via #280 (getTabNames()/hasTab()/getActiveTab()), but the contents read side is still missing:getNestedWidgets()(libs/Dashboard/GroupWidget.m:248) returns a flat cell of all widgets (Children + every tab's widgets concatenated). It cannot answer "what is in the Details tab?".Childrenis public (GroupWidget.m:40), but tabbed-mode contents live in the privateTabs{i}.widgetsstruct field (struct('name',…,'widgets',{{…}}),:41/:84/:90). To read one tab's widgets, a caller must know and traverse that internal struct shape.Verified
grep -rnE "getTabWidgets|getWidgetByTitle|getChildWidgets" libs/ examples/returns nothing.The natural call after
getTabNames()(#280) is "now give me that tab's widgets" — which has no public API today. This is the documented read-side follow-on to #280 and the directly-analogous container to #274 (DashboardPageper-pagegetWidget/getWidgetByTitle).Proposed feature
Three small read-only methods on
GroupWidget, completing the read side opened by #280:getTabWidgets(tabName)→ the named tab'swidgetscell.getChildWidgets()→obj.Children(panel/collapsible convenience; symmetry getter that parallelsgetActiveTab()).getWidgetByTitle(title)→ first widget across Children + all tabs whoseTitlematches ([]when none) — the lookup analog of DashboardPage: add removeWidget(idx) (+ per-page getWidget/getWidgetByTitle) to round out the add-only page collection #274.Rough sketch
Single file,
libs/Dashboard/GroupWidget.m, inmethods (Access = public), reusing the existing privatefindTab(:429) and the existingChildren/Tabsstate:getTabWidgetserrorsGroupWidget:unknownTab, consistent with the existingremoveTab/removeChildsiblings.Value
Medium. Addressable per-tab access is the primitive a "jump to tab then act on its contents" control, a
FastSenseCompanioninspector, or a structural test assertion needs — without coupling to the privateTabsstruct layout.getWidgetByTitlemirrors the DashboardPage convenience (#274) and is the obvious lookup once a group holds many widgets.Constraints check
strcmp/isprop.toStruct/fromStructchange (Tabs/Childrenalready round-trip).DashboardWidget/GroupWidgetcontract.Effort estimate
S — single file (
GroupWidget.m), three small methods over existing state.Dedup
Clean. #280 is names-only introspection (the sibling, not the contents read); #274 is
DashboardPage(different class); #239 is.m-export child config. No issue/PR touches per-tab widget access or title lookup onGroupWidget.AI-proposed via /feature-scout — needs a human product decision before implementation.