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

UX/design debt 3 #263

Closed
9 tasks done
jorisleker opened this issue Aug 15, 2024 · 19 comments
Closed
9 tasks done

UX/design debt 3 #263

jorisleker opened this issue Aug 15, 2024 · 19 comments
Assignees
Labels
frontend Issues or pull requests that relate to the frontend ux debt

Comments

@jorisleker
Copy link
Contributor

jorisleker commented Aug 15, 2024

After #133 is fixed:

  • Pressing Enter in the last input row returns focus to the first row, it should move focus to the submit button. will be fixed in Improve keyboard navigation on list data entry page #207
  • Shift+Enter doesn't work (Safari on macOS). → Form component shortcuts #295
  • With the tab-key I can highlight the "volgende" button and then submit by hitting the space bar. I can also highlight the navigation items on the left, but there hitting the space bar does not get me to the item I highlighted. No fix needed. Spacebar does not submit actions by default. Only ENTER does.
  • Add custom checkbox component to be able to better style checkboxes and radiobuttons (ie the "confirm to accept warnings" and "recounted" questions) → Custom checkbox #292
@github-project-automation github-project-automation bot moved this to Options in Abacus Aug 15, 2024
@jorisleker jorisleker moved this from Options to Current in Abacus Aug 15, 2024
@jorisleker jorisleker added the frontend Issues or pull requests that relate to the frontend label Aug 15, 2024
@praseodym praseodym moved this from Current to In Progress in Abacus Aug 16, 2024
@praseodym praseodym self-assigned this Aug 16, 2024
@praseodym
Copy link
Contributor

@jorisleker what do we do about the Space Grotesk font rendering straight quotes as curly quotes? There is an issue opened with the font (floriankarsten/space-grotesk#44) but it doesn't look like there's any progress made on this.

@jorisleker
Copy link
Contributor Author

jorisleker commented Aug 19, 2024

@praseodym
Just downloaded a list of all polling station from TK2023 from https://waarismijnstemlokaal.nl/data. None of them has " or ' in their name. So i'd say this is a very low priority issue. Don't think we will use quotes in h1 elements ourselves. My suggestion: don't fix.

The weird thing is, Space Grotesk actually has straight (single and double) quotes. see Google Fonts glyphs page. But it looks like the chars are flipped in the fontset. When I copy/paste these straight quotes from the screenshot below, I get these chars: and ... So a fix would be to do a replace in all text we render to the front-end, but feels way too hacky.

Scherm­afbeelding 2024-08-19 om 16 25 55

@jorisleker
Copy link
Contributor Author

jorisleker commented Aug 19, 2024

Woops, my bad. There are quite some polling stations with names like 't Gasthoes or BMV “De Schakel” (about 60 on 10.000 polling stations). Disregard my previous 'don't fix' suggestion. Still low prio though

@praseodym
Copy link
Contributor

What about renaming our example polling stations so that we don't have quotes there? I can align it with the names from the Figma design.

@praseodym
Copy link
Contributor

The weird thing is, Space Grotesk actually has straight (single and double) quotes. see Google Fonts glyphs page. But it looks like the chars are flipped in the fontset. When I copy/paste these straight quotes from the screenshot below, I get these chars: and ... So a fix would be to do a replace in all text we render to the front-end, but feels way too hacky.

Those are the Unicode prime (U+2032) and double prime (U+2033) symbols. I'm not sure why the font would have those but not proper quote glyphs.

@jorisleker
Copy link
Contributor Author

jorisleker commented Aug 19, 2024

What about renaming our example polling stations so that we don't have quotes there? I can align it with the names from the Figma design.

Hiding the issue does not make it go away 😂 But fine with me.
As long as we have an extended test set with names witn quotes

Those are the Unicode prime (U+2032) and double prime (U+2033) symbols. I'm not sure why the font would have those but not proper quote glyphs.

Ah check. Alternative would be to use Space Mono to render straight quotes, because that font has proper quotes. But that feels like an even bigger hack (and requires including an additional font).

@lkleuver
Copy link
Contributor

how do we handle keyboard shortcuts?
We can add a listener to buttons for instance,
or I have something laying around that does

useKeyboard({
 "shift+enter": doSomething
 });

@praseodym
Copy link
Contributor

how do we handle keyboard shortcuts? We can add a listener to buttons for instance, or I have something laying around that does

useKeyboard({
 "shift+enter": doSomething
 });

In the polling station selector we use this, I think that works fine:

onKeyDown={(e) => {
if (e.shiftKey && e.key === "Enter") {
handleSubmit();
}
}}

@lkleuver
Copy link
Contributor

lkleuver commented Aug 30, 2024

this only triggers when the element has focus, is that the intention of the shortcuts below forms?

@praseodym
Copy link
Contributor

this only triggers when the element has focus, is that the intention of the shortcuts below forms?

If you have an elegant way of making the shortcut work anywhere on the page that would be best. If that's not easily achievable, having it work when focus is on the text boxes is good enough for now.

@lkleuver
Copy link
Contributor

@lkleuver
Copy link
Contributor

but might want to decouple it from a button and create a component ?

@praseodym
Copy link
Contributor

This is my current implementation: https://github.com/kiesraad/abacus/tree/design-debt-3-133/frontend/lib/ui/Button
but might want to decouple it from a button and create a component ?

I'm ok with keeping it there for now, but I don't really like how eventMatchesShortcut re-parses the shortcut for every keypress.

Also, the ShortcutHint component is very similar to the KeyboardKeys component that is implemented in #284.

@lkleuver
Copy link
Contributor

lkleuver commented Sep 2, 2024

I've added code for this:

With the tab-key I can highlight the "volgende" button and then submit by hitting the space bar. I can also highlight the navigation items on the left, but there hitting the space bar does not get me to the item I highlighted.

But spacebar doesnt normally trigger links from tags. It does now in progress list but wouldn't that make people expect it to work on other links as wel?

@lkleuver
Copy link
Contributor

lkleuver commented Sep 2, 2024

Shift+enter submit works, but the focusing of the next row fires first.
I think we should move the listener to a <Form .../> component

@jorisleker
Copy link
Contributor Author

But spacebar doesnt normally trigger links from tags. It does now in progress list but wouldn't that make people expect it to work on other links as wel?

spacebar shouldn't work on links. Normal browser behavior is activate focussed action with 'enter', spacebar behaves like pagedown

@lkleuver
Copy link
Contributor

lkleuver commented Sep 2, 2024

@jorisleker if using "ENTER" to go through the inputs, you enter numbers press enter and reach the submit button, it is focused after pressing ENTER on the last input.
What should happen if you press ENTER with the submit button focused ?

@jorisleker
Copy link
Contributor Author

What should happen if you press ENTER with the submit button focused ?

I think it makes sense to submit the form when you press ENTER with the submit button focussed.
The thing we wanted to prevent was submitting the form 'to early' / unexpectedly as what happens in OSV. But we have prevented that by splitting up the form in sections, and by adding the 'controleren en opslaan' page/step.

(am thinking of changing the SHIFT+ENTER keyboard shortcut to move to the totals fields instead of submitting the form section, because that's an input you always need to complete before submitting, but will put this in a separate ticket)

@jorisleker
Copy link
Contributor Author

so this issue can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Issues or pull requests that relate to the frontend ux debt
Projects
Archived in project
Development

No branches or pull requests

5 participants