Page MenuHomePhabricator

Bug 1703164 - convert calendar/base/content/dialogs/calendar-event-dialog-recurrence.xhtml to top level <html>. r=elizabeth
ClosedPublic

Authored by mkmelin on Feb 21 2022, 11:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 21 2025, 10:24 AM
Unknown Object (File)
Jan 19 2025, 5:03 AM
Unknown Object (File)
Jan 18 2025, 5:52 AM
Unknown Object (File)
Jan 17 2025, 1:07 PM
Unknown Object (File)
Jan 17 2025, 11:56 AM
Unknown Object (File)
Jan 16 2025, 4:26 AM
Unknown Object (File)
Jan 11 2025, 5:40 AM
Unknown Object (File)
Jan 1 2025, 5:37 AM
Subscribers

Diff Detail

Repository
rCOMMCENTRAL comm-central
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
henry requested changes to this revision.Feb 28 2022, 5:32 PM
henry added inline comments.
calendar/base/content/dialogs/calendar-event-dialog-recurrence.xhtml
24

The width and height are not being persisted. I'm not sure why this worked before and not now.

This revision now requires changes to proceed.Feb 28 2022, 5:32 PM
mkmelin updated this revision to Diff 551703.

On closer inspection, this dialog had a lot of problems on trunk as well (esp. with regards to making it smaller)

Thanks for pointing out the resize problem. Unfortunately, even with the changes, the layout calculations do not work exactly because they do not take the window padding and exact sizes into account. It is also slow to change.

We could simplify it using a grid display on #recurrence-preview that only occupies the available size and has grid-auto-columns: min-content. On resizing, we measure its size and calculate how many minimonth elements would fit. Then you just need to change the number of minimonth elements and set the style.gridRow of each minimonth element to the corresponding value.

calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
64–65

We should use the #recurrence-preview content width, which takes padding etc into account.

64–65

This can be cached to a property because the size isn't expected to change.

64–65

If you use a grid layout, then this can be reduced to appending or removing excess minimonth elements.

65

We should use the #recurrence-preview content height.

475

This needs to be called after the "load" event. If it is called during "DOMContentLoaded" it throws errors.

calendar/base/content/dialogs/calendar-event-dialog-recurrence.xhtml
771–772

Remove these extra two.

771–772

This could be a single <div id="recurrence-preview"> with a grid layout.

henry requested changes to this revision.Mar 8 2022, 11:19 AM
This revision now requires changes to proceed.Mar 8 2022, 11:19 AM
mkmelin added inline comments.
calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
64–65

That is what was used (#recurrence-preview is this.node).
But we can't use that. It was the cause of the can't-downsize problem mentioned before.
It won't go below a certain width (I think due to other elements above)

64–65

There is much that could potentially be improved here, but I'd like to just do what I came for.

mkmelin updated this revision to Diff 555706.
henry requested changes to this revision.Mar 16 2022, 2:54 PM

The current patch still results in clipping at certain sizes. If you don't want to use a CSS grid and want to keep it similar to how it is now, you can use the suggested edits.

calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
31

Suggestion for initial values.

64–65

This is a suggestion for more accurate measurements. And to also prevent rebuilding on every resize, which makes it much smoother.

77

Remove this.

calendar/base/content/dialogs/calendar-event-dialog-recurrence.xhtml
771–772

Remove the extra months.

771–772

Allow the box to re-adjust to any size.

771–772

Make sure there is enough room for one minimonth.

This revision now requires changes to proceed.Mar 16 2022, 2:54 PM
mkmelin updated this revision to Diff 558649.
mkmelin marked 5 inline comments as done.
calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
64–65

The 4 extra px doesn't work for me, it will make the initial window just have 2 months. Without the 4 extra px things look very good now it seems. Thanks for the suggestions!

henry requested changes to this revision.Mar 21 2022, 11:28 AM

Looks good. Just a stray comment.

calendar/base/content/dialogs/calendar-event-dialog-recurrence.js
64–65

Remove this comment since the patch didn't do this.

This revision now requires changes to proceed.Mar 21 2022, 11:28 AM
mkmelin updated this revision to Diff 558698.
This revision is now accepted and ready to land.Mar 28 2022, 9:51 AM
This revision is now accepted and ready to land.Mar 28 2022, 10:21 PM

Working on other platforms but there's test failures for Windows:
comm/calendar/test/browser/recurrence/browser_lastDayOfMonth.js
comm/calendar/test/browser/recurrence/browser_weeklyN.js
comm/calendar/test/browser/recurrence/browser_lastDayOfMonth.js

mkmelin updated this revision to Diff 694486.
mkmelin retitled this revision from Bug 1703164 - convert calendar/base/content/dialogs/calendar-event-dialog-recurrence.xhtml to top level <html>. r=henry to Bug 1703164 - convert calendar/base/content/dialogs/calendar-event-dialog-recurrence.xhtml to top level <html>. r=elizabeth.
mkmelin edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Mar 19 2023, 10:14 PM
mkmelin edited reviewers, added: elizabeth; removed: henry.
This revision is now accepted and ready to land.Mar 20 2023, 1:58 PM