Skip to content

Conversation

@kirsty-hames
Copy link
Contributor

Fixes #214

Update

  • Optional titleAriaLabel override provided to be read out by screen readers, instead of title for the menu item button ARIA label. To be used when title contains punctuation or html syntax that shouldn't be read. If titleAriaLabel isn't set, then title is used to label the menu item button as default.

Note, as per the issue comment, I'd initially suggested naming the override property altTitle for consistency with the alternative title created for question feedback. However contentObject altTitle is already supported to provide an on screen alternative title for PLP. As the two use cases would require separate titles, I decided to create an separate property for aria-label only.

Example use case

title: Being ‘on-spec’ (on screen text)
titleAriaLabel: Being on spec (aria-label text with no punctuation, spelt as should be read)

Copy link
Contributor

Choose a reason for hiding this comment

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

👀

Copy link
Contributor

@swashbuck swashbuck left a comment

Choose a reason for hiding this comment

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

👍

@kirsty-hames Looks good! Will need an update to the Box Menu migration scripts. I think that would be a separate ticket since we don't know what the exact release version would be?

@kirsty-hames
Copy link
Contributor Author

👍

@kirsty-hames Looks good! Will need an update to the Box Menu migration scripts. I think that would be a separate ticket since we don't know what the exact release version would be?

Hi @joe-allen-89, do we have a defined practice for any PRs that require migration scripts?

@oliverfoster
Copy link
Member

oliverfoster commented May 12, 2025

👍

@kirsty-hames Looks good! Will need an update to the Box Menu migration scripts. I think that would be a separate ticket since we don't know what the exact release version would be?

That's a terrifying (and probably true) comment.

@joe-allen-89
Copy link
Contributor

@kirsty-hames I'm currently looking at github actions to see if there's a way we can automatically raise an issue on the repo if the schema has been updated. Agree with what Brad said, as we don't really know the release version it would be better to have it as a seperate issue/PR (I think)

@oliverfoster
Copy link
Member

This sounds problematic. Example:

The schema changes are released on 1.0.0. The automation changes are added to 1.0.1 (or to master without release). When someone installs 1.0.0, the schema will change, but the automation tasks won't exist in that version.

@joe-allen-89
Copy link
Contributor

This sounds problematic. Example:

The schema changes are released on 1.0.0. The automation changes are added to 1.0.1 (or to master without release). When someone installs 1.0.0, the schema will change, but the automation tasks won't exist in that version.

The other option is validation to prevent release if the schema has been updated but migration script hasn't, but will absolutely every schema change require a migration script? Possibly not.

And still leaves us with having to come in and manually update the migration script as we release to ensure the versions are correct though. Hmm, bit more thought needed on that.

@kirsty-hames
Copy link
Contributor Author

The other option is validation to prevent release if the schema has been updated but migration script hasn't, but will absolutely every schema change require a migration script? Possibly not.

That's a good point. I'm assuming instances where a new property is added that is either optional or a default value is provided, wouldn't require a migration script? If that's the case, do we need to add a migration script here as titleAriaLabel is an optional property?

For PRs that do require a migration script, could this be handled within the same PR but we have two review phases? For example,
1 - 3 reviews for the PR work
2 - migration script added to PR
3 - 3 more reviews required to review the migration script

return boxMenus.length;
});

mutateContent('Box menu - add titleAriaLabel to contentObjects', async (content) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is working. Going to take a look.

Copy link
Contributor

@swashbuck swashbuck Oct 10, 2025

Choose a reason for hiding this comment

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

@kirsty-hames I think the issue is that the properties and migration scripts assume the new titleAriaLabel property to be part of the _boxMenu object on a content object. However, in the example.json and README.md, the property sits alongside displayTitle and body at the root of the content object.

Which way should this work? For instance, are the schemas correct or are the examples correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good spot @swashbuck! I had intended for property to sit alongside displayTitle and body however seeing as this is an optional property and not a common use case, perhaps it would be best part of the _boxMenu object not to clutter up content object?

Copy link
Contributor

Choose a reason for hiding this comment

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

@kirsty-hames Sure, having it part of the _boxMenu object makes sense to me. Can you make that change, and I'll test out the migration scripts again?

@swashbuck swashbuck self-requested a review October 10, 2025 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

Provide option for alternative menu item title text

7 participants