Dashboard KPI widgets: reports[].widget, custom widgets, Report Editor panel#6133
Merged
Conversation
…s, Report Editor panel
Meaningful dashboard tiles instead of raw per-entity record counts, in
three layers:
- reports[].widget: a KPI tile backed by the report. kind count (the
report's record count), value (one aggregate cell: `value` names a
declared measure, `at` pins dimensions to the type-aware `now` token
or a literal - month(x) -> current YYYYMM, year(x) -> current year,
date -> today, resolved client-side), or list (first `limit` rows as
a mini table). ReportIntentGenerator resolves authored expressions to
the report's own column aliases and emits a `widget` block on the
.report - no SQL and no URLs in the block; the runtime is the
existing generated report controller (GET/POST /count, POST /search
with typed conditions), fetched by the shared reports store
(loadWidgetValue: apiBase derived from the discovered page path via a
sanitizeJavaIdentifier mirror; 403 hides the tile for role-guarded
reports).
- top-level widgets:: the custom escape hatch. kind kpi is a number
tile fed by a developer REST endpoint returning {value, description?}
(the value may be a display string); kind page embeds an HTML page
like a report preview tile. The kind implies how the same-origin url
is consumed - no separate source-type field. Baked onto the .model
root by EdmIntentGenerator.
- editor-report: a Dashboard Widget panel (enable, kind, label/icon,
value-measure picker over the aggregate columns, at-pin table over
the grouping columns, list limit) plus Description and a dashboard
checkbox in General - hand-authored .report widgets for classic
projects.
Declared widgets flip the .model root dashboardKpis flag: the Harmonia
shell template bakes the entity tile list empty (no widgets -> today's
dashboard unchanged), and a widget-bearing report loses its preview
tile. Report and widget labels are translated end-to-end: the Harmonia
report-file template gains a translate source emitting the
<Name>-report catalog (report tId, columns, widget label), custom
widget labels ride the model catalog, and the sidebar/dashboard/
breadcrumb read them via the store's displayLabel/widgetLabel.
Covered by IntentParserTest/ReportIntentGeneratorTest/
EdmIntentGeneratorTest and IntentEngineIT
(report_widget_generates_the_kpi_block_and_replaces_entity_tiles);
verified live end-to-end (count/value/list values, custom KPI endpoint,
catalogs, entity-tile suppression and fallback). Samples and docs
follow in dirigiblelabs/sample-intent-model#5,
dirigiblelabs/sample-intent-multi-model#10 and
dirigible-io/dirigible-io.github.io#135 (merge after this).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3b4f1c9 to
fd39c06
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Meaningful dashboard tiles instead of raw per-entity record counts, in three layers:
reports[].widget— KPI tiles backed by reportskind: count— the report's record count;value— one aggregate cell (atpins dimensions via the existing typed-conditions filter;nowresolves client-side:month(x)→ current YYYYMM,year(x)→ current year, date → today);list— the firstlimitrows as a mini table.ReportIntentGeneratorresolves authored expressions to the report's own column aliases into awidgetblock on the.report; the runtime is the existing generated report controller, fetched by the shared reports store (loadWidgetValue; 403 hides the tile for role-guarded reports).Top-level
widgets:— the custom escape hatchkind: kpiis a number tile fed by a developer REST endpoint returning{value, description?}(value may be a display string like"99.9%");kind: pageembeds an HTML page like a report preview tile. The kind implies how the same-originurlis consumed — no separate source-type field.Report Editor (Web IDE)
A new Dashboard Widget panel (enable, kind, label/icon, value-measure picker over the aggregate columns,
at-pin table over the grouping columns, list limit) plus Description and Show on the home dashboard in General — hand-authored.reportwidgets for classic projects.Semantics & i18n
Declared widgets flip the
.modelrootdashboardKpisflag: the Harmonia shell bakes the entity tile list empty (no widgets → today's dashboard byte-identical), and a widget-bearing report loses its preview tile. Report + widget labels are translated end-to-end (new report-template translate source →<Name>-reportcatalogs; custom labels ride the model catalog; sidebar/dashboard/breadcrumb read them viadisplayLabel/widgetLabel).Testing
Unit:
IntentParserTest(10 widget cases),ReportIntentGeneratorTest,EdmIntentGeneratorTest. Integration:IntentEngineIT#report_widget_generates_the_kpi_block_and_replaces_entity_tiles(+ extended fixture). Verified live end-to-end on a demo project: count/value/list values over the generated controllers, the custom KPI endpoint, catalogs, entity-tile suppression and the no-widgets fallback.Follow-ups (merge after this PR; inert on older parsers)
🤖 Generated with Claude Code