-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qalendar Integration #274
Qalendar Integration #274
Conversation
…design/flow. * CalendarEvent (which is a clone of CalendarMonthDay) gives us a all-in-one event display. * CalendarEvent still needs some heavy clean-up. * Additional style tweaks on CalendarQalendar. * Fix event details pop-up to actually work. * Adjusted timeFormat() util to try and source browser/locale default if localstorage entry is not found.
Looks like the mobile event list is pending PR merge: tomosterlund/qalendar#220 We can have the event list as is for now until that merges. Worst case I can submit a follow-up PR on qalendar that just updates the docs as requested. |
Looks great so far, Mel! keep it up and let me know, if I can help on this. I can also try to push development on the qalendar repo |
* Light mode now looks better. * Additional style fixes. * Initial work on dayboundary.
Thanks! And if you'd like. We might soft-fork it and add some additional fixes, but I'd like to get this in a ready state (hopefully by eod my time tomorrow), so we can play with it on stage and fine any problem points. |
* Added support for schedule previews, and added qalendar to schedule page. * Add `type: 'schedule'` to schedulePreview object. (And accidentally lint the file.)
* Fixed events becoming un-aligned due to the `is-today` highlight. * Adjusted default calendar colour for events. * Fixed schedule preview in week and day view. (We can't easily hide them without re-processing the entire list everytime they flip between month/week/day...)
* Hacky watch function that pokes Qalendar's internal api. * Style update, it now looks less ugly with button states working! * Removed some components which are no longer used (from the page the SFC are still there.)
Should be good for review. There's some edge cases I need to iron out (like date navigation on big calendar not affecting little calendar.) but it's good for general testing / review. I kept our small calendar for now as there's a re-style coming eventually, so I don't want to do the work if it's going to be tossed. Styling is a bit annoying, tailwind doesn't support css native nesting without a plugin and that plugin broke my build. So we'll just repeat the base selector for now 😅 We do poke at Qalendar's internal API to do external date updates, we should look at the things we need to change and plan work on a fork (that we can then upstream in the future without being blocked.) |
...also we should really do that frontend linting. Apologies for accidentally linting another file, I have it set to do it on-save now. |
/** | ||
* Calculate the minimum amount of time we want to display | ||
* Qalendar only supports [15, 30, 60] as values. | ||
* @type {ComputedRef<number>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌 thanks for all the comprehensive commenting! makes this a lot easier to understand at a glance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree. Mel always does great commenting 💪🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can all thank pycharm for auto adding the handy type or return information 😄
90db4f3
to
2f65f72
Compare
@@ -332,6 +332,8 @@ const { t } = useI18n(); | |||
const dj = inject('dayjs'); | |||
const call = inject('call'); | |||
const isoWeekdays = inject('isoWeekdays'); | |||
const dateFormat = 'YYYY-MM-DD'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nit: could you export this date format as a const and use it instead of the hardcoded YYYY-MM-DD string (ex: https://github.com/thunderbird/appointment/pull/274/files#diff-28cc5c6b86b44e9e43a9a5731d8021e395af71bf9551377a76001158f9202d4aR132), just so we can avoid typos breaking things. Doesn't have to be in this patch, but it would be helpful in a follow-up patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good so far, Thank you Mel! 👏🏻 Just a few more things I found when testing it out (we can make extra issues for them)
- We currently only support dark mode right? The calendar keeps being dark when switching to light mode and mixes styles when switching to system mode.
- I selected English in the settings, but the Qalendar keeps showing me German labels like on the month button and the more-events link
- The mini calendar for date selection in Qalendar is not styled yet as well as the view toggle for week and day views
- The event popup does appear now without a fading or moving effect we had before when moving the cursor between different events, which feels a bit less smooth
- The day view has some issues showing the times when having overlapping events (or might be a feature rather than a bug 😅 )
Thanks again for your hard work on this!
/** | ||
* Calculate the minimum amount of time we want to display | ||
* Qalendar only supports [15, 30, 60] as values. | ||
* @type {ComputedRef<number>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree. Mel always does great commenting 💪🏻
:disabled="false" | ||
:placeholder="isBookingRoute" | ||
:event="eventProps.eventData" | ||
:popup-position="calendarMode === 'day' ? 'top' : 'right'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's odd, I think I need to re-add an overflow hidden somewhere 😅. I'll play around with that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just need to calculate/give the value "left" here, when the calendar is aligned to the right side of the screen. Or even better, we throw that property away and calculate the popup position from the position of the triggering event to always appear inside the calendar area. But that should be another issue.
Oh I think they're pretty easy fixes, I'll throw in a commit tomorrow. Dark mode is handled by css, but we can force it via: https://tomosterlund.github.io/qalendar/guide.html#dark-mode I forgot to hook up the locale string on config: https://tomosterlund.github.io/qalendar/guide.html#basic-configuration-1 |
Co-authored-by: Andreas <[email protected]>
* Added getPreferredTheme which returns either colorSchemes.light or colorSchemes.dark based on preference. * Added getLocale which returns ['de', 'en', null] depending on preference (or lack of.) * Cleared out a bunch of unused code. * Fixed light/dark mode issues with Qalendar integration. (I hope!) * Removed media query for dark mode check, rely on tailwind dark class. * Hooked up locale to Qalendar if specified. * Adjusted various free date formats to our handy-dandy enum.
0d0dd53
to
a136b0c
Compare
FYI: Once this is merged, I'll take care of the frontend linting issues. To avoid merge conflicts, it might make sense to only create new branches after that is taken care of. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this looks much better now! Dark/light mode working now 👍🏻
Thanks! I'm off today, but Ill merge this in, and we'll put it on stage tomorrow. |
Keep your day off, Mel! We can do it all tomorrow 🙏🏻 |
Fixes #272
Not ready for review, but in case I get bus factor'd heres the wip. There's still some heavy clean up needed in CalendarEvent.vue.
I didn't throw everything out, we're keeping the individual event display styles, I need to look into if we can adjust the style of mobile month event list. (That contrast is terrifying.) I also added a function to help pick a good text colour based on background colour, I'll probably look for a better library for that though.
I also haven't started styling the buttons on the top right.
Calendar View
Month
Month (Mobile)
Week
(There's no mobile view for week view)
Day
Day (Mobile)
Booking View
Month
Month (Mobile)
Week
(There's no mobile view for week view)
Day
### Day (Mobile)