Skip to content

fix(admin): resolve uninformative skeleton loading state for screen readers in AppsUsageCard#39952

Open
thekishandev wants to merge 1 commit intoRocketChat:developfrom
thekishandev:chore/fix-apps-usage-skeleton-a11y-39951
Open

fix(admin): resolve uninformative skeleton loading state for screen readers in AppsUsageCard#39952
thekishandev wants to merge 1 commit intoRocketChat:developfrom
thekishandev:chore/fix-apps-usage-skeleton-a11y-39951

Conversation

@thekishandev
Copy link
Copy Markdown

@thekishandev thekishandev commented Mar 29, 2026

Proposed changes

Implements WAI-ARIA loading semantics to the AppsUsageCard fallback skeleton and cleans up an outstanding A11y technical debt marker.

Root Cause / Problem

During initialization of the app limits, the loading <Skeleton> was strictly rendering as role='presentation'. This caused screen readers to completely skip the loading state, resulting in a confusing UI silence for visually impaired users. This was correctly flagged via // FIXME: not accessible enough.

// BEFORE
// FIXME: not accessible enough
return (
	<FeatureUsageCard card={{ title: t('Apps') }}>
		<FeatureUsageCardBody justifyContent='flex-start'>
			<Skeleton variant='rect' width='x112' height='x224' role='presentation' />
		</FeatureUsageCardBody>
	</FeatureUsageCard>
);

Solution / Behavior

Assigned robust aria-busy={true} and a localized aria-label={t('Loading')} to the layout wrapper. This properly announces the initialization transition state to screen readers without modifying the visual layout. The obsolete // FIXME has been cleared.

// AFTER
return (
	<FeatureUsageCard card={{ title: t('Apps') }}>
		<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-label={t('Loading')}>
			<Skeleton variant='rect' width='x112' height='x224' role='presentation' />
		</FeatureUsageCardBody>
	</FeatureUsageCard>
);

Issue(s)

Closes #39951

Validation & Testing

Run yarn lint locally (0 errors)
No side-effects introduced (pure ARIA attributes added)

Type of change

bug fix (resolving a bug via ARIA implementation)

Summary by CodeRabbit

  • Bug Fixes
    • Improved accessibility for the Apps Usage interface with better loading state indicators for assistive technologies.

@thekishandev thekishandev requested a review from a team as a code owner March 29, 2026 18:53
Copilot AI review requested due to automatic review settings March 29, 2026 18:53
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Mar 29, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 29, 2026

⚠️ No Changeset found

Latest commit: dccd823

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 29, 2026

Walkthrough

The pull request addresses an accessibility issue in the AppsUsageCard component by adding ARIA attributes (aria-busy={true} and aria-label) to the loading state to make it perceivable to screen readers, and removes an associated FIXME comment.

Changes

