Skip to content

feat: add YaruCalendar - #1049

Open
Jupi007 wants to merge 6 commits into
ubuntu:mainfrom
Jupi007:yaru-calendar
Open

Jupi007 wants to merge 6 commits into
ubuntu:mainfrom
Jupi007:yaru-calendar

Conversation

@Jupi007

@Jupi007 Jupi007 commented Dec 7, 2025 •

Copy link
Copy Markdown
Member
Capture d’écran du 2025-12-07 16-18-06 Capture d’écran du 2025-12-07 16-18-33 Capture d’écran du 2025-12-07 16-19-11

@Jupi007 Jupi007 added the widgets label Dec 7, 2025
@Jupi007
Jupi007 requested review from Feichtmeier and ashuntu October 1, 2026 18:09
@Jupi007
Jupi007 marked this pull request as ready for review October 1, 2026 20:23
@Jupi007

Jupi007 commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

@ashuntu @Feichtmeier Could you take a look at this? I've put a lot of work into it and would love to see it merged :D

@ashuntu

ashuntu commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

I'd be interested to see if @paul-geoghegan has input as well from an accessibility POV

@Feichtmeier Feichtmeier left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

for me it looks good and it works!

thank you very much so for far for this huge work!

Let canonical people double check!

@paul-geoghegan

Copy link
Copy Markdown
Contributor

I have an exam today but will try look at this by the end of the week.

@Jupi007

Jupi007 commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Thanks a lot @paul-geoghegan 🙏

@ashuntu ashuntu 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.

I also think this looks good.

One thing, could we get a focus border on the month/year dropdown input? I suppose also on the actual month/years in the dropdown menu, similar to #1103, but that may be more invasive of a change.

@Jupi007

Jupi007 commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

@ashuntu Good point 👍
Also, I should add some labels to buttons.

@paul-geoghegan

Copy link
Copy Markdown
Contributor

Thanks for working on this. I tested the calendar with a keyboard and a screen reader and found the following.

Screen readers

  • The control buttons (previous/next month, the month/year toggle, the month picker's up/down arrows) have no labels. The up arrow in the month picker isn't announced at all.
  • Nothing tells a screen reader user which date is today or which month is the current one. Both need a semantic marker (a "current" state if Flutter exposes one) or an added label such as "Today".
  • Days are announced as just the number, with no month or year. Something like Semantics(button: true, label: localizations.formatFullDate(day)) would fix that.

Keyboard navigation

  • Every day cell is its own Tab stop, so a month grid is 42 stops. A keyboard or screen reader user has to press Tab dozens of times to cross the calendar, then again to get past it to the next control. Reaching the month controls from the middle of the grid, or leaving the calendar altogether, is slow and tiring.
  • A date grid should be one tab stop. Tab enters the grid on the selected date (or today), and Tab again leaves it. Inside the grid, arrow keys move by day and week, Home/End go to the start and end of the week, and PageUp/PageDown change month. This is the standard date-grid pattern (WAI-ARIA APG) and what users expect from native pickers.
  • This matters beyond convenience. Many people can't use a mouse, including screen reader users, switch and keyboard-only users, and people with motor impairments. For them a one-stop grid with arrow keys is the difference between a usable control and one that is technically reachable but impractical (WCAG 2.1.1 Keyboard, 2.4.3 Focus Order).
  • After choosing a month or year, or pressing Escape, focus should go back to the date input.

Today is wrong

  • Going back to September still highlights the 15th as today. The check is day.day == now.day && currentMonth, which ignores month and year. The month and year pickers have the same problem.

Out-of-month days

  • Nothing shows that the first days of the grid belong to the previous month, or that they are disabled.
  • Selecting September 29th from the October view moves focus to the start of September and selects the 29th.

Focus

  • Focus rings are present on the month controls and the dates.

Also noticed from the code (not yet verified at runtime)

  • DateFormat.yMMM() and DateFormat.MMMM() use the default intl locale instead of the widget's locale.
  • firstDate and lastDate aren't enforced on days, and previous/next never disable.

Not yet checked

  • Contrast of out-of-month and selected out-of-month days.
  • Behaviour with larger system text.

Happy to help with fixes.

@Jupi007

Jupi007 commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

@paul-geoghegan Thanks for your inputs. I'll fix all your points next week.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants