Skip to content

✨ Voting-Booth: Collapsed by default Lists#479

Merged
Findeton merged 2 commits into10.5.xfrom
feat/meta-11123/10.5.x
Apr 5, 2026
Merged

✨ Voting-Booth: Collapsed by default Lists#479
Findeton merged 2 commits into10.5.xfrom
feat/meta-11123/10.5.x

Conversation

@Findeton
Copy link
Copy Markdown
Contributor

@Findeton Findeton commented Mar 4, 2026

@Findeton Findeton self-assigned this Mar 4, 2026
@Findeton Findeton marked this pull request as ready for review April 5, 2026 17:27
@Findeton Findeton requested a review from Copilot April 5, 2026 17:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds “collapsed by default” behavior for category lists in the Voting Booth simultaneous-questions v2 UI, including per-category collapse/expand and an Expand/Collapse All control, with updated translations.

Changes:

  • Initialize question categories as collapsed by default and auto-expand matched categories during search.
  • Add an Expand/Collapse All button to the question header area.
  • Make category headers clickable/keyboard-accessible to toggle collapse, and add i18n strings for the new labels.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
locales/en.json Adds collapseAll / expandAll strings for the new UI control.
locales/es.json Adds collapseAll / expandAll strings for the new UI control.
locales/fr.json Adds collapseAll / expandAll strings for the new UI control.
locales/it.json Adds collapseAll / expandAll strings for the new UI control.
locales/ca.json Adds collapseAll / expandAll strings for the new UI control.
avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.js Introduces isCollapsed state per category and search-driven expand/collapse behavior; adds “toggle all” helpers.
avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.html Renders the Expand/Collapse All button in the question header UI.
avBooth/simultaneous-questions-v2-screen-directive/simultaneous-questions-v2-screen-directive.less Styles the new button and changes header layout.
avBooth/simultaneous-questions-category-v2-directive/simultaneous-questions-category-v2-directive.js Adds a toggleCollapse helper for keyboard interaction.
avBooth/simultaneous-questions-category-v2-directive/simultaneous-questions-category-v2-directive.html Makes category headers toggleable (mouse/keyboard), adds chevron indicator, and hides body when collapsed.
avBooth/simultaneous-questions-category-v2-directive/simultaneous-questions-category-v2-directive.less Adds interactive styling for the clickable header and chevron.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 160 to 166
.question-search-container {
width: 100%;
display: flex;
flex-direction: row;
justify-content: flex-end;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

Changing .question-search-container to justify-content: space-between will left-align the search/filter control on questions without categories (because the collapse/expand button is not rendered). This is a UI regression vs the previous flex-end behavior. Consider keeping flex-end by default and only using space-between when the collapse/expand button is present (e.g., via a conditional class) so the filter stays right-aligned when it’s the only child.

Copilot uses AI. Check for mistakes.
ng-attr-tabindex="{{ !isReview ? '0' : undefined }}"
ng-attr-role="{{ !isReview ? 'button' : undefined }}"
ng-attr-aria-expanded="{{ !isReview ? !category.isCollapsed : undefined }}"
ng-keydown="($event.key === 'Enter' || $event.key === ' ') && toggleCollapse() && $event.preventDefault()"
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

ng-keydown relies on toggleCollapse() being truthy to reach $event.preventDefault(), but toggleCollapse currently returns undefined, so default key behavior (notably Space scrolling) won’t be prevented. Adjust the handler so preventDefault() always runs when handling Enter/Space (e.g., call both statements unconditionally in the expression, or have toggleCollapse return true).

Suggested change
ng-keydown="($event.key === 'Enter' || $event.key === ' ') && toggleCollapse() && $event.preventDefault()"
ng-keydown="($event.key === 'Enter' || $event.key === ' ') && toggleCollapse(); ($event.key === 'Enter' || $event.key === ' ') && $event.preventDefault()"

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +9
class="category-heading"
id="question_{{question.index}}_answer_{{category.categoryAnswer.id}}"
ng-click="!isReview && (category.isCollapsed = !category.isCollapsed)"
ng-attr-tabindex="{{ !isReview ? '0' : undefined }}"
ng-attr-role="{{ !isReview ? 'button' : undefined }}"
ng-attr-aria-expanded="{{ !isReview ? !category.isCollapsed : undefined }}"
ng-keydown="($event.key === 'Enter' || $event.key === ' ') && toggleCollapse() && $event.preventDefault()"
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

The collapse toggle logic is duplicated: ng-click toggles category.isCollapsed inline, while keyboard handling calls toggleCollapse(). This can drift over time (and already adds an extra review guard in JS). Consider using toggleCollapse() for both click and keydown so there is a single source of truth for the interaction behavior.

Copilot uses AI. Check for mistakes.
Comment on lines +64 to +72
&:hover, &:focus {
opacity: 0.85;
outline: none;
}

&:focus-visible {
outline: 2px solid @av-primary-contrast;
border-radius: 3px;
}
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

:focus { outline: none; } removes the keyboard focus indicator unless the browser supports :focus-visible. Since :focus-visible support is not universal, this can make the heading unreachable for keyboard users. Prefer keeping an outline for :focus (or providing a non-:focus-visible fallback) so focus is always visible.

Suggested change
&:hover, &:focus {
opacity: 0.85;
outline: none;
}
&:focus-visible {
outline: 2px solid @av-primary-contrast;
border-radius: 3px;
}
&:hover {
opacity: 0.85;
}
&:focus {
opacity: 0.85;
outline: 2px solid @av-primary-contrast;
border-radius: 3px;
}
&:focus:not(:focus-visible) {
outline: none;
}

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +71
cursor: pointer;
user-select: none;

&:hover, &:focus {
opacity: 0.85;
outline: none;
}

&:focus-visible {
outline: 2px solid @av-primary-contrast;
border-radius: 3px;
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

.category-heading is styled with cursor: pointer even in review mode where the heading is not interactive (no role="button", click is gated by !isReview). This can mislead users into thinking it’s clickable. Consider scoping the pointer/hover styles to the interactive state only (e.g., when it has role="button" or a dedicated class set only when !isReview).

Suggested change
cursor: pointer;
user-select: none;
&:hover, &:focus {
opacity: 0.85;
outline: none;
}
&:focus-visible {
outline: 2px solid @av-primary-contrast;
border-radius: 3px;
&[role="button"] {
cursor: pointer;
user-select: none;
&:hover, &:focus {
opacity: 0.85;
outline: none;
}
&:focus-visible {
outline: 2px solid @av-primary-contrast;
border-radius: 3px;
}

Copilot uses AI. Check for mistakes.
@Findeton Findeton merged commit bd539e2 into 10.5.x Apr 5, 2026
4 of 5 checks passed
@Findeton Findeton deleted the feat/meta-11123/10.5.x branch April 5, 2026 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants