Skip to content

Conversation

@elenagarrone
Copy link
Contributor

Description

This PR:

  • Removes the placeholder from the date-field component. The component now includes a hard-coded hint indicating the required date format.
  • Removes the placeholder from the sort-code directive. Updates the documentation to instruct users to add the appropriate hint, following the provided example.
  • Updates remaining instances of *ngIf and *ngFor in certain specs and stories that were causing issues with story functionality.

These changes will be categorised as breaking changes as they require manual intervention.
The resolve an issue with the placeholders not following the design patterns and mainly not passing a11y.

Fixes #1642

Checklist:

  • The commit messages follow the convention for this project
  • I have provided an adequate amount of test coverage
  • I have added the functionality to the test app
  • I have provided a story in storybook to document the changes
  • I have added the documentation
  • I have added any new public feature modules to public-api.ts

@elenagarrone elenagarrone requested a review from a team as a code owner December 11, 2025 12:43
Copilot AI review requested due to automatic review settings December 11, 2025 12:43
Copy link

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

This PR removes placeholders from the date-field and sort-code components for accessibility compliance and migrates numerous templates from Angular's legacy *ngIf/*ngFor directive syntax to the new @if/@for control flow syntax.

Key changes:

  • Date-field component now uses a hardcoded hint ("For example, 27 12 1977") instead of accepting custom hints via content projection
  • Sort-code directive no longer provides a placeholder; developers must add the hint "Must be 6 digits long, for example 00-00-00"
  • Comprehensive migration to Angular's new control flow syntax across ~20 files including stories, specs, and documentation

Reviewed changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
projects/canopy/src/lib/forms/date/date-field.component.ts Changed hint from ContentChild to ViewChild; refactored ariaDescribedBy handling in ngAfterViewInit
projects/canopy/src/lib/forms/date/date-field.component.html Removed placeholders from input fields; added hardcoded lg-hint component
projects/canopy/src/lib/forms/date/date-field.component.spec.ts Updated tests to handle auto-generated hint IDs
projects/canopy/src/lib/forms/date/docs/date-field.stories.ts Removed hint input parameter from story component
projects/canopy/src/lib/forms/date/docs/guide.mdx Updated documentation to remove custom hint examples and use @if syntax
projects/canopy/src/lib/forms/sort-code/sort-code.directive.ts Removed placeholder HostBinding
projects/canopy/src/lib/forms/sort-code/sort-code.directive.spec.ts Removed placeholder test
projects/canopy/src/lib/forms/sort-code/docs/sort-code.stories.ts Changed to hardcoded hint in template; disabled inputmode argType
projects/canopy/src/lib/forms/sort-code/docs/guide.mdx Updated documentation to instruct users to add the specific hint
projects/canopy/src/lib/forms/validation/docs/form.stories.ts Removed hint from date-field; updated sort-code hint text
projects/canopy/src/lib/forms/validation/docs/guide.mdx Migrated validation examples to @if syntax
projects/canopy/src/lib/tabs/docs/tabs.stories.ts Migrated *ngFor to @for with track expression
projects/canopy/src/lib/tabs/docs/tab-nav-bar.stories.ts Migrated *ngFor to @for; removed NgFor import
projects/canopy/src/lib/table/table/table.component.spec.ts Migrated *ngFor to @for in test template; removed NgFor import
projects/canopy/src/lib/table/docs/table.stories.ts Migrated *ngFor to @for across multiple templates; removed NgFor import
projects/canopy/src/lib/sr-alert-message/docs/guide.mdx Migrated *ngIf example to @if syntax
projects/canopy/src/lib/spinner/docs/spinner.stories.ts Migrated *ngIf example to @if syntax
projects/canopy/src/lib/spacing/padding/docs/padding.stories.ts Migrated multiple *ngIf to @if; removed NgIf import
projects/canopy/src/lib/spacing/margin/docs/margin.stories.ts Migrated multiple *ngIf to @if; removed duplicate decorator and NgIf import
projects/canopy/src/lib/side-nav/docs/side-nav.stories.ts Migrated *ngFor and *ngIf to @for/@if; removed NgFor and NgIf imports
projects/canopy/src/lib/promo-card/docs/promo-card.stories.ts Migrated *ngFor to @for with track expression
projects/canopy/src/lib/page/docs/page.stories.ts Migrated *ngFor to @for in footer templates; removed NgFor and NgIf imports
projects/canopy/src/lib/list/docs/lists.stories.ts Migrated nested *ngFor and *ngIf to @for/@if; removed imports
projects/canopy/src/lib/link-menu/docs/link-menu.stories.ts Migrated *ngFor and *ngIf to @for/@if; removed imports
projects/canopy/src/lib/forms/toggle/docs/checkbox/guide.mdx Migrated *ngIf example to @if syntax
projects/canopy/src/lib/forms/toggle/docs/checkbox/checkbox-group.stories.ts Migrated *ngIf to @if in template
projects/canopy/src/lib/forms/select/docs/select.stories.ts Migrated *ngIf and *ngFor to @if/@for
projects/canopy/src/lib/forms/radio/docs/segment/segment.stories.ts Migrated *ngIf to @if in template
projects/canopy/src/lib/forms/radio/docs/radio/radio.stories.ts Migrated *ngIf to @if in template
projects/canopy/src/lib/forms/input/input-field.component.spec.ts Removed NgIf import; reordered import statements
projects/canopy/src/lib/forms/input/docs/input.stories.ts Migrated multiple *ngIf to @if for conditional rendering of prefix/suffix elements
projects/canopy/src/lib/forms/checkbox-group/checkbox-group.component.spec.ts Removed NgIf import from test imports
projects/canopy/src/lib/footer/docs/footer.stories.ts Migrated *ngFor and *ngIf to @for/@if across multiple templates; removed imports
projects/canopy/src/lib/card/docs/promotions/promotions.stories.ts Migrated *ngIf to @if for conditional brand icon rendering
projects/canopy/src/lib/card/docs/card/card.stories.ts Migrated *ngIf and *ngFor to @if/@for across multiple card templates
projects/canopy/src/lib/accordion/docs/accordion.stories.ts Migrated *ngIf to @if for conditional icon rendering in accordion headings
projects/canopy-test-app/src/app/app.component.html Removed custom hints from date-field; updated sort-code hint text in test app

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

IdaHW
IdaHW previously approved these changes Dec 11, 2025
Copy link
Contributor

@IdaHW IdaHW left a comment

Choose a reason for hiding this comment

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

Looks great!

@github-actions github-actions bot had a problem deploying to github-pages December 15, 2025 13:00 Failure
Copy link

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

Copilot reviewed 37 out of 37 changed files in this pull request and generated 1 comment.


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

BREAKING CHANGE: the placeholder has been removed as it was causing a11y issues.
We have added the hint component instead.
This is added automatically to the codebase.
Any existing hints used within the date field
will not appear anymore.
BREAKING CHANGE: the placeholder has been removed as it was causing a11y issues.
You will need to manually add an `lg-hint` component as per the example in the docs.
@elenagarrone elenagarrone merged commit 06a6566 into Legal-and-General:next Dec 16, 2025
4 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 19.0.0-next.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

deployed The branch is deployed to GitHub Pages released on @next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants