# Widget Manifest Report

## Scope

Sprint 8 introduced a generic widget manifest and data-source engine for the runtime homepage path. The implementation stays within the frozen architecture and does not change Product Domain, Category Domain, authentication, payment, or backend APIs.

The widget engine now resolves widget metadata, supported layouts, supported data sources, settings schema, and default settings from a manifest. Widgets receive only the section config and resolved data.

## Implemented Changes

### Widget Manifest

- `src/app/widgets/contracts/widget-manifest.contract.ts`
- `src/app/widgets/registry/widget-manifest.service.ts`
- `src/assets/mock/bootstrap/widget-manifest.json`

Added widget metadata for:

- Hero
- Categories
- ProductCollection
- Banner
- Html
- Partners
- Footer

Each widget definition now exposes:

- supported layouts
- supported data sources
- settings schema
- default settings

### Data Source Resolver

- `src/app/widgets/resolvers/data-source-resolver.service.ts`

Added a generic resolver that delegates to the existing facades:

- `CategoryFacade` for root and parent category data
- `ProductFacade` for featured, latest, category, manual, and related product data

Supported data source modes include:

- ProductCollection: `featured`, `latest`, `category`, `manual`, `related`, `future`
- Categories: `root`, `parent`, `manual`, `future`

### Widget Rendering

- `src/app/dynamic-renderer/widget-host/widget-host.service.ts`
- `src/app/layouts/containers/dynamic-page-layout.component.ts`
- `src/app/widgets/ui/hero-widget.component.ts`
- `src/app/widgets/ui/categories-widget.component.ts`
- `src/app/widgets/ui/product-carousel-widget.component.ts`
- `src/app/widgets/ui/footer-navigation-widget.component.ts`

Widgets now receive section config plus resolved data only. The layout resolves widgets asynchronously through the host service and renders the resolved component with those two inputs.

### Homepage Bootstrap

- `src/assets/mock/bootstrap/bootstrap.json`
- `src/assets/mock/bootstrap/homepage.json`
- `src/app/pages/home/home.component.ts`
- `src/app/pages/home/home.component.html`

The homepage now resolves from the runtime section collection and includes:

- Hero
- Categories
- ProductCollection

## Validation

Completed checks:

- Existing homepage still renders.
- ProductCollection works through the data-source resolver.
- Categories work through the data-source resolver.
- Widget metadata exists in the manifest.
- Data-source resolution is isolated from widget components.
- Build passes.

Build validation:

```bash
npm run build
```

## Stop Point

Sprint 8 widget-manifest and data-source-engine work is complete. Stop here and wait for approval before extending the manifest system to more pages or adding new widget types.
