Skip to content

Conversation

@lbjunq
Copy link

@lbjunq lbjunq commented Jul 30, 2025

✅ Multiple Profiles - Members Suggestion Dropdown
Description

As a user, on the BaseApp Profile,I would like to I want to add new members to my organization, In order to have thse members help in the organizations activites.

Test: When the user accesses the profile page, they see the form with profile fields, avatar, and banner sections.

Expected Outcome:

The form fields (name, username, phone number, and bio) and buttons (upload, remove, save changes) are displayed.

Test: The user uploads a new avatar image, and it appears in the preview.

Expected Outcome:

The uploaded avatar is displayed in the preview, and the "Remove" button is enabled.

Test: The user clicks "Remove" to clear the avatar image.

Expected Outcome:

The avatar image is removed, and the default placeholder is displayed.

Test: The user uploads a new banner image, and it appears in the preview.

Expected Outcome:

The uploaded banner is displayed in the preview, and the "Remove" button is enabled.

Test: The user enters invalid data in the form and sees validation errors.

Expected Outcome:

The user sees error messages under the invalid fields.

Test: The user clicks "Save Changes," and the form is submitted successfully.

Expected Outcome:

The form data is saved, and the user sees a success toast.

Summary by CodeRabbit

  • New Features
    • Improved accessibility in profile settings and avatars by adding descriptive alt text and aria-labels for avatar/banner actions.
  • Tests
    • Added comprehensive end-to-end tests for profile settings covering render, validation, text updates, avatar/banner upload & removal, plus test utilities and mock data.
  • Style
    • Minor whitespace cleanup with no functional impact.

@changeset-bot
Copy link

changeset-bot bot commented Jul 30, 2025

⚠️ No Changeset found

Latest commit: 83f4849

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

coderabbitai bot commented Jul 30, 2025

Walkthrough

Added accessibility attributes (alt, aria-label) and forwarded alt through avatar components; introduced Cypress tests, test mocks, and a testing wrapper for ProfileSettings; one whitespace-only edit in FileUploadButton. No business logic or control-flow changes.

Changes

Cohort / File(s) Summary of modifications
Avatar accessibility props
packages/design-system/components/web/avatars/AvatarWithPlaceholder/index.tsx, packages/design-system/components/web/avatars/CircledAvatar/index.tsx
Added alt prop to component props and passed it to the underlying avatar element(s). No logic changes.
ProfileSettings accessibility
packages/components/modules/profiles/web/ProfileSettingsComponent/index.tsx
Added alt to CircledAvatar usage and aria-label attributes to Remove Avatar/Banner buttons. No logic changes.
ProfileSettings tests & test utils
packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/ProfileSettings.cy.tsx, packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/__mocks__/requests.ts, packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/__utils__/ProfileSettingsForTesting/index.tsx
Added Cypress E2E test suite, GraphQL-like mock responses for profile scenarios, and a Relay-backed ProfileSettingsForTesting wrapper exported with test providers.
Whitespace-only edit
packages/design-system/components/web/buttons/FileUploadButton/index.tsx
Inserted a blank line after a destructuring assignment; no runtime/API change.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

needs review

Suggested reviewers

  • deboracosilveira
  • joaosoutto
  • tsl-ps2

Poem

I nibbled code by moonlight's glow,
Gave avatars names so screen readers know.
Tests hop in, mocks all set,
Buttons labelled — no regret.
A tiny fix, a brighter show. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9d72e38 and 83f4849.

📒 Files selected for processing (1)
  • packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/ProfileSettings.cy.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/components/modules/profiles/web/ProfileSettingsComponent/tests/ProfileSettings.cy.tsx
⏰ 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). (3)
  • GitHub Check: Component Test Packages
  • GitHub Check: Unit Test Packages
  • GitHub Check: Build and Lint Packages
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/BA-2628-add-aria-label-and-alt-text-to-profile-images-and-inputs-for-tests-component-identification

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea0e291 and caa09c9.

