# Discovery: Tag-like Badges (060-tag-badge-catalog)

**Purpose**: Inventory current *tag-like* (non-status) badge usage and observed values before migrating to the centralized `TagBadgeCatalog`.

**Hard rule reminder**: Status-like badges (health/workflow/severity/risk/availability) remain governed by `BadgeCatalog` / `BadgeRenderer` (Feature 059). This discovery focuses on tag-like metadata only.

## Scope scanned (initial)

- `app/Filament/**` (Resources / RelationManagers / Pages / Widgets)
- `app/Livewire/**`
- `resources/views/filament/**`

## Canonical tag domains (v1)

- **Policy Type** (`policy_type`)
  - Examples (from config): `deviceConfiguration`, `settingsCatalogPolicy`, `groupPolicyConfiguration`, `deviceCompliancePolicy`
- **Policy Category** (`category`)
  - Examples (from config): `Configuration`, `Compliance`, `Update Management`, `Apps/MAM`
- **Platform** (`platform`)
  - Examples observed/expected: `windows`, `android`, `iOS`, `macOS`, `all`, `mobile`
- **Tenant Environment** (`environment`)
  - Examples: `prod`, `staging`, `dev`, (fallback: other)
- **Backup Schedule Frequency** (`frequency`)
  - Examples: `daily`, `weekly`

## File/line hit list (pre-migration snapshot)

### Policies (list)

- `app/Filament/Resources/PolicyResource.php:243` — `policy_type` badge (tag-like)
- `app/Filament/Resources/PolicyResource.php:250` — `category` badge (tag-like, derived from policy type meta)
- `app/Filament/Resources/PolicyResource.php:260` — `platform` badge (tag-like)

### Policy Versions (list + relation manager)

- `app/Filament/Resources/PolicyVersionResource.php:180` — `policy_type` badge (tag-like)
- `app/Filament/Resources/PolicyVersionResource.php:181` — `platform` badge (tag-like)
- `app/Filament/Resources/PolicyResource/RelationManagers/VersionsRelationManager.php:27` — `policy_type` badge (tag-like)

### Inventory Items (list + detail)

- `app/Filament/Resources/InventoryItemResource.php:146` — `policy_type` badge (tag-like)
- `app/Filament/Resources/InventoryItemResource.php:150` — `category` badge (tag-like)
- `app/Filament/Resources/InventoryItemResource.php:152` — `platform` badge (tag-like)

### Tenants (list)

- `app/Filament/Resources/TenantResource.php:129` — `environment` badge (tag-like, currently treated with status-like colors)

### Backups (tables / pickers)

- `app/Filament/Resources/BackupSetResource/RelationManagers/BackupItemsRelationManager.php:53` — `policy_type` badge (tag-like)
- `app/Filament/Resources/BackupSetResource/RelationManagers/BackupItemsRelationManager.php:76` — `platform` badge (tag-like)
- `app/Livewire/BackupSetPolicyPickerTable.php:83` — `policy_type` badge (tag-like)
- `app/Livewire/BackupSetPolicyPickerTable.php:87` — `platform` badge (tag-like)
- `app/Filament/Resources/BackupScheduleResource.php:187` — `frequency` badge (tag-like, currently treated with status-like colors)

### Policy detail (Blade)

- `resources/views/filament/infolists/entries/policy-general.blade.php:176` — list badge color varies by whether the field is “platform” (`info`) or not (`gray`)

## Top inconsistencies (pre-migration)

- Environment tags in Tenants list are using status-like palette (`danger`/`warning`), which reads as health severity rather than metadata.
- Backup schedule frequency tags are using `success`/`warning`, which reads like health/progress.
- Platform labels are not consistently canonicalized (mixture of `macOS` / `macos` / `iOS` / `ios` possible across sources).
- Several tag badges rely on default Filament color (or ad-hoc formatting) instead of a central catalog.

## Post-migration checklist (to be completed)

- [X] All listed tag badges render via `TagBadgeCatalog` / `TagBadgeRenderer`
- [X] Tag badges use only `gray|primary|info`
- [X] Platform labels display as “Windows / Android / iOS / macOS / All”
- [X] Tenants environment badge no longer uses `danger|warning|success`
- [X] Backup schedule frequency badge no longer uses `success|warning`
