Förbättra användarupplevelse på d-cide - #116
Conversation
|
Kan du centrera valen så att det fjärde valet hamnar under det andra? |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…odule.scss Agent-Logs-Url: https://github.com/d-sektionen/medlem/sessions/e1e7c288-d8ff-46f2-b3ae-d323b68f260a Co-authored-by: OttoRoming <228027571+OttoRoming@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const create = async (data) => { | ||
| const { data: newMeeting } = await post('/voting/admin-meetings/', data) | ||
| mutate([...unorderedMeetings, newMeeting]) | ||
| } |
| useEffect(() => { | ||
| if (currentMeeting) | ||
| setCurrentMeeting(meetings.find(m => m.id === currentMeeting.id)) | ||
| setCurrentMeeting(meetings.find((m) => m.id === currentMeeting.id)) | ||
| }, [meetings]) |
| const create = async data => { | ||
| const create = async (data) => { | ||
| const { data: newMeeting } = await post('/voting/admin-meetings/', data) | ||
| mutate([...unorderedMeetings, newMeeting]) |
| [meetings] | ||
| ) | ||
| useEffect(() => { | ||
| if (currentMeeting) |
| if (to) | ||
| return ( | ||
| <Link className={button} to={to} onClick={onClick}> | ||
| <Link | ||
| className={button} | ||
| to={to} | ||
| onClick={onClick} | ||
| aria-disabled={disabled} | ||
| > | ||
| {children} | ||
| </Link> | ||
| ) | ||
|
|
||
| if (href) | ||
| return ( | ||
| <a className={button} href={href} target={target} onClick={onClick}> | ||
| <a | ||
| className={button} | ||
| href={href} | ||
| target={target} | ||
| onClick={onClick} | ||
| aria-disabled={disabled} | ||
| > | ||
| {children} | ||
| </a> | ||
| ) |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Fixed in f77c4de. When disabled is true, the <Link>/<a> variants now:
- Remove the
to/hrefattribute (prevents keyboard Enter, middle-click, and right-click → open-in-new-tab navigation) - Replace the
onClickwith a handler that callspreventDefault()+stopPropagation()(blocks any remaining click navigation) - Set
tabIndex={-1}(removes the element from the tab order) aria-disabled={true}was already in place from the previous fix
| choice = null, | ||
| setChoice = () => {}, | ||
| label = '', | ||
| hintLabel = 'Välj ett objekt', | ||
| action = null, | ||
| actionLabel = '', | ||
| noChoicesLabel = '', |
There was a problem hiding this comment.
@copilot apply changes based on this feedback
There was a problem hiding this comment.
Fixed in 44d76f4. Added hintLabel: PropTypes.string to TitleChooser.propTypes.
| <label key={id} className={voteLabel}> | ||
| <input | ||
| type="radio" | ||
| checked={checkedId === id} | ||
| onChange={() => setCheckedId(id)} | ||
| className={voteInput} | ||
| /> | ||
| {` ${text}`} | ||
| </label> |
| .voteInput { | ||
| /* hide the radio button */ | ||
| /* https://stackoverflow.com/questions/18078871/hide-check-radio-button-with-css */ | ||
| position: fixed; | ||
| opacity: 0; | ||
| pointer-events: none; | ||
| } | ||
|
|
||
| .voteLabel { | ||
| text-align: center; | ||
| font-size: 1.2em; | ||
| padding: $base-padding calc($base-padding / 2); | ||
| background-color: $background-color-4; | ||
| cursor: pointer; | ||
|
|
||
| word-break: normal; | ||
| overflow-wrap: anywhere; | ||
| hyphens: auto; | ||
|
|
||
| min-width: 100%; | ||
|
|
||
| @media screen and (min-width: $large-mobile-breakpoint) { | ||
| min-width: 30%; | ||
| } | ||
|
|
||
| &:hover { | ||
| background-color: $dsek-blue; | ||
| } | ||
|
|
||
| &:has(.voteInput:checked) { | ||
| background-color: $dsek-green !important; | ||
| color: $background-color-2; | ||
| font-weight: 800; | ||
| } |
| .currentMeetingContainer { | ||
| grid-column: 1 / -1; | ||
| background-color: transparent; | ||
| display: grid; | ||
| gap: $base-padding; | ||
| grid-template-columns: 1fr 1fr; | ||
| } | ||
|
|
||
| .votePanelContainer { | ||
| background-color: $background-color-2; | ||
| grid-column: 1 / -1; | ||
| padding: $base-padding; | ||
| } | ||
|
|
||
| .othersContainer { | ||
| display: grid; | ||
| grid-template-columns: repeat(var(--cols), 1fr); | ||
| --cols: 1; | ||
|
|
||
| @media screen and (min-width: $large-mobile-breakpoint) { | ||
| --cols: 2; | ||
| } | ||
|
|
||
| grid-column: 1 / -1; | ||
| gap: $base-padding; | ||
| } |
…emove from tab order Agent-Logs-Url: https://github.com/d-sektionen/medlem/sessions/131f26d2-bbe3-4d18-b2d0-aa1ddd17d336 Co-authored-by: OttoRoming <228027571+OttoRoming@users.noreply.github.com>
…n; add hintLabel proptype Agent-Logs-Url: https://github.com/d-sektionen/medlem/sessions/e66904bb-756c-4479-b3a9-93e1fb443cc8 Co-authored-by: OttoRoming <228027571+OttoRoming@users.noreply.github.com>
Done in 44d76f4. Switched back to CSS Grid with a 3-column layout on desktop. A lone last item (positions 4, 7, 10, …) gets
|

Förbättra UX?
med fler än 3 val
val med långa val
endast två val
välj ett objekt -> välj ett möte
Responsiv design