📒 Files selected for processing (5)
  • packages/components/modules/profiles/web/ProfileSettingsComponent/index.tsx (5 hunks)
  • packages/design-system/components/web/avatars/AvatarWithPlaceholder/index.tsx (1 hunks)
  • packages/design-system/components/web/avatars/CircledAvatar/index.tsx (1 hunks)
  • packages/design-system/components/web/buttons/FileUploadButton/index.tsx (2 hunks)
  • packages/design-system/components/web/buttons/FileUploadButton/types.ts (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
packages/design-system/components/web/avatars/CircledAvatar/index.tsx (1)

Learnt from: davidbermudez-tsl
PR: #209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.

packages/design-system/components/web/avatars/AvatarWithPlaceholder/index.tsx (1)

Learnt from: davidbermudez-tsl
PR: #209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.

packages/design-system/components/web/buttons/FileUploadButton/types.ts (1)

Learnt from: davidbermudez-tsl
PR: #209
File: packages/components/modules/content-feed/web/ContentFeed/types.ts:1-1
Timestamp: 2025-04-09T22:06:40.026Z
Learning: The empty ContentFeedProps interface in packages/components/modules/content-feed/web/ContentFeed/types.ts will be populated with properties in a future PR rather than being converted to a type alias.

🧬 Code Graph Analysis (1)
packages/design-system/components/web/buttons/FileUploadButton/types.ts (1)
packages/utils/types/form.ts (1)
  • ControlProps (5-8)
🪛 GitHub Check: Build and Lint Packages
packages/design-system/components/web/buttons/FileUploadButton/types.ts

[failure] 3-3:
'InputProps' is defined but never used. Allowed unused vars must match /^_/u

🪛 GitHub Actions: Main Workflow
packages/design-system/components/web/buttons/FileUploadButton/types.ts

[error] 3-3: ESLint: 'InputProps' is defined but never used. Allowed unused vars must match /^_/u (@typescript-eslint/no-unused-vars)

⏰ 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: Analyze (javascript)
🔇 Additional comments (5)
packages/design-system/components/web/avatars/CircledAvatar/index.tsx (1)

14-14: LGTM! Clean accessibility enhancement.

The addition of the alt prop and its proper forwarding to the AvatarWithPlaceholder component is a clean accessibility improvement. The implementation correctly follows React patterns for prop passing.

Also applies to: 22-22

packages/design-system/components/web/buttons/FileUploadButton/index.tsx (1)

15-15: LGTM! Proper accessibility implementation.

The extraction and forwarding of the aria-label attribute to the hidden file input is correctly implemented. This enhancement will improve screen reader support for file upload functionality.

Also applies to: 52-52

packages/design-system/components/web/avatars/AvatarWithPlaceholder/index.tsx (1)

11-11: LGTM! Consistent accessibility prop forwarding.

The addition of the alt prop and its forwarding to AvatarStyled maintains consistency with the accessibility improvements across the avatar component chain. The implementation is clean and correct.

Also applies to: 14-14

packages/design-system/components/web/buttons/FileUploadButton/types.ts (1)

24-26: LGTM! Proper type extension for accessibility.

The addition of the optional 'aria-label' property to FileUploadButtonProps correctly supports the accessibility enhancements in the component implementation.

packages/components/modules/profiles/web/ProfileSettingsComponent/index.tsx (1)

153-153: Excellent accessibility improvements!

The addition of descriptive alt and aria-label attributes across avatar, banner, and button elements significantly improves screen reader support. The labels are appropriately descriptive and follow accessibility best practices.

Also applies to: 169-169, 178-178, 249-249, 259-259

@mathieubouhelier mathieubouhelier requested review from mathieubouhelier and removed request for mathieubouhelier August 1, 2025 09:26
Copy link

@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: 4

🧹 Nitpick comments (5)
packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/__mocks__/requests.ts (4)

5-5: Align mock IDs with the test query’s hardcoded node id

The test query fetches node(id: "test-id"), but mocks use "profile-123". Not harmful with a permissive test env, yet aligning avoids confusion and future brittleness if resolvers validate IDs.

Apply this diff:

-      id: 'profile-123',
+      id: 'test-id',
@@
-      id: `profile-123`,
+      id: 'test-id',
@@
-      id: `profile-123`,
+      id: 'test-id',
@@
-      id: `profile-123`,
+      id: 'test-id',
@@
-      id: `profile-123`,
+      id: 'test-id',
@@
-      id: `profile-123`,
+      id: 'test-id',
@@
-      id: 'profile-123',
+      id: 'test-id',

Also applies to: 30-30, 59-59, 88-88, 118-118, 147-147, 175-175


64-66: Prefer hermetic/local image URLs to avoid external flakiness

Hardcoding external CDN URLs in mocks can introduce intermittent failures (network hiccups, CORS). Since tests only need the URL string, prefer localhost or data: URLs.

Example diff for local URLs:

-        url: 'https://nyc3.digitaloceanspaces.com/baseapp-production-storage/media/user-avatars/5/6/4/resized/50/50/185a04dfdaa512d218cf9b7a5097e3c9.png',
+        url: 'http://localhost:8000/media/mock/avatar.png',
@@
-        url: 'https://nyc3.digitaloceanspaces.com/baseapp-production-storage/media/user-avatars/5/6/4/resized/50/50/185a04dfdaa512d218cf9b7a5097e3c9.png',
+        url: 'http://localhost:8000/media/mock/banner.png',
@@
-        url: 'http://localhost:8000/media/profile_images/5dfe5729-1730-4fe6-b22a-a0f15f65a754.png.96x96_q85.png',
+        url: 'http://localhost:8000/media/mock/avatar.png',
-        url: 'http://localhost:8000/media/banner_images/test-banner.png',
+        url: 'http://localhost:8000/media/mock/banner.png',

Also applies to: 125-127, 180-184


1-24: Reduce duplication with a small builder to improve maintainability

The seven mocks share a large common shape with small diffs. A builder/helper would reduce noise and ease future changes (e.g., add/remove fields).

Example:

const baseProfile = {
  __typename: 'Profile' as const,
  id: 'test-id',
  status: 'ACTIVE',
  name: 'John Doe',
  biography: 'John Doe is a software engineer at Google.',
  image: null as { url: string | null } | null,
  bannerImage: null as { url: string | null } | null,
  isFollowedByMe: false,
  followersCount: 0,
  followingCount: 0,
  canChange: true,
  urlPath: { path: '/johndoes' },
  owner: { phoneNumber: '+15551234567' },
  isBlockedByMe: false,
}

const makeData = (overrides: Partial<typeof baseProfile>) => ({ data: { target: { ...baseProfile, ...overrides } } })
export const profileSettingsMockData = makeData({})
export const profileSettingsTextUpdateData = makeData({
  name: 'Jane Smith',
  biography: 'Jane Smith is a software engineer at Microsoft.',
  image: { url: null },
  bannerImage: { url: null },
  urlPath: { path: '/janesmith' },
  owner: { phoneNumber: '+11234567890' },
})
// ...and so on for other variants

Also applies to: 26-53, 55-82, 84-111, 113-140, 142-169, 171-198


8-8: Nit: avoid referencing real companies in test bios

Not a blocker, but consider neutral placeholders (e.g., “ACME Corp”) to avoid unnecessary real-world references in public code.

Also applies to: 33-33, 62-62, 91-91, 120-120, 149-149, 178-178

packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/ProfileSettings.cy.tsx (1)

23-35: Stabilize selectors for file inputs and fallback images

The current selectors depend on DOM structure (button parent -> input[type="file"]) and a broad img, [title="Avatar Fallback"]. Introduce data-testid or more specific roles to reduce flakiness.

Example:

  • Add data-testid="avatar-file-input" and data-testid="banner-file-input" to the underlying inputs and use cy.findByTestId(...).
  • Use cy.findByRole('img', { name: /avatar image/i }) for images if roles are present.

Also applies to: 39-47

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these settings in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 12bf388 and 71b1488.

⛔ Files ignored due to path filters (1)
  • packages/components/cypress/fixtures/tsl-logo.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/ProfileSettings.cy.tsx (1 hunks)
  • packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/__mocks__/requests.ts (1 hunks)
  • packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/__utils__/ProfileSettingsForTesting/index.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/ProfileSettings.cy.tsx (1)
packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/__mocks__/requests.ts (6)
  • profileSettingsMockData (1-24)
  • profileSettingsTextUpdateData (26-53)
  • profileSettingsImageUpdateData (55-82)
  • profileSettingsImageRemoveData (84-111)
  • profileSettingsBannerUpdateData (113-140)
  • profileSettingsBannerRemoveData (142-169)
packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/__utils__/ProfileSettingsForTesting/index.tsx (1)
packages/components/modules/profiles/web/ProfileSettingsComponent/types.ts (1)
  • ProfileSettingsComponentProps (3-5)
⏰ 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). (2)
  • GitHub Check: Component Test Packages
  • GitHub Check: Build and Lint Packages
