Skip to content

Updated Axel to 0.4.0 to drop screen-reader text from labels and keep 'form_id' stable across AJAX redraws. - #378

Merged
AlexSkrypnyk merged 3 commits into
developfrom
feature/axel-0.4.0
Nov 16, 2026
Merged

AlexSkrypnyk merged 3 commits into
developfrom
feature/axel-0.4.0

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Analytics now uses the latest Axel version, improving how form interactions are tracked across AJAX updates.
    • Analytics can identify visually hidden text and use the title of icon-only links as their link text.
  • Documentation
    • Updated analytics guidance to describe form ID tracking, hidden-text handling, and link text behavior.

@AlexSkrypnyk AlexSkrypnyk added A1 Board worker 1 AUTOMERGE Pull request has been approved and set to automerge labels Nov 16, 2026
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change upgrades Axel to version 0.4.0 and configures form ID and hidden-text settings. It adds documentation and automated checks for stable form IDs across AJAX redraws and for footer social-link analytics.

Changes: Axel analytics

Layer / File(s) Summary
Axel version and policy
web/modules/custom/do_analytics/do_analytics.libraries.yml, config/default/csp.settings.yml, docs/analytics.md
The Axel library, CSP allowlist, and documentation now specify version 0.4.0. The library integrity hash is updated.
Form identity and text settings
web/modules/custom/do_analytics/src/AnalyticsAttributes.php, web/modules/custom/do_analytics/src/Hook/FormAlterHook.php, web/modules/custom/do_analytics/src/Hook/PageAttachmentsHook.php, web/modules/custom/do_analytics/tests/src/Unit/Hook/FormAlterHookTest.php, web/modules/custom/do_analytics/tests/src/Unit/Hook/PageAttachmentsHookTest.php, docs/analytics.md
Forms receive data-axel-form-id with the Drupal form ID. Axel settings include that attribute and id as form ID sources, plus hidden-text selectors. Unit tests and documentation cover these settings.
Analytics event checks
tests/behat/bootstrap/FeatureContext.php, tests/behat/features/analytics_events.feature, docs/analytics.md
Behat checks verify footer social-link event data and a shared form_id across form validation redraw events. The documentation states that icon-only links use their title as link_text.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

  • drevops/website#367: Adds the do_analytics module and Axel attributes that this change extends.
  • drevops/website#373: Updates the Axel version and addresses form redraw behavior in the same integration.
  • drevops/website#368: Changes contact-form Axel attributes for an AJAX submission flow.
Merge Risk: Minimal · up to 1c842

This change upgrades the analytics library and keeps the form ID stable when a form is redrawn by AJAX. It also adds documentation and tests. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the two main changes: the Axel upgrade to 0.4.0, the removal of screen-reader text from labels via hiddenTextSelector, and keeping form_id stable across AJAX redraws via data-axel-form…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: the Axel upgrade to 0.4.0, the removal of screen-reader text from labels via hiddenTextSelector, and keeping form_id stable across AJAX redraws via data-axel-form-id. The changeset matches all three points. The title is long (107 characters, 17 words), which reduces readability, but it is accurate and specific.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Team
  • Run ID: 324eb1fd-ce29-4171-9131-dc85c977aaae
Commits

Reviewing files that changed from the base of the PR and between 019516a and 1c8428e.

Files selected for processing: 10

  • config/default/csp.settings.yml
  • docs/analytics.md
  • tests/behat/bootstrap/FeatureContext.php
  • tests/behat/features/analytics_events.feature
  • web/modules/custom/do_analytics/do_analytics.libraries.yml
  • web/modules/custom/do_analytics/src/AnalyticsAttributes.php
  • web/modules/custom/do_analytics/src/Hook/FormAlterHook.php
  • web/modules/custom/do_analytics/src/Hook/PageAttachmentsHook.php
  • web/modules/custom/do_analytics/tests/src/Unit/Hook/FormAlterHookTest.php
  • web/modules/custom/do_analytics/tests/src/Unit/Hook/PageAttachmentsHookTest.php

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 80%)

  Classes: 63.16% (24/38)
  Methods: 83.33% (120/144)
  Lines:   90.06% (979/1087)
Per-class coverage
Drupal\do_ai_alt_text\AltTextGenerator
  Methods:  85.71% ( 6/ 7)   Lines:  98.72% ( 77/ 78)
