Skip to content

feat(fe-fpm-writer): update page building block for new aggregations#4781

Open
eouin wants to merge 64 commits into
mainfrom
feat/38189/update-page-bb-new-aggregations
Open

feat(fe-fpm-writer): update page building block for new aggregations#4781
eouin wants to merge 64 commits into
mainfrom
feat/38189/update-page-bb-new-aggregations

Conversation

@eouin

@eouin eouin commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

feat(fe-fpm-writer): Update Page Building Block with Full Template & Aggregations Support

New Features

✨ Extended the Page building block with a new templateType option (basic | full). When full is selected, the writer automatically:

  • Appends all 7 canonical aggregation fragments (breadcrumbs, navigationActions, titleContent, actions, headerContent, items, footer) as child elements of the <macros:Page> node
  • Adds showFooter="true" to the page element
  • Copies a controller stub (JS or TS) into the view directory if none exists
  • Sorts aggregation children into canonical order

A new exported function appendPageBBAggregation allows incrementally adding a single aggregation to an existing <macros:Page> element, with automatic ID generation, deduplication, canonical ordering, and template comment handling.

Changes

  • building-block/index.ts: Added appendPageAggregations, sortPageAggregationChildren, appendPageBBAggregation (exported), and applyPageControllerTemplate functions. Exported PAGE_AGGREGATIONS constant and PageAggregationName type. Wired full-template logic into generateBuildingBlock.
  • building-block/types.ts: Added templateType and aggregations fields to the Page interface. Defined PAGE_TEMPLATE_TYPE_FULL, PAGE_TEMPLATE_TYPE_BASIC constants and PageTemplateType type.
  • building-block/prompts/questions/page.ts: Added a templateType list prompt (Basic / Full) as the first question in the Page building block prompts.
  • src/index.ts: Exported PAGE_TEMPLATE_TYPE_FULL, PAGE_TEMPLATE_TYPE_BASIC, PageTemplateType, appendPageBBAggregation, PAGE_AGGREGATIONS, and PageAggregationName.
  • prompts/translations/i18n.ts: Added templateType translations (Page Layout, Basic, Full).
  • templates/building-block/page/View.xml: Conditionally renders showFooter="true" for full template type.
  • templates/building-block/page/Controller.js & Controller.ts: New controller stub templates with event handler skeletons.
  • templates/building-block/page/*.xml (7 new files): EJS templates for each of the 7 page aggregations.
  • test/unit/building-block.test.ts: Added tests for full template generation (aggregations, JS/TS controller detection, basic template exclusion) and appendPageBBAggregation behavior.
  • test/unit/prompts/__snapshots__/prompts.test.ts.snap: Updated snapshots to include the new templateType prompt.
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.22.0

  • Event Trigger: issue_comment.edited
  • Correlation ID: 4db26047-585a-430e-a183-901d3998dc50

eouin added 9 commits May 19, 2026 11:26
…pdate-page-bb-new-aggregations

* 'main' of github.com:SAP/open-ux-tools: (37 commits)
  chore: apply latest changesets
  feat(ui5-test-writer): Generate tests for Actions on the Object Page (#4632)
  chore: apply latest changesets
  fix(deploy-tooling): skip ATO prefix enforcement for on-premise systems (#4687)
  chore: apply latest changesets
  chore: bump used versions in adaptation project for Cloud Foundry (#4685)
  chore: apply latest changesets
  fix: Add margins to panel horizontal borders to distinguish them from splitter borders (#4682)
  chore: apply latest changesets
  fix(ci): upgrade pnpm to 11.1.2 to enable native OIDC trusted publishing (#4689)
  chore: apply latest changesets
  Feat(eslint-fiori-tools-plugin): Add data field in header facet rule check support for cds annotations (#4660)
  chore: apply latest changesets
  feat(odata-service-inquirer): 37088 output tab link (#4612)
  chore: apply latest changesets
  skip test harness files when virtual preview endpoints are enabled #4657 (#4671)
  fix(ci): exchange GitHub OIDC token for npm granular access token before publish (#4686)
  fix(ci): add provenance=true to .npmrc to enable pnpm OIDC trusted publishing (#4684)
  chore: apply latest changesets
  fix(ci): remove registry-url from release job setup-node to fix OIDC publish (#4683)
  ...
@eouin eouin requested a review from a team as a code owner June 5, 2026 14:32
Copilot AI review requested due to automatic review settings June 5, 2026 14:32
@eouin eouin requested a review from a team as a code owner June 5, 2026 14:32
@changeset-bot

changeset-bot Bot commented Jun 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9b1a9f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@sap-ux/fe-fpm-writer Patch
@sap-ux-private/ui-prompting-examples Minor
@sap-ux/fiori-elements-writer Patch
@sap-ux/fe-fpm-cli Patch
@sap-ux/fiori-app-sub-generator Patch
@sap-ux/repo-app-import-sub-generator Patch
@sap-ux/generator-simple-fe Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hyperspace-insights hyperspace-insights Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR introduces a "full" template mode for the Page building block, adding 7 aggregation fragments, a controller template, and a new appendPageBBAggregation API. Several correctness issues were found: the TypeScript detection heuristic in applyPageControllerTemplate relies on a pre-existing .controller.ts file rather than a project-level signal (e.g. tsconfig.json), leading to always generating JS controllers in fresh projects; appendPageBBAggregation assigns the same uniqueId to every child element in the parsed fragment when multiple elements are present; the bare sap.m element names in items.xml (IconTabBar, etc.) will not be namespace-resolved when sap.m uses a prefix rather than the default namespace; and _nsMap is accessed on a potentially-null firstChild without a null guard. Additionally, the aggregations field on Page should be narrowed from Record<string, string> to Partial<Record<PageAggregationName, string>> for compile-time safety.

PR Bot Information

Version: 1.22.0

  • Event Trigger: pull_request.opened
  • LLM: anthropic--claude-4.6-sonnet
  • Agent Instructions:
  • File Content Strategy: Full file content
  • Correlation ID: 49f945b6-39a1-48fd-b928-6d4576925b36

Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts
Comment thread packages/fe-fpm-writer/templates/building-block/page/items.xml
Comment thread packages/fe-fpm-writer/src/building-block/types.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the fe-fpm-writer Page building block to support a new “full” page template option that generates a populated macros:Page with standard aggregations and optional controller stubs, and updates tests/snapshots and prompt translations accordingly.

Changes:

  • Add a templateType prompt for Page building block generation (“Basic” vs “Full”).
  • Implement full Page template generation: insert 7 canonical aggregations (with ordering + IDs) and optionally copy controller stubs.
  • Update unit tests and Jest snapshots to reflect the new prompt and Page generation behavior.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/fe-fpm-writer/test/unit/prompts/snapshots/prompts.test.ts.snap Updates prompt snapshots to include the new Page templateType question.
packages/fe-fpm-writer/test/unit/building-block.test.ts Adds unit tests for full/basic Page template generation, controller creation, and appendPageBBAggregation.
packages/fe-fpm-writer/templates/building-block/page/View.xml Adds showFooter="true" when Page templateType is full.
packages/fe-fpm-writer/templates/building-block/page/titleContent.xml New template fragment for titleContent aggregation.
packages/fe-fpm-writer/templates/building-block/page/navigationActions.xml New template fragment for navigationActions aggregation.
packages/fe-fpm-writer/templates/building-block/page/items.xml New template fragment for items aggregation (sample content).
packages/fe-fpm-writer/templates/building-block/page/headerContent.xml New template fragment for headerContent aggregation.
packages/fe-fpm-writer/templates/building-block/page/footer.xml New template fragment for footer aggregation.
packages/fe-fpm-writer/templates/building-block/page/Controller.ts New TS controller stub template for full Page generation.
packages/fe-fpm-writer/templates/building-block/page/Controller.js New JS controller stub template for full Page generation.
packages/fe-fpm-writer/templates/building-block/page/breadcrumbs.xml New template fragment for breadcrumbs aggregation.
packages/fe-fpm-writer/templates/building-block/page/actions.xml New template fragment for actions aggregation.
packages/fe-fpm-writer/src/prompts/translations/i18n.ts Adds i18n strings for the new Page templateType prompt and choices.
packages/fe-fpm-writer/src/index.ts Exposes new Page-related types/constants and exports new helper APIs.
packages/fe-fpm-writer/src/building-block/types.ts Adds templateType and aggregations to the Page building block type and defines PageTemplateType + constants.
packages/fe-fpm-writer/src/building-block/prompts/questions/page.ts Adds the templateType list prompt for the Page building block.
packages/fe-fpm-writer/src/building-block/index.ts Implements full Page aggregation insertion, ordering, controller template copying, and appendPageBBAggregation helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts
Comment thread packages/fe-fpm-writer/templates/building-block/page/items.xml
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
eouin added 2 commits June 5, 2026 15:59
…pdate-page-bb-new-aggregations

* 'main' of github.com:SAP/open-ux-tools:
  chore: apply latest changesets
  bundle mcp server and replace @xenova/transformers with @huggingface/transformers (#4663)
Comment thread packages/fe-fpm-writer/src/prompts/translations/i18n.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Fixed
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Fixed
Copilot AI review requested due to automatic review settings June 5, 2026 15:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 6 comments.

Comment thread packages/fe-fpm-writer/templates/building-block/page/items.xml
Comment thread packages/fe-fpm-writer/src/building-block/index.ts
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
eouin added 4 commits June 5, 2026 18:23
…pdate-page-bb-new-aggregations

* 'main' of github.com:SAP/open-ux-tools:
  chore: apply latest changesets
  fix(fiori-mcp-server): download ONNX model at runtime to reduce tgz below npm 100 MB limit (#4782)
…pdate-page-bb-new-aggregations

* 'main' of github.com:SAP/open-ux-tools:
  feat(eslint-plugin-fiori-tools): lint flex change files (#4706)
  Converting the ADP int test to ESM (#4764)
  chore(workflows): apply OSPO GitHub hardening controls (OIDC + environments) (#4763)
  chore: apply latest changesets
  fix(fiori-mcp-server): exclude Windows GPU DLLs to reduce tgz below npm publish limit (#4783)
Copilot AI review requested due to automatic review settings June 8, 2026 10:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Comment thread packages/fe-fpm-writer/src/building-block/index.ts
Comment thread packages/fe-fpm-writer/src/building-block/index.ts
eouin added 2 commits June 11, 2026 03:51
…pdate-page-bb-new-aggregations

* 'main' of github.com:SAP/open-ux-tools:
  chore: apply latest changesets
  Fix: CDS multiple service targets in the same file, pointers bug fix (#4796)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated no new comments.

eouin added 3 commits June 11, 2026 12:53
…pdate-page-bb-new-aggregations

* 'main' of github.com:SAP/open-ux-tools:
  chore: apply latest changesets
  fix(telemetry): console.time/timeEnd warning (#4727)
…pdate-page-bb-new-aggregations

* 'main' of github.com:SAP/open-ux-tools: (76 commits)
  chore: apply latest changesets
  fix(preview-middleware): remove LocalStorageConnector only for ADP (#4794)
  chore: apply latest changesets
  feat(preview-middleware): enhance OPA5 pattern for journey collection (#4778)
  chore: apply latest changesets
  Fix(preview-middleware): add min ui5 validation to card generator (#4812)
  chore: apply latest changesets
  Create breezy-doodles-cut.md (#4834)
  chore: apply latest changesets
  fix: (Adaptation Editor) FL Variant changes do not appear in the unsaved changes list (history panel). (#4766)
  fix: Missing info text for existing SAP Fiori launchpad configuration in ADP (#4808)
  chore: apply latest changesets
  fix: Regression in manifest path resolution after recent fix (#4826)
  chore: apply latest changesets
  fix(eslint-plugin-fiori-tools): bundle @babel/* to fix conflicts with ui5-tooling-transpile (#4829)
  Create opa5_docu.md (#4827)
  chore: apply latest changesets
  fix: Feature toggle not read on first generator run after ESM migration (#4816)
  chore: apply latest changesets
  fix(ui5-test-writer): use js for FPM tests (#4825)
  ...
…om:SAP/open-ux-tools into feat/38189/update-page-bb-new-aggregations

* 'feat/38189/update-page-bb-new-aggregations' of github.com:SAP/open-ux-tools: (26 commits)
  fix after comments
  fix after comments
  fix after comments
  fix after comments
  Linting auto fix commit
  fix after comments
  fix after comments
  fix after comments
  Linting auto fix commit
  fix after comments
  fix after comments
  fix after comments
  Linting auto fix commit
  fix after comments
  fix after comments
  Create short-planets-prove.md
  fix after comments
  fix after comments
  fix after comments
  fix after comments
  ...

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.

Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/src/building-block/index.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

@sonarqubecloud

Copy link
Copy Markdown

eouin added 2 commits June 15, 2026 13:53
…om:SAP/open-ux-tools into feat/38189/update-page-bb-new-aggregations

* 'feat/38189/update-page-bb-new-aggregations' of github.com:SAP/open-ux-tools:
  Linting auto fix commit

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.

Comment thread packages/fe-fpm-writer/src/building-block/index.ts
eouin added 2 commits June 15, 2026 14:41
…pdate-page-bb-new-aggregations

* 'main' of github.com:SAP/open-ux-tools:
  chore: improve changeset (#4730)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Comment thread packages/fe-fpm-writer/src/building-block/index.ts
Comment thread packages/fe-fpm-writer/templates/building-block/page/Controller.ts
eouin added 2 commits June 15, 2026 16:17
…pdate-page-bb-new-aggregations

* 'main' of github.com:SAP/open-ux-tools:
  [FIX] ADP gen crashes on Deployment Configuration step - empty destination field (#4839)
  chore: apply latest changesets
  Fix(preview-middleware): adjust readme (#4843)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.

Comment thread packages/fe-fpm-writer/templates/building-block/page/Controller.ts
Comment thread packages/fe-fpm-writer/src/building-block/index.ts Outdated
Comment thread packages/fe-fpm-writer/test/unit/building-block.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Comment thread packages/fe-fpm-writer/src/building-block/index.ts
Comment thread .changeset/short-planets-prove.md Outdated
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.

8 participants