Skip to content

feat(harmonia): read-only Preview route, detail panels on the edit form, report printing#6131

Merged
delchev merged 2 commits into
masterfrom
feat/harmonia-preview-readonly
Jul 3, 2026
Merged

feat(harmonia): read-only Preview route, detail panels on the edit form, report printing#6131
delchev merged 2 commits into
masterfrom
feat/harmonia-preview-readonly

Conversation

@delchev

@delchev delchev commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Three additions to the Harmonia runtime UI (generated templates + the shared shell runtime), verified by rendering every touched template through Velocity with a synthetic model context and node --check-ing the generated JS.

1. Read-only Preview route

Every record page gains /Entity/{id}/preview next to /Entity/{id}/edit - the same data as edit, fully read-only:

  • Routes registered for MANAGE, SETTING, MASTER, DOCUMENT and DETAIL entities. The shared application shell needs no change: it mirrors the embedded app's inner route generically, so #/app/<perspective>/<Entity>/{id}/preview (e.g. /services/web/application/#/app/sales-invoices-SalesInvoice/SalesInvoice/1/preview) works out of the box, as does the standalone SPA.
  • The form and document pages gain a preview mode (parsed from the live hash; loads like edit; save()/item dialogs guarded). A display: contents <fieldset :disabled="isPreview"> disables every control in one place; selects additionally get :data-disabled so dropdowns cannot open.
  • The footer swaps Cancel/Save for Close + Edit; BPM task buttons, item Add/Edit/Delete, allocation Add/Delete and FK Add-new/Refresh are hidden. The document Print button stays available (printing is read-only).
  • Preview entry points: manage list details pane + row menu, master details toolbar + row menu, detail-panel row menus (detailPanel.previewRow).

2. Detail panels on the edit form (bug fix)

In dirigiblelabs/sample-intent-model, a Member's Loans table showed only on the browse view's details pane - the Edit view rendered just the scalar fields. The shared form view now renders the master's registered detail collections (App.detailsFor) as the same generic panels below the form on edit and preview, outside the <form> element (so panel buttons cannot submit it), with add/edit routing back to the same page via a returnTo override and read-only rendering in preview.

3. Print on the generated report pages

  • report-file page (.report artefacts - the intent reports: surface): Print fetches the FULL filtered result set (POST /export, honoring the active per-column filters) and renders a minimal print document (title, row count + filtered marker + timestamp, bordered table, numeric columns right-aligned and pattern-formatted).
  • Model report table page: same, with column metadata emitted from the model.
  • Model report chart page: prints a PNG snapshot of the chart canvas.

Also fixes a latent generation bug found while verifying: report-file/report.js.template contained a literal '##0' display pattern - ## starts a mid-line Velocity comment, so every generated report.js was truncated into a JS syntax error at that line. The pattern is now emitted through a #set reference (string literals inside directives are safe from comment parsing).

Verification

All 16 touched/affected templates rendered through Velocity 2.4.1 with a synthetic context covering both branches of every conditional (dropdown + dependsOn + lookupColumns, float, date, audit, document number/status, all entity layout types); all 8 generated JS files pass node --check (the pre-existing report.js failure reproduced and is fixed here); detailPanel.js checked directly; both Maven modules build.

Regenerate an app (or re-publish the templates) to pick the changes up - generated copies in existing workspaces keep the old markup until regenerated.

🤖 Generated with Claude Code

delchev and others added 2 commits July 3, 2026 19:10
… edit form

Preview - /Entity/{id}/preview renders the same data as edit, fully read-only:
- routes registered for MANAGE, SETTING, MASTER, DOCUMENT and DETAIL entities;
  the shared shell needs no change (it mirrors the embedded app's inner route
  generically, so #/app/<perspective>/<Entity>/{id}/preview just works)
- form + document pages gain mode 'preview' (parsed from the live hash; loads
  like edit, save/dialog paths guarded); a display:contents <fieldset
  :disabled="isPreview"> disables every control at once; selects also get
  :data-disabled so the dropdowns cannot open; footer swaps Cancel/Save for
  Close + Edit; BPM task buttons, item Add/Edit/Delete, allocation Add/Delete
  and FK Add-new/Refresh are hidden; the document Print button stays (printing
  is read-only)
- Preview entry points: manage list details pane + row menu, master details
  toolbar + row menu, detail-panel row menu (detailPanel.previewRow)

Detail panels on the edit form (bug fix): a master's detail collections (e.g.
Member -> Loans in sample-intent-model) rendered ONLY on the browse view's
details pane - the edit view showed just the scalar fields. The form view now
renders the same generic detail panels below the form on edit/preview
(App.detailsFor registry), outside the <form> so panel buttons cannot submit
it, with add/edit returning to the same page (returnTo override) and read-only
rendering in preview.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- report-file page (.report artefacts, the intent reports: surface): Print
  button next to Export - fetches the FULL filtered result set (POST /export,
  same as the CSV export, honoring the active per-column filters) and renders
  it into a minimal print document in a new window (title, row count +
  filtered marker + timestamp, bordered table, numeric columns right-aligned
  and pattern-formatted)
- model report table page: same Print, with column labels/alignment/format
  emitted from the report model (printColumns)
- model report chart page: Print snapshots the chart canvas as a PNG into the
  print document (printing the live canvas would clip it to the viewport)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@delchev delchev force-pushed the feat/harmonia-preview-readonly branch from 72455f2 to 9766f29 Compare July 3, 2026 16:12
@delchev delchev merged commit a7a4b81 into master Jul 3, 2026
10 of 11 checks passed
@delchev delchev deleted the feat/harmonia-preview-readonly branch July 3, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant