Skip to content

TimeslotBarWeek accessibility#1087

Open
benjaminLeongSK wants to merge 10 commits intomasterfrom
BL/1082
Open

TimeslotBarWeek accessibility#1087
benjaminLeongSK wants to merge 10 commits intomasterfrom
BL/1082

Conversation

@benjaminLeongSK
Copy link
Copy Markdown
Contributor

Type of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing apis or functionality to change)

Description of changes

  • Add aria-labels
  • Handle keyboard navigations
  • time slots tabbable

Checklist

  • Looks good on mobile and tablet

  • Screen reader annotates as per figma

  • Link to Figma

@benjaminLeongSK benjaminLeongSK requested a review from qroll April 14, 2026 08:49
&:focus-within {
outline: 2px solid ${Colour["focus-ring"]};
outline-offset: 1px;
z-index: 1;
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.

is this zindex needed?

const cellsArray = getCellsForDate(formattedDate);
return (
<TimeSlotWrapper key={`wrapper-${dayIndex}`}>
{cellsArray.map((slot) => {
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.

the nesting is kind of hard to read, let's move the rendering of TimeSlotWrapper to a new renderSlotCell function

aria-disabled={
!clickable
}
aria-describedby={
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.

why aria-describedby instead of as part of aria-label?

backgroundColor,
backgroundColor2,
} = styleAttributes;
const slotKey = `${formattedDate}-${id}`;
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.

Suggested change
const slotKey = `${formattedDate}-${id}`;
const slotId = `${formattedDate}-${id}`;

}
)
}
onClick={handleSlotButtonClick(
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.

hmm thinking of inlining like this so that the default assignment of clickable is kept in one place

Suggested change
onClick={handleSlotButtonClick(
onClick={clickable && handleSlotButtonClick(

Comment on lines +319 to +320
startTime = "",
endTime = ""
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.

why add the additional arguments?

setExpandAll((prevExpandValue) => !prevExpandValue);
};

const getCellsForDate = (formattedDate: string) => {
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.

this should sit under the helper functions section, not the event handlers. you can hoist it if needed using non-arrow functions

const getFocusableSlotsForDate = (
formattedDate: string
): FocusableSlotMeta[] => {
return getCellsForDate(formattedDate)
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.

we'll be re-computing this for every key down event, suggest to compute for all dates once and memoise since both rendering and event handling need this

Comment on lines +240 to +242
const hasCollapsedContent =
!!maxVisibleCellHeight &&
actualHeight > maxVisibleCellHeight;
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.

looks like we're doing the same checks to determine if content is collapsed, as rendering, can pull this into a shared variable or function

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.

this can happen. we should probably set inert on the elements that are after the visible height

Screen.Recording.2026-04-15.at.8.18.40.PM.mov

@qroll qroll added type: enhancement New feature or request a11y Accessibility labels Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y Accessibility type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants