Clean up CCC accessible interactive links and external links
## Problem/motivation Follow-up to: #3586258+s Parent: #3586298+s **2. Accessible Interactive Links And External Links** **Priority:** High **Why group these together:** These are all link-rendering issues. Fixing them together allows one consistent pattern for render-array links, new-tab warnings, and link styling. Includes: - List-builder revisions operation cacheable access result. - Revision UI boolean access checks. ## Solution ### 2.1 Replace interactive links embedded in `#markup` **Files:** - `src/Form/AiContextAgentForm.php` - `src/Form/AiContextAgentsForm.php` - `src/Plugin/AiContextScope/AiContextScopeBase.php` - `ai_context.module` **Problem:** Several links are stringified with `toString()` or rendered in isolation and then embedded inside `#markup`. That bypasses Drupal's normal link render-array handling and makes cacheability and accessibility harder to reason about. **Recommended fix:** - Use `Link::toRenderable()`, `#type => 'link'`, or nested render arrays. - Keep `#markup` only for inert text or wrapper markup. - Where links are inline with text, use render arrays plus `#prefix` / `#suffix`, or a small theme/template if necessary. ### 2.2 Add accessible warnings for external new-tab links **Files:** - `templates/ai-context-overview.html.twig` - `src/Plugin/AiContextScope/AiContextScopeBase.php` - any debug/explore links opened with `target="_blank"` **Problem:** Several links open in a new tab/window without an accessible warning. The overview page also lacks `rel="noopener noreferrer"` on external new-tab links. **Recommended fix:** - Add visually hidden text such as “(opens in a new tab)” to link text. - Add `rel="noopener noreferrer"` for external links using `target="_blank"`. - Apply the same pattern to generated manage/debug/explore links. ### 2.3 Revisit CSS-only external-link indicators and inline-link styling **Files:** - `css/ai_context_overview.css` - `css/ai_context.css` **Problem:** External-link icons are generated with CSS and are not announced by assistive technology. `.ai-context-inline-link` suppresses underlines, which can make links rely on color alone. **Recommended fix:** - Treat CSS icons as visual decoration only, with accessible text in the link. - Restore persistent underline styling or verify a compliant non-color cue. - Check hover/focus-visible states while making link changes. --- ## AI usage - [x] AI assisted issue
issue