Skip to content

New: Add support for Tooltip API and Navigation Button API (fix #128)#129

Open
swashbuck wants to merge 2 commits intomasterfrom
issue/128
Open

New: Add support for Tooltip API and Navigation Button API (fix #128)#129
swashbuck wants to merge 2 commits intomasterfrom
issue/128

Conversation

@swashbuck
Copy link
Copy Markdown
Contributor

@swashbuck swashbuck commented Apr 2, 2026

Fix #128

New

  • Add navigation button label and tooltip support

Testing

  • See course.json config in the updated example.json

@swashbuck swashbuck self-assigned this Apr 2, 2026
@swashbuck swashbuck changed the title New: Add nav button label and tooltip support (fix #128) New: Add support for Tooltip API and Navigation Button API (fix #128) Apr 2, 2026
@oliverfoster
Copy link
Copy Markdown
Member

oliverfoster commented Apr 14, 2026

Could you nest the config one deeper? course.json:_devtools._navButton.ariaLabel rather than course.json:_devtools.ariaLabel.
As it's a subpart of devtools.

_navButton / _nav, something like that?

"_globals": {
"type": "object",
"default": {},
"properties": {
"_extensions": {
"type": "object",
"default": {},
"properties": {
"_devtools": {
"type": "object",
"title": "Dev Tools",
"default": {},
"properties": {
"ariaLabel": {
"type": "string",
"title": "Navigation button aria label",
"default": "Developer tools",
"_adapt": {
"translatable": true
}
},

Copy link
Copy Markdown
Contributor

@kirsty-hames kirsty-hames left a comment

Choose a reason for hiding this comment

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

Works as expected thanks @swashbuck 👍

@kirsty-hames
Copy link
Copy Markdown
Contributor

Could you nest the config one deeper? course.json:_devtools._navButton.ariaLabel rather than course.json:_devtools.ariaLabel. As it's a subpart of devtools.

_navButton / _nav, something like that?

"_globals": {
"type": "object",
"default": {},
"properties": {
"_extensions": {
"type": "object",
"default": {},
"properties": {
"_devtools": {
"type": "object",
"title": "Dev Tools",
"default": {},
"properties": {
"ariaLabel": {
"type": "string",
"title": "Navigation button aria label",
"default": "Developer tools",
"_adapt": {
"translatable": true
}
},

Good point. Annoyingly we haven't defined a consistent approach to how we've defined nav button aria labels (when comparing against pageLevelProgress, Visua11y and roleBasedContent each has a different approach). Instead would replacing _devtools.ariaLabel with _devtools.navAriaLabel be efficient to keep all nav button properties at the same level?

@oliverfoster
Copy link
Copy Markdown
Member

oliverfoster commented Apr 14, 2026

You'd have to do _showLabel as well. It's probably easier just to nest them and keep the names as they are in NavigationButton API as these are just passthrough properties for a self-contained bit of behaviour.

@swashbuck
Copy link
Copy Markdown
Contributor Author

Thanks, both. I've nested the properties under _navButton in 2d63b1b. Kept _navTooltip as it was. Let me know if this works and I can update ToC.

@oliverfoster
Copy link
Copy Markdown
Member

Remember that we have migration scripts now if you want to harmonise these things.

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.

Add support for Tooltip API and Navigation Button API

3 participants