Skip to content

Förbättra användarupplevelse på d-cide - #116

Open
OttoRoming wants to merge 20 commits into
masterfrom
dcide-ux
Open

Förbättra användarupplevelse på d-cide#116
OttoRoming wants to merge 20 commits into
masterfrom
dcide-ux

Conversation

@OttoRoming

@OttoRoming OttoRoming commented May 4, 2026

Copy link
Copy Markdown
Contributor

Förbättra UX?

med fler än 3 val

Screenshot 2026-05-04 at 17-46-30 D-cide - Medlem D-sektionen

val med långa val

Screenshot 2026-05-04 at 17-45-58 D-cide - Medlem D-sektionen

endast två val

Screenshot 2026-05-04 at 17-46-56 D-cide - Medlem D-sektionen

välj ett objekt -> välj ett möte

Screenshot 2026-05-04 at 17-58-53 D-cide - Medlem D-sektionen

Responsiv design

Screenshot 2026-05-04 at 18-32-10 D-cide - Medlem D-sektionen

Comment thread src/components/vote/speakerPanel.js
Comment thread src/components/vote/speakerPanel.js
@Kesomannen

Copy link
Copy Markdown
Contributor

Kan du centrera valen så att det fjärde valet hamnar under det andra?

@OttoRoming

Copy link
Copy Markdown
Contributor Author

Kan du centrera valen så att det fjärde valet hamnar under det andra?

image

@YouKnowBlom
YouKnowBlom requested review from Copilot and removed request for Copilot May 4, 2026 17:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread src/components/vote/votePanel.js Outdated
Comment thread src/components/vote/votePanel.js
Comment thread src/components/vote/voteForm.js Outdated
Comment thread src/components/vote/voteForm.js Outdated
Comment thread src/components/vote/voteForm.js Outdated
Comment thread src/components/vote/voteForm.js Outdated
Comment thread src/components/vote/voteForm.js Outdated
Comment thread src/components/vote/votePanel.js Outdated
Comment thread src/scss/ui.module.scss
Comment thread src/components/ui/buttons.js
@OttoRoming OttoRoming added enhancement New feature or request updates suggestion D-Cide D-Cide buggar javascript Pull requests that update javascript code labels May 4, 2026
…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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment on lines +22 to 25
const create = async (data) => {
const { data: newMeeting } = await post('/voting/admin-meetings/', data)
mutate([...unorderedMeetings, newMeeting])
}
Comment on lines 43 to 46
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)
Comment on lines 30 to 53
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>
)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed in f77c4de. When disabled is true, the <Link>/<a> variants now:

  • Remove the to/href attribute (prevents keyboard Enter, middle-click, and right-click → open-in-new-tab navigation)
  • Replace the onClick with a handler that calls preventDefault() + 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

Comment on lines 15 to 21
choice = null,
setChoice = () => {},
label = '',
hintLabel = 'Välj ett objekt',
action = null,
actionLabel = '',
noChoicesLabel = '',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fixed in 44d76f4. Added hintLabel: PropTypes.string to TitleChooser.propTypes.

Comment on lines +55 to +63
<label key={id} className={voteLabel}>
<input
type="radio"
checked={checkedId === id}
onChange={() => setCheckedId(id)}
className={voteInput}
/>
{` ${text}`}
</label>
Comment on lines +10 to +43
.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;
}
Comment on lines +3 to +28
.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>

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor

Kan du centrera valen så att det fjärde valet hamnar under det andra?

Done in 44d76f4. Switched back to CSS Grid with a 3-column layout on desktop. A lone last item (positions 4, 7, 10, …) gets grid-column: 2, placing it exactly under the 2nd option. The layout adapts automatically:

  • 2 choices → 2 equal columns
  • 3+ choices → 3 equal columns (via :has(> :nth-child(3)))
  • 4th / 7th / … item alone in its row → shifts to column 2 (centred under item 2)
  • Mobile → single column

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 18 out of 20 changed files in this pull request and generated 1 comment.

Comment thread src/scss/voteForm.module.scss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

D-Cide D-Cide buggar enhancement New feature or request javascript Pull requests that update javascript code suggestion updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants