Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enh(NcContent): Add skip content buttons #4983

Merged
merged 5 commits into from
Jan 20, 2024
Merged

enh(NcContent): Add skip content buttons #4983

merged 5 commits into from
Jan 20, 2024

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Dec 21, 2023

☑️ Resolves

This adds skip content buttons for the Vue app when mounting NcContent.
It also handles the app navigation if it is not available (meaning do not add that button if there is no app navigation).
And it opens the app navigation when skipping to it.

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable

@susnux susnux added enhancement New feature or request 3. to review Waiting for reviews feature: app-content Related to the app-content component labels Dec 21, 2023
@susnux susnux marked this pull request as ready for review December 21, 2023 12:00
src/components/NcAppNavigation/NcAppNavigation.vue Outdated Show resolved Hide resolved
src/components/NcContent/NcContent.vue Outdated Show resolved Hide resolved
src/components/NcContent/NcContent.vue Outdated Show resolved Hide resolved
@susnux susnux force-pushed the enh/skip-buttons branch 3 times, most recently from cb74159 to cdc6a7f Compare December 21, 2023 15:29
Copy link
Contributor

@JuliaKirschenheuter JuliaKirschenheuter left a comment

Choose a reason for hiding this comment

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

Thank you for taking over!

Unfortunately it is not working well (tested again after your second push). 2 scenarios:

  1. Check "Skip to app navigation" one time -> navigate a bit -> check "Skip to app navigation" second time -> focus remains on a skip button and nothing happens.
  2. Check "Skip to app navigation" -> go to the app navigation and try to navigate backwards (Shift + Tab) -> navigation will move to the header, not to the app navigation

@JuliaKirschenheuter
Copy link
Contributor

But those scenarios #4983 (review) are working for "skip to main content" well

@susnux
Copy link
Contributor Author

susnux commented Dec 21, 2023

Check "Skip to app navigation" one time -> navigate a bit -> check "Skip to app navigation" second time -> focus remains on a skip button and nothing happens.

Ah I see when the location hash is already set to that ID then the browser will not update the focus. I fixed this now ✔️

@susnux
Copy link
Contributor Author

susnux commented Dec 21, 2023

Check "Skip to app navigation" -> go to the app navigation and try to navigate backwards (Shift + Tab) -> navigation will move to the header, not to the app navigation

What do you mean? If you check "skip to navigation" then the focus should be on the navigation. If you press shift-tab then the next element in reverse order is focused (probably the settings button in the app menu?).

@ShGKme
Copy link
Contributor

ShGKme commented Dec 21, 2023

2. Check "Skip to app navigation" -> go to the app navigation and try to navigate backwards (Shift + Tab) -> navigation will move to the header, not to the app navigation

"Skip buttons" supposed to be one way — to skip the header or navigation. But user doesn't need to return to them on backward navigation.

In screen readers a user can return to the beginning with a special shortcut (CTRL+Home usually)

Comment on lines +97 to +99
inject: {
setHasAppNavigation: {
default: () => () => Vue.util.warn('NcAppNavigation is not mounted inside NcContent, this is probably an error.'),
Copy link
Contributor

Choose a reason for hiding this comment

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

If we show a warning here, we should add something to the Files app to not show the warning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would say it depends. Is there any good reason to not use NcContent?
If yes: Then we can remove the warning and adjust the docs.
If not: We should adjust files to use it.

Copy link
Contributor

Choose a reason for hiding this comment

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

There isn't, this is the only way we ask Devs to build Vue apps

@susnux
Copy link
Contributor Author

susnux commented Dec 21, 2023

@nextcloud-libraries/designers this is unrelated to this PR (also on current master) but maybe we can take the opportunity and improve it.
When having the app navigation on an app the skip content buttons are hard to see because they are colored primary like the active navigation element element. Maybe we should add some background to the buttons to make them more visual distinguishable?

With background current
Screenshot_20231221_191558 Screenshot_20231221_191715
Screenshot_20231221_191609 Screenshot_20231221_191705

@marcoambrosini
Copy link
Contributor

marcoambrosini commented Dec 21, 2023

Good idea @susnux! Then I would suggest making it even bigger and more informative. I sketched out a suggestion.
I can provide SVGs for the images of the focused parts. What do you think @nextcloud-libraries/designers ?
Screenshot from 2023-12-22 08-49-16

Todo:

  • Invert order so that UI section and buttons are vertically aligned
  • Possibly gray out UI and use color in the highlighted part. The highlighted section should stand out more

@susnux
Copy link
Contributor Author

susnux commented Dec 22, 2023

@marcoambrosini that looks really amazing! Should we directly implement this or first fix this issue here and the improve when the SVGs are ready?

@JuliaKirschenheuter
Copy link
Contributor

@marcoambrosini would it be possible to backport so large improvement to stable28?

@ShGKme
Copy link
Contributor

ShGKme commented Dec 22, 2023

@marcoambrosini would it be possible to backport so large improvement to stable28?

I think this is not large as this part is visible only on initial keyboard navigation.

@susnux

This comment was marked as resolved.

@susnux

This comment was marked as resolved.

Copy link
Contributor

@JuliaKirschenheuter JuliaKirschenheuter left a comment

Choose a reason for hiding this comment

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

skip links are working fine. Can't see SVG's

@ShGKme

This comment was marked as resolved.

@marcoambrosini
Copy link
Contributor

It looks like the svg is getting resized?

@susnux
Copy link
Contributor Author

susnux commented Jan 18, 2024

It looks like the svg is getting resized?

Forgot to set the size correctly, done now ✔️

@susnux
Copy link
Contributor Author

susnux commented Jan 18, 2024

Screenshot_20240118_175720

@ShGKme

This comment was marked as resolved.

Copy link
Contributor

@marcoambrosini marcoambrosini left a comment

Choose a reason for hiding this comment

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

Nice, just a couple of comments about the buttons:

  • I would invert the order so that first comes navigation and then content
  • I would make both of them tertiary

@ShGKme
Copy link
Contributor

ShGKme commented Jan 19, 2024

  • I would make both of them tertiary

Maybe secondary is better here? To be more visible

@ShGKme
Copy link
Contributor

ShGKme commented Jan 19, 2024

Primary Secondary Tertiary
image image image
image image image

@marcoambrosini
Copy link
Contributor

@ShGKme since one f the two will always have a border, I don't think it's needed. But I'm fine with either.

@susnux
Copy link
Contributor Author

susnux commented Jan 19, 2024

Nice, just a couple of comments about the buttons

I pushed a commit to resolve both points.

vokoscreenNG-2024-01-19_17-01-45.mp4

@susnux susnux merged commit 808bbb2 into master Jan 20, 2024
16 checks passed
@susnux susnux deleted the enh/skip-buttons branch January 20, 2024 03:06
@Pytal Pytal mentioned this pull request Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request feature: app-content Related to the app-content component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BITV]: Skip links are not working anymore
5 participants