Drupal\do_ai_alt_text\Plugin\Action\RegenerateImageAltText
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 63/ 63)
Drupal\do_analytics\AnalyticsAttributes
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 29/ 29)
Drupal\do_analytics\Hook\FormAlterHook
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  4/  4)
Drupal\do_analytics\Hook\PageAttachmentsHook
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 15/ 15)
Drupal\do_analytics\Hook\PreprocessHook
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 36/ 36)
Drupal\do_base\EventSubscriber\PreviewLinkCacheSubscriber
  Methods:  33.33% ( 1/ 3)   Lines:  11.11% (  1/  9)
Drupal\do_base\EventSubscriber\ThemeColorSubscriber
  Methods:  66.67% ( 2/ 3)   Lines:  40.00% (  4/ 10)
Drupal\do_base\Hook\AutomatedListPagerHook
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 31/ 31)
Drupal\do_base\Hook\LibraryInfoAlterHook
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 12/ 12)
Drupal\do_base\Hook\MetatagsAlterHook
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 58/ 58)
Drupal\do_base\Hook\PageAttachmentsHook
  Methods:  87.50% ( 7/ 8)   Lines:  96.61% ( 57/ 59)
Drupal\do_base\Hook\SvgMediaHook
  Methods:  75.00% ( 3/ 4)   Lines:  96.15% ( 25/ 26)
Drupal\do_base\Hook\TwigValidatorRuleInfoAlterHook
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
Drupal\do_base\NavigationScriptHash
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 27/ 27)
Drupal\do_base\SvgDimensions
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% ( 13/ 13)
Drupal\do_base\Twig\IconAssetsExtension
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  3/  3)
Drupal\do_base\Twig\ImageDimensionsExtension
  Methods:  60.00% ( 3/ 5)   Lines:  93.02% ( 40/ 43)
Drupal\do_content_api\EventSubscriber\JsonApiWriteGateSubscriber
  Methods:  66.67% ( 2/ 3)   Lines:  88.89% (  8/  9)
Drupal\do_content_api\Hook\EntityCreateAccessHook
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 12/ 12)
Drupal\do_content_api\Hook\ModerationPolicyHook
  Methods:  50.00% ( 1/ 2)   Lines:  93.75% ( 15/ 16)
Drupal\do_content_api\Routing\RouteSubscriber
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 11/ 11)
Drupal\do_feed\FeedUrlBuilder
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 18/ 18)
Drupal\do_feed\Form\FeedSettingsForm
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 15/ 15)
Drupal\do_feed\Hook\EntityDeleteHook
  Methods:  50.00% ( 1/ 2)   Lines:  92.31% ( 12/ 13)
Drupal\do_feed\Hook\EntityPresaveHook
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 54/ 54)
Drupal\do_feed\Hook\PreprocessParagraphHook
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 14/ 14)
Drupal\do_feed\Hook\PreprocessViewsViewRowRssHook
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
Drupal\do_feed\Hook\ViewsPreViewHook
  Methods:  50.00% ( 1/ 2)   Lines:  96.43% ( 27/ 28)
Drupal\do_generated_content\Generator\CaseMatrix
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 12/ 12)
Drupal\do_generated_content\Generator\RelativeDate
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
Drupal\do_package\Hook\PackageAccessHook
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 27/ 27)
Drupal\do_package\Hook\PackageFileHook
  Methods: 100.00% (11/11)   Lines: 100.00% ( 40/ 40)
Drupal\do_package\Routing\RouteSubscriber
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  5/  5)

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.12%. Comparing base (019516a) to head (1c8428e).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #378      +/-   ##
===========================================
+ Coverage    88.08%   88.12%   +0.04%     
===========================================
  Files           39       39              
  Lines          873      876       +3     
===========================================
+ Hits           769      772       +3     
  Misses         104      104              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexSkrypnyk
AlexSkrypnyk merged commit cc4f5e2 into develop Nov 16, 2026
16 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/axel-0.4.0 branch November 16, 2026 11:40

This branch was successfully deployed

1 active deployment
PR-378 — 1c8428e3 Deployed Nov 16, 2026 by AlexSkrypnyk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A1 Board worker 1 AUTOMERGE Pull request has been approved and set to automerge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant