From 21b5ff5f65a38cfdf7113609ec65ad033c16b237 Mon Sep 17 00:00:00 2001 From: Burcu Noyan Date: Fri, 24 Jul 2026 18:20:40 -0400 Subject: [PATCH] Announce Button's disabled links to assistive tech (CS-12305) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Button already styles a hrefless anchor as a disabled link — the CSS has matched a.boxel-button:not([href]), [href=''] and .disabled-link for a while (opacity, disabled colour, pointer-events: none). But the @as='anchor' branch only suppresses the href: no disabled attribute, no aria-disabled. So the state has been visual-only for every caller, and @disabled={{true}} on an anchor produced DOM identical to just omitting @href. role='link' is the part that makes this work. An we've stripped the href from is not a link — it maps to the generic role, where aria-disabled is not supported and browsers drop it. Setting aria-disabled alone would have looked like a fix and changed nothing. Keyed on @disabled only, deliberately never on a falsy @href: callers pass href as a plain attribute through ...attributes (base/skill-plus.gts, base/default-templates/theme-dashboard.gts), where @href is undefined and the link is real. Inferring from @href would have labelled those unavailable. There is a test guarding exactly that. Also adds the first test coverage for Button. Not verified at runtime: the boxel-ui test-app harness fails at boot locally with "window.require is not a function", before any test runs. It does so identically on a clean checkout with an untouched accordion test, and after mise run build:ui, so it is pre-existing and not caused by this change. eslint, ember-template-lint and ember-tsc pass in both the addon and test-app; CI is the real gate for the assertions. Co-Authored-By: Claude Opus 5 --- .../addon/src/components/button/index.gts | 11 +++ .../integration/components/button-test.gts | 95 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 packages/boxel-ui/test-app/tests/integration/components/button-test.gts diff --git a/packages/boxel-ui/addon/src/components/button/index.gts b/packages/boxel-ui/addon/src/components/button/index.gts index db083b4f02..404096929e 100644 --- a/packages/boxel-ui/addon/src/components/button/index.gts +++ b/packages/boxel-ui/addon/src/components/button/index.gts @@ -100,9 +100,20 @@ const ButtonComponent: TemplateOnlyComponent =