kiesraad / abacus

Abacus, software voor verkiezingsuitslagen en zetelverdeling
https://kiesraad-abacus.pages.dev
European Union Public License 1.2
17 stars 6 forks source link

UX/design debt 3 #263

Closed jorisleker closed 1 month ago

jorisleker commented 2 months ago

After #133 is fixed:

praseodym commented 2 months ago

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

jorisleker commented 2 months ago

@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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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: https://github.com/kiesraad/abacus/blob/53afc53d79197b9a0d72e7d10fc5a812cc8a4bf9/frontend/app/component/form/polling_station_choice/PollingStationSelector.tsx#L46-L50

lkleuver commented 2 months ago

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

praseodym commented 2 months ago

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 commented 2 months ago

This is my current implementation: https://github.com/kiesraad/abacus/tree/design-debt-3-133/frontend/lib/ui/Button

lkleuver commented 2 months ago

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

praseodym commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

@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 commented 2 months ago

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 commented 1 month ago

so this issue can be closed