Skip to content

Improved Calendar - #152

Open
Abscissa24 wants to merge 14 commits into
mainfrom
Improved-Calendar
Open

Abscissa24 wants to merge 14 commits into
mainfrom
Improved-Calendar

Conversation

@Abscissa24

Copy link
Copy Markdown
Member

Improved Calendar

What's New

  • Adding, editing or even deleting events were not even working. Fixed.
  • Home calendar widget now shows an overview of your events at a glance and looks fuller. QOL improvement.
  • You can now quickly, and seamlessly rearrange your events just by dragging them to wherever you want. The event's card shows a live preview of the new scheduled times during the repositioning. Intuitive.
  • Fixed 'All day' events and improved upon them. They now occupy a section beneath the week header (since 'All day' events exist without time allocation and are bound to the day itself, not any arbitrary time slot). Makes sense.
  • Redesigned the add event card. Looks better imo.
  • Redesigned the edit event card. Same as above desc.
  • Added an option to select a custom colour of the event. QOL improvement.
  • You can now add MULTIPLE events at once instead of MANUALLY adding each individual event. This feature can be extremely useful for someone with a really busy schedule, since they can populate their calendar quickly instead of adding events one-by-one. QOL improvement.
  • Added a switch for calendar reminders for those who need it. QOL improvement.
  • Added a duration before reminder spinner so the user can choose how much time they should be reminded before the event (30 minutes by default), the user can change this to whatever they want. QOL improvement.
  • Added a switch for a "Reminder Sound" for those who need it. I know this might be better in the Sound settings, Idk I feel like everything involving a section or feature should be in one place - instead of having it's features spread across 10 different settings pages. Of course we know were everything is, but the average user? A lot of navigating on their end. @LeVraiArdox lemme know if its fine here or if you indeed need it in the sound settings page.
  • I'm probably forgetting some things to put here but yeah the video shows mostly everything

Showcase

demo.mp4

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.
@Abscissa24 Abscissa24 linked an issue Aug 15, 2026 that may be closed by this pull request
@LeVraiArdox

Copy link
Copy Markdown
Member

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 LeVraiArdox 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.

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

Comment thread src/share/sleex/modules/dashboard/calendar/CalendarTimeTable.qml
@Abscissa24

Copy link
Copy Markdown
Member Author

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

Copy link
Copy Markdown
Member Author

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

Maybe check now? Everything is working on my side :P

laptop.mp4
phone.mp4

@Abscissa24

Copy link
Copy Markdown
Member Author

I will just work on implementing qtquick-drag and then we should be good to go

@LeVraiArdox

Copy link
Copy Markdown
Member

Maybe check now? Everything is working on my side

Thanks

@Abscissa24

Copy link
Copy Markdown
Member Author

@LeVraiArdox is this good now? It has been updated to use qtquick-drag

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

Stuff I found while doing a (not so) final review

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.

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" +

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.

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, "'\\''")

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.

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.

Comment on lines +404 to +406
const delay = Math.max(250, earliest - now)
reminderTimer.interval = Math.min(delay, 2147483647)
reminderTimer.start()

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.

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar Improvement

2 participants