Add full view layout for context item canonical and revision pages based on new design
## Problem/motivation Follow-up to: #3586141 ### Summary Replace the default field-list entity view at `/admin/ai/context/items/{id}` with a designed **full** view mode: two-column layout (main content + sidebar), scope/subcontext details, and subcontext navigation. The same layout is used on revision view routes. ### Design and walkthrough There is a new design for the context view page based on UX review and feedback. ![Screenshot_2026-05-08_at_17-15-37_Drupal_AI_CCC_Context_Item_-_Single_Item_v2](/uploads/8117854975bfb3e69f39e0d19a198ca6/Screenshot_2026-05-08_at_17-15-37_Drupal_AI_CCC_Context_Item_-_Single_Item_v2.png){width=872 height=600} ![CCC-single-context-item](/uploads/e6abc408e5e91aa7c50c9443e1e78029/CCC-single-context-item.mp4){width=900 height=563} ### Problem The canonical context item page rendered the default entity view display — a plain field list that was hard to scan and did not surface scope, subcontext hierarchy, or editorial metadata in a useful way. Revision pages had the same limitation and did not show historically accurate subcontext siblings. ### Solution #### Full view mode and template - Add `full` view mode and `core.entity_view_display.ai_context_item.default.full` (description, purpose, content, content moderation control). - Switch canonical route to `_entity_view: ai_context_item.full`. - Render revision pages with the `full` view mode. - Add `ai-context-item--full.html.twig` (two-column layout) and `css/ai_context_item.css`. - Add Phosphor scope icons under `icons/scope/`. #### `AiContextItemViewBuilder` service New `ai_context.item_view_builder` service builds sidebar/header variables for the **full** view mode only: - **Main column:** field formatters from the full view display; H1 on canonical route only. - **Status badge:** published / draft / unpublished / archived (including “Published (Draft available)” with Content Moderation). - **Details panel:** last updated, author (with avatar initial), subcontext type, scope rows with icons. Global-only items show “Global: Enabled”. Mixed scope shows global as “Disabled” when other scopes are set. Empty state: “No scope plugins are in use”. Site-section custom patterns listed individually; entity bundle labels collapse when redundant (e.g. Page: Page → Page). - **Nav panel:** subcontext sibling links with current-item highlight. Shown when the item or its parent has children. Preprocess moves into `AiContextThemeHooks` (autowired). Cache metadata bubbles onto the render array. #### Revision-aware subcontext navigation Extend `AiContextChildrenService` with `loadChildrenForParentAtTime()` (and `@database` DI) so revision view Nav lists siblings that existed at the viewed revision timestamp, not the live child list. #### Access and moderation fixes - Allow users with entity edit permission to reach the edit form even when Content Moderation reports no valid transitions from the current state (transitions can still be enforced on the form). - Fix listing-page and canonical Nav sibling access checks. - Respect context item view permissions for sidebar Nav links. #### Other improvements - Markdown formatter update for table rendering in content field. - Handle disabled scope plugins and empty author on view page. - `hook_update_10007()` adds full view mode/display on existing sites. - Drupal 11.3 deprecation fix; lint/test pipeline alignment. ### Testing - Functional: `AiContextItemViewTest`, `AiContextItemViewTitleTest`, list/scope diff updates. - Kernel: `AiContextItemViewKernelTest`, `AiContextItemViewPreprocessCacheTest`, `AiContextItemFullViewDisplayTest`, `AiContextChildrenServiceTest` (historical children), moderation/access tests. - Unit: `MarkdownRendererTest`, scope local task deriver updates. ### Documentation - `docs/features/context_items.md` — canonical view page section (layout, Details, Nav, hidden fields). - `docs/developers/services.md` — `ai_context.item_view_builder` and updated `ai_context.children_service`. ### Upgrade notes Sites updating from earlier `1.0.x` releases should run `drush updatedb` (installs `ai_context_update_10007`) and `drush cr` after deploying. The `ai_context.children_service` definition requires `@database`; rebuild the container if PHP and `ai_context.services.yml` are deployed separately. ## Tasks - [X] Add new design comp above - [X] Double check design issue for anything missing - [X] Update code - [ ] Review code - [ ] Manually test
issue