Align context item full view with bundle-less entity
Follow-up to: #3586220 once this is merged: ##3584775 --- ## Follow-up: Remove `ai_context_item` bundle (`ai_context_item_type`) Here’s a **view-branch-only** follow-up list for whoever lands bundle removal. Everything else in the module is their problem; this is what **this MR** introduced that still assumes a bundle. --- ## After bundle removal — reconcile with view MR (`3586220`) ### Must update (behavior/config) 1. **`hook_theme_suggestions_ai_context_item()`** (`ai_context.module`, chunk 10) Remove the two bundle lines: ```php $suggestions[] = 'ai_context_item__' . $entity->bundle(); $suggestions[] = 'ai_context_item__' . $entity->bundle() . '__' . $sanitized_view_mode; ``` Keep only the view-mode suggestion (`ai_context_item__full`). No other view/template changes needed. 2. **Full view display config** (chunk 2) - Install: `config/install/core.entity_view_display.ai_context_item.default.full.yml` - Rename to bundle-less ID (e.g. `ai_context_item.full`), drop `bundle: default` and `ai_context_item_type` dependency. - Same field visibility/components as today (description, purpose, content, moderation; hide label, parent, scope, etc.). 3. **`ai_context_update_10007()`** (`ai_context.install`) - Today creates `ai_context_item.default.full` with `'bundle' => 'default'`. - Update to match new display ID/shape, or add a new update that migrates `ai_context_item.default.full` → `ai_context_item.full` on existing sites that ran 10007. ### Must update (tests added in this MR) 4. **`AiContextItemFullViewDisplayTest`** — assert new display ID (`ai_context_item.full` not `*.default.full`); drop `installEntitySchema('ai_context_item_type')` if bundle entity is gone. 5. **View test fixtures** — remove `'type' => 'default'` and `installEntitySchema('ai_context_item_type')` where only needed for bundle: - `AiContextItemViewTest` - `AiContextItemViewPageChromeTest` - `AiContextItemViewKernelTest` - `AiContextItemViewPreprocessCacheTest` ### No change expected (already bundle-agnostic) - `AiContextItemViewBuilder` / `ai_context.item_view_builder` - `templates/ai-context-item--full.html.twig` and base `ai-context-item.html.twig` - Canonical route `_entity_view: 'ai_context_item.full'` and `revisionShow(..., 'full')` - View-mode gating in preprocess (`#view_mode === 'full'`) - `hook_theme()` entries `ai_context_item` / `ai_context_item__full` - Functional assertions (`.ai-context-item-entity`, nav, scope sidebar, etc.) ### Docs (light touch) 6. **`docs/features/context_items.md`** — only if it still says `default.full` or bundle display IDs; template names (`--full`) stay as-is. 7. **`docs/developers/hooks.md`** — if chunk 10 docs mention bundle suggestions, trim to view-mode only. --- ## Merge order note | Order | Action | |-------|--------| | **View MR first** | Bundle MR owns items 1–5 above as part of their change. | | **Bundle MR first** | Small follow-up on view branch (or main): drop theme suggestion bundle lines + align tests with new display ID. | --- **One-line for the bundle ticket:** *“Reconcile view MR: migrate `ai_context_item.default.full` display + `10007`, remove bundle theme suggestions, update five view tests.”* ## AI usage - [x] AI assisted issue - [ ] AI generated code
issue