Calendar: Add slotDuration and slotLabelInterval, Add Day View - #8880
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the calendar widget by providing users with greater control over its time-based display. It enables dynamic configuration of time slot durations and label intervals directly through note labels, making the calendar more adaptable to various scheduling needs. This change improves the flexibility and user experience of the calendar feature without altering its core functionality. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces slotDuration and slotLabelInterval attributes to the Calendar view, allowing users to configure them through note labels. The implementation is sound, and the documentation has been updated accordingly. My review includes suggestions to improve code maintainability by extracting hardcoded default values into constants, and to enhance the documentation by adding information about these default values and ensuring consistent formatting.
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request adds the ability to configure slotDuration and slotLabelInterval for the calendar view using note labels. The implementation is straightforward and follows existing patterns. I've identified a potential bug where an empty label value would be passed to the calendar component, which could cause issues. I've included a suggestion to fix this. I also have a minor suggestion for improving code organization.
There was a problem hiding this comment.
Code Review
This pull request successfully adds the slotDuration and slotLabelInterval attributes to the Calendar widget, allowing users to customize these FullCalendar properties via note labels. The changes include defining default constants, retrieving values from note labels, passing them to the FullCalendar component, updating the Labels type for type safety, and documenting the new attributes in the user guide.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
@eliandoran can you take a look? |
|
@eliandoran @SiriusXT could we get this in for the next release? |
|
bump |
eliandoran
left a comment
There was a problem hiding this comment.
Overall it's good.
Two topics I would like addressed:
- All new options/configurations in Trilium must also be exposed to the user through the UI, not just through attributes. I recommend to add an entry in collection properties, although not sure about the UX of entering the value in the right format. You can handle this in a separate PR if needed.
- Always validate user data. If I enter
#calendar:slotLabelInterval="00:aa:00", the calendar crashes.
|
Bump |
Greptile SummaryThis PR adds calendar day view and configurable time slots. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (7): Last reviewed commit: "fix(calendar): keep the properties menu ..." | Re-trigger Greptile |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Bundle ReportChanges will decrease total bundle size by 53.27MB (-51.8%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: client-esmAssets Changed:
Files in
Files in
Files in
|
|
@eliandoran bump |
The time-slot duration / label-interval controls duplicated two nearly identical inline option arrays with hardcoded English labels. Generate them from a list of minutes instead, localize the labels via i18next plural keys, and curate the values: drop the unusable 1-minute slot (a 1,440-row day view) and give the label interval a coarser set. Also simplify isValidDuration to plain arithmetic (drop the dayjs duration machinery) and keep the attribute_names additions additive. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collapse the separate 'slot duration' and 'label interval' comboboxes into a single 'Time slots' submenu with two inline option groups, so the collection-properties menu shows one entry instead of two. Adds two reusable property-menu primitives: a generic 'submenu' container and an inline 'option-group' (a labelled radio group bound to its own note label), since a plain combobox can only bind a single label. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The slot duration / label interval only apply to the time-grid calendar views, so gate the 'Time slots' entry behind an isVisible predicate on calendar:view. Adds a reusable isVisible predicate to submenu properties and a shared isPropertyVisible helper honored by both property renderers. Also teaches the classic-ribbon renderer (mapPropertyView) the submenu/option-group types it previously didn't handle, so the grouped setting renders in both layouts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| { | ||
| label: t("calendar_view.slot_duration"), | ||
| type: "option-group", | ||
| bindToLabel: "calendar:slotDuration", |
There was a problem hiding this comment.
When a user selects the 1 hour slot duration, slotDurationOptions formats 60 as 00:60:00. The new duration validator rejects minute values outside 00 through 59, so the calendar treats that saved label as invalid and falls back to 00:15:00. The selected 1 hour setting is therefore saved but not applied.
Context Used: CLAUDE.md (source)
…alues Selecting a duration or label interval in the 'Time slots' option groups now stops the click from reaching Bootstrap's close handler, so the popup stays open and both grouped settings can be adjusted without reopening. Only affects option-group items (the sole consumer is the calendar time-slot settings); single-pick comboboxes still close as before. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This PR allows the user to set the FullCalendar slotDuration and slotLabelInterval attributes using note labels on the calendar.
This PR also adds day view as a selectable option