Improved Calendar - #152
Abscissa24 wants to merge 14 commits into
Conversation
Added properties for manual refresh and resync handling. Updated event processing to include custom colors and improved reminder functionality.
Refactor CalendarAdd.qml to improve structure and readability. Added new properties and components for better event handling and UI updates.
Refactor CalendarEdit.qml to improve structure and readability, including updates to properties, event handling, and UI components.
Added drag-and-drop functionality for events in the calendar, including properties for drag state and preview. Enhanced event handling with new properties for dragging and visual feedback.
|
Looks awesome !! I will review the code asap, and to answer your question, I plan to make a settings rework (idk when) with proper pages for each sections. Also, these ripple buttons looks wierd, will probably find why by reviewing |
LeVraiArdox
left a comment
There was a problem hiding this comment.
Nvm for the buttons.
Pretty good overall, just don't reinvent the wheel.
Also, maybe it's on my side but when we use vdirsyncer, adding events don't add them to the remote. Removing them and importing thel works tho. I use google agenda btw
Hmm I will investigate this and report back |
Removed the syncInterval timer and adjusted the command building script.
Maybe check now? Everything is working on my side :P laptop.mp4phone.mp4 |
|
I will just work on implementing qtquick-drag and then we should be good to go |
Thanks |
|
@LeVraiArdox is this good now? It has been updated to use |
LeVraiArdox
left a comment
There was a problem hiding this comment.
Stuff I found while doing a (not so) final review
There was a problem hiding this comment.
Just noticed, you put the calendar sound in the battery/ folder
| "bash", "-c", | ||
| "khal list --json title --json start-date --json start-time --json end-time --json uid \"$1\" \"$2\" || exit $?;" + | ||
| " echo '@@CUSTOM-COLORS@@';" + | ||
| " find \"$HOME\" -name '*.ics' -exec grep -l '^X-SLEEX-COLOR:' {} + 2>/dev/null | while read -r f; do" + |
There was a problem hiding this comment.
Good thing I catched that. Searching the root of $HOME with find or grep -r on every sync or edit/remove is disastrous if the user has node_modules, .cache, wineprefixes, or large repositories.
Read the calendar directory from khal's config (or fall back to ~/.local/share/khal/ and ~/.local/share/vdirsyncer/), and restrict search paths strictly to configured calendar directories.
| } | ||
|
|
||
| function _buildRewriteCommand(uid, item) { | ||
| const quotedBody = root._buildIcsBody(uid, item).replace(/'/g, "'\\''") |
There was a problem hiding this comment.
If someone writes a title like "R&D / Meeting", sed will fail or corrupt the file. Instead of raw sed string replacement, pass variables as positional parameters ("$1", "$2") or rewrite the .ics block directly in JavaScript before piping standard input via the process stdin.
| const delay = Math.max(250, earliest - now) | ||
| reminderTimer.interval = Math.min(delay, 2147483647) | ||
| reminderTimer.start() |
There was a problem hiding this comment.
2147483647 ms is ~25 days. If the next upcoming event is further out than 25 days, the timer fires early and immediately rearms repeatedly. It won't crash, but clamping or checking earliest - now > 86400000 (e.g. check once a day) avoids arbitrary loop wakeups.
Improved Calendar
What's New
Showcase
demo.mp4