Cohort / File(s) Summary
AppsUsageCard Accessibility Enhancement
apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx
Removed "not accessible enough" FIXME comment and added aria-busy={true} and aria-label={t('Loading')} to the FeatureUsageCardBody component to provide screen reader feedback during the loading state for app usage metrics.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding WAI-ARIA semantics to fix the screen reader accessibility issue with the loading skeleton in AppsUsageCard.
Linked Issues check ✅ Passed The pull request successfully implements all coding requirements: adds aria-busy={true} and aria-label={t('Loading')} to improve loading state accessibility [#39951], and removes the FIXME comment [#39951].
Out of Scope Changes check ✅ Passed All changes are scoped to addressing the accessibility issue in AppsUsageCard. No unrelated modifications to other files or features are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds accessible loading semantics to the AppsUsageCard skeleton fallback so screen readers can perceive the loading state, and removes the stale A11y FIXME.

Changes:

  • Removes the // FIXME: not accessible enough marker from AppsUsageCard loading branch
  • Adds aria-busy and a localized aria-label to the loading-state wrapper around the skeleton

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +29 to 31
<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-label={t('Loading')}>
<Skeleton variant='rect' width='x112' height='x224' role='presentation' />
</FeatureUsageCardBody>
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FeatureUsageCardBody currently only accepts { justifyContent, children } (see apps/meteor/client/views/admin/subscription/components/FeatureUsageCardBody.tsx:4-12) and does not forward arbitrary props. Passing aria-busy / aria-label here will cause a TypeScript props error and the attributes won’t reach the DOM. Consider extending FeatureUsageCardBodyProps to include standard DOM/Box props (or a dedicated aria* subset) and spreading them onto the underlying Box/CardBody so these ARIA attributes are actually applied.

Suggested change
<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-label={t('Loading')}>
<Skeleton variant='rect' width='x112' height='x224' role='presentation' />
</FeatureUsageCardBody>
<div aria-busy={true} aria-label={t('Loading')}>
<FeatureUsageCardBody justifyContent='flex-start'>
<Skeleton variant='rect' width='x112' height='x224' role='presentation' />
</FeatureUsageCardBody>
</div>

Copilot uses AI. Check for mistakes.
return (
<FeatureUsageCard card={{ title: t('Apps') }}>
<FeatureUsageCardBody justifyContent='flex-start'>
<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-label={t('Loading')}>
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using aria-busy plus aria-label on the container may still not get announced as a loading transition, because aria-busy does not itself create a live region and aria-label typically won’t be read unless the element is navigated to. Elsewhere in the client, loading regions pair aria-busy with aria-live/aria-atomic (e.g. navbar/NavBarSearch/NavBarSearchListbox.tsx:52-55, views/root/PageLoading.tsx:4). Consider adding an appropriate live region (aria-live='polite' + aria-atomic='true', or role='status') and/or exposing a short “Loading” text node (can be visually hidden) so screen readers reliably announce the state change.

Suggested change
<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-label={t('Loading')}>
<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-live='polite' aria-atomic='true'>
{t('Loading')}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx`:
- Around line 29-31: The ARIA attributes passed into AppsUsageCard are being
dropped because FeatureUsageCardBody only accepts justifyContent and children
and does not forward extra props; fix by either (A) updating
FeatureUsageCardBody to accept props like ({ justifyContent, children, ...rest
}) and spread {...rest} onto its root element so aria-busy and aria-label
propagate, or (B) update AppsUsageCard to wrap the Skeleton in a wrapper element
(e.g., a Box/div) and apply aria-busy and aria-label to that wrapper instead of
passing them into FeatureUsageCardBody; reference the FeatureUsageCardBody and
AppsUsageCard components and the aria-busy / aria-label attributes when making
the change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57c56419-387a-4fed-9838-52552e8ab755

📥 Commits

Reviewing files that changed from the base of the PR and between 4235cd9 and dccd823.

📒 Files selected for processing (1)
  • apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: cubic · AI code reviewer
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx
🧠 Learnings (4)
📓 Common learnings
Learnt from: aleksandernsilva
Repo: RocketChat/Rocket.Chat PR: 36974
File: apps/meteor/client/components/Omnichannel/OutboundMessage/components/OutboundMessageWizard/forms/MessageForm/MessageForm.tsx:124-129
Timestamp: 2025-09-18T17:32:33.969Z
Learning: The ARIA mismatch issue in MessageForm's template field (where FieldError id used templateId instead of messageFormId) was addressed in PR `#36972` through refactoring the template field into a separate TemplateField component, which uses consistent templateFieldId for both aria-describedby and FieldError id.
📚 Learning: 2026-01-17T01:51:47.764Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38219
File: packages/core-typings/src/cloud/Announcement.ts:5-6
Timestamp: 2026-01-17T01:51:47.764Z
Learning: In packages/core-typings/src/cloud/Announcement.ts, the AnnouncementSchema.createdBy field intentionally overrides IBannerSchema.createdBy (object with _id and optional username) with a string enum ['cloud', 'system'] to match existing runtime behavior. This is documented as technical debt with a FIXME comment at apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts:53 and should not be flagged as an error until the runtime behavior is corrected.

Applied to files:

  • apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx
📚 Learning: 2025-10-06T20:32:23.658Z
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37152
File: packages/apps-engine/tests/test-data/utilities.ts:557-573
Timestamp: 2025-10-06T20:32:23.658Z
Learning: In packages/apps-engine/tests/test-data/utilities.ts, the field name `isSubscripbedViaBundle` in the `IMarketplaceSubscriptionInfo` type should not be flagged as a typo, as it may match the upstream API's field name.

Applied to files:

  • apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx
📚 Learning: 2026-03-27T14:52:56.865Z
Learnt from: dougfabris
Repo: RocketChat/Rocket.Chat PR: 39892
File: apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx:150-155
Timestamp: 2026-03-27T14:52:56.865Z
Learning: In Rocket.Chat, there are two different `ModalBackdrop` components with different prop APIs. During review, confirm the import source: (1) `rocket.chat/fuselage` `ModalBackdrop` uses `ModalBackdropProps` based on `BoxProps` (so it supports `onClick` and other Box/DOM props) and does not have an `onDismiss` prop; (2) `rocket.chat/ui-client` `ModalBackdrop` uses a narrower props interface like `{ children?: ReactNode; onDismiss?: () => void }` and handles Escape keypress and outside mouse-up, and it does not forward arbitrary DOM props such as `onClick`. Flag mismatched props (e.g., `onDismiss` passed to the fuselage component or `onClick` passed to the ui-client component) and ensure the usage matches the correct component being imported.

Applied to files:

  • apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx

Comment on lines +29 to 31
<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-label={t('Loading')}>
<Skeleton variant='rect' width='x112' height='x224' role='presentation' />
</FeatureUsageCardBody>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

ARIA attributes are silently ignored and will not reach the DOM.

Based on the FeatureUsageCardBody implementation (see FeatureUsageCardBody.tsx:1-14), the component only accepts justifyContent and children props. It does not use a spread operator to forward additional attributes. The aria-busy and aria-label props passed here will be silently discarded, and the accessibility fix will have no effect.

Either update FeatureUsageCardBody to accept and forward ARIA props, or apply the attributes to a wrapper element directly in this file.

Option 1: Modify FeatureUsageCardBody to forward props

In FeatureUsageCardBody.tsx:

 import { Box, CardBody } from '@rocket.chat/fuselage';
-import type { ReactNode } from 'react';
+import type { ComponentProps, ReactNode } from 'react';

-type FeatureUsageCardBodyProps = { justifyContent?: 'flex-start' | 'center'; children: ReactNode };
+type FeatureUsageCardBodyProps = { justifyContent?: 'flex-start' | 'center'; children: ReactNode } & Omit<ComponentProps<typeof Box>, 'justifyContent' | 'children'>;

-const FeatureUsageCardBody = ({ justifyContent = 'center', children }: FeatureUsageCardBodyProps) => (
+const FeatureUsageCardBody = ({ justifyContent = 'center', children, ...props }: FeatureUsageCardBodyProps) => (
 	<CardBody>
-		<Box h='full' w='full' display='flex' alignItems='center' justifyContent={justifyContent} flexDirection='column'>
+		<Box h='full' w='full' display='flex' alignItems='center' justifyContent={justifyContent} flexDirection='column' {...props}>
 			{children}
 		</Box>
 	</CardBody>
 );
Option 2: Use a wrapper Box directly in AppsUsageCard
+import { Box, Skeleton } from '@rocket.chat/fuselage';
-import { Skeleton } from '@rocket.chat/fuselage';
 ...
 	if (!privateAppsLimit || !marketplaceAppsLimit) {
 		return (
 			<FeatureUsageCard card={{ title: t('Apps') }}>
-				<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-label={t('Loading')}>
-					<Skeleton variant='rect' width='x112' height='x224' role='presentation' />
-				</FeatureUsageCardBody>
+				<FeatureUsageCardBody justifyContent='flex-start'>
+					<Box aria-busy={true} aria-label={t('Loading')}>
+						<Skeleton variant='rect' width='x112' height='x224' role='presentation' />
+					</Box>
+				</FeatureUsageCardBody>
 			</FeatureUsageCard>
 		);
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx`
around lines 29 - 31, The ARIA attributes passed into AppsUsageCard are being
dropped because FeatureUsageCardBody only accepts justifyContent and children
and does not forward extra props; fix by either (A) updating
FeatureUsageCardBody to accept props like ({ justifyContent, children, ...rest
}) and spread {...rest} onto its root element so aria-busy and aria-label
propagate, or (B) update AppsUsageCard to wrap the Skeleton in a wrapper element
(e.g., a Box/div) and apply aria-busy and aria-label to that wrapper instead of
passing them into FeatureUsageCardBody; reference the FeatureUsageCardBody and
AppsUsageCard components and the aria-busy / aria-label attributes when making
the change.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx">

<violation number="1" location="apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx:29">
P1: `FeatureUsageCardBody` only destructures `{ justifyContent, children }` and does not spread remaining props onto the underlying DOM element (see `FeatureUsageCardBody.tsx:4-12`). The `aria-busy` and `aria-label` attributes passed here will be silently dropped and never reach the DOM, making the entire accessibility fix ineffective. Either extend `FeatureUsageCardBody` to forward arbitrary props, or wrap the component in a `<div>` that carries the ARIA attributes.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

return (
<FeatureUsageCard card={{ title: t('Apps') }}>
<FeatureUsageCardBody justifyContent='flex-start'>
<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-label={t('Loading')}>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: FeatureUsageCardBody only destructures { justifyContent, children } and does not spread remaining props onto the underlying DOM element (see FeatureUsageCardBody.tsx:4-12). The aria-busy and aria-label attributes passed here will be silently dropped and never reach the DOM, making the entire accessibility fix ineffective. Either extend FeatureUsageCardBody to forward arbitrary props, or wrap the component in a <div> that carries the ARIA attributes.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/views/admin/subscription/components/cards/AppsUsageCard/AppsUsageCard.tsx, line 29:

<comment>`FeatureUsageCardBody` only destructures `{ justifyContent, children }` and does not spread remaining props onto the underlying DOM element (see `FeatureUsageCardBody.tsx:4-12`). The `aria-busy` and `aria-label` attributes passed here will be silently dropped and never reach the DOM, making the entire accessibility fix ineffective. Either extend `FeatureUsageCardBody` to forward arbitrary props, or wrap the component in a `<div>` that carries the ARIA attributes.</comment>

<file context>
@@ -24,10 +24,9 @@ const AppsUsageCard = ({ privateAppsLimit, marketplaceAppsLimit }: AppsUsageCard
 		return (
 			<FeatureUsageCard card={{ title: t('Apps') }}>
-				<FeatureUsageCardBody justifyContent='flex-start'>
+				<FeatureUsageCardBody justifyContent='flex-start' aria-busy={true} aria-label={t('Loading')}>
 					<Skeleton variant='rect' width='x112' height='x224' role='presentation' />
 				</FeatureUsageCardBody>
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(admin): resolve uninformative skeleton loading state for screen readers in AppsUsageCard

2 participants