🔇 Additional comments (4)
packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/__utils__/ProfileSettingsForTesting/index.tsx (1)

10-19: LGTM: minimal test-only query using @relay_test_operation

The test query/setup is clean and focused for the test harness.

packages/components/modules/profiles/web/ProfileSettingsComponent/__tests__/ProfileSettings.cy.tsx (3)

7-14: Remove unused import to satisfy lint rules

mockDataWithBanner is imported but not used in this file.

Apply this diff:

 import {
-  mockDataWithBanner,
   profileSettingsBannerRemoveData,
   profileSettingsBannerUpdateData,
   profileSettingsImageRemoveData,
   profileSettingsImageUpdateData,
   profileSettingsMockData,
   profileSettingsTextUpdateData,
 } from './__mocks__/requests'

50-75: Great coverage and realistic flows

Solid end-to-end coverage for render, validation, text updates, and image workflows. The test environment/wiring via queueOperationResolver and resolveMostRecentOperation looks robust.

Also applies to: 77-100, 102-133, 135-175, 177-215


3-3: Heads-up: Next internal import path can be brittle

next/dist/shared/lib/app-router-context.shared-runtime is an internal path and can change across Next versions. If you hit issues in future Next upgrades, revisit this import.

@sonarqubecloud
Copy link

@lbjunq lbjunq merged commit 2969e72 into master Aug 21, 2025
8 checks passed
@lbjunq lbjunq deleted the feature/BA-2628-add-aria-label-and-alt-text-to-profile-images-and-inputs-for-tests-component-identification branch August 21, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants