Skip to content

Calendar: Add slotDuration and slotLabelInterval, Add Day View#8880

Open
BeatLink wants to merge 27 commits intoTriliumNext:mainfrom
BeatLink:main
Open

Calendar: Add slotDuration and slotLabelInterval, Add Day View#8880
BeatLink wants to merge 27 commits intoTriliumNext:mainfrom
BeatLink:main

Conversation

@BeatLink
Copy link
Copy Markdown
Contributor

@BeatLink BeatLink commented Mar 2, 2026

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

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 2, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Calendar Customization: Introduced new note labels, calendar:slotDuration and calendar:slotLabelInterval, allowing users to customize the duration of time slots and the interval at which labels appear in the FullCalendar view.
  • Documentation Update: Updated the user guide to include comprehensive documentation for the newly added slotDuration and slotLabelInterval note labels, complete with usage examples.

🧠 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
  • apps/client/src/widgets/collections/calendar/index.tsx
    • Introduced slotDuration and slotLabelInterval state variables, initialized from useNoteLabel hooks.
    • Passed slotDuration and slotLabelInterval as props to the FullCalendar component, providing default values of '00:30:00' and '01:00:00' respectively.
  • docs/User Guide/User Guide/Collections/Calendar.md
    • Added new entries for #calendar:slotDuration and #calendar:slotLabelInterval to the calendar attributes table.
    • Provided detailed descriptions and examples for configuring time slot duration and label intervals.
    • Slightly reformatted the HTML table structure for improved readability.
Activity
  • Pull request created by BeatLink to add slotDuration and slotLabelInterval to Calendar.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apps/client/src/widgets/collections/calendar/index.tsx Outdated
Comment thread docs/User Guide/User Guide/Collections/Calendar.md Outdated
@BeatLink
Copy link
Copy Markdown
Contributor Author

BeatLink commented Mar 2, 2026

@gemini-code-assist review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apps/client/src/widgets/collections/calendar/index.tsx Outdated
Comment thread packages/commons/src/lib/attribute_names.ts
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread apps/client/src/widgets/collections/calendar/index.tsx Outdated
BeatLink and others added 3 commits March 3, 2026 07:45
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@BeatLink
Copy link
Copy Markdown
Contributor Author

BeatLink commented Mar 3, 2026

@eliandoran can you take a look?

@BeatLink
Copy link
Copy Markdown
Contributor Author

BeatLink commented Mar 7, 2026

@eliandoran @SiriusXT could we get this in for the next release?

@BeatLink BeatLink changed the title Add slotDuration and slotLabelInterval to Calendar Calendar: Add slotDuration and slotLabelInterval, Add Day View Mar 8, 2026
@BeatLink
Copy link
Copy Markdown
Contributor Author

bump

Copy link
Copy Markdown
Contributor

@eliandoran eliandoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@eliandoran eliandoran added this to the v0.103.0 milestone Mar 14, 2026
@eliandoran eliandoran marked this pull request as draft March 14, 2026 20:21
@rom1dep
Copy link
Copy Markdown
Contributor

rom1dep commented Mar 15, 2026

It's not clear from the amended documentation (and neither from Gemini's own summarisation, tbf) what slotDuration/slotLabelInterval do,

I think they affect the way the events are rendered (but not the events themselves). Either way, here are some ideas to improve the documentation:

  • Since the concept of slots is newly introduced by this PR, it's probably best to spend a paragraph (and ideally a screenshot) illustrating what they are and how they are interacted with
  • Once that's done, it's probably more faithful to stick with upstream's doc to explain what that does as there are specifics: https://fullcalendar.io/docs/slotLabelInterval
  • Comparative screenshots showing how those settings can improve upon the default settings in certain cases

@BeatLink BeatLink marked this pull request as ready for review April 11, 2026 22:59
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 11, 2026
@BeatLink BeatLink requested a review from eliandoran April 11, 2026 22:59
@BeatLink
Copy link
Copy Markdown
Contributor Author

All changes implemented

@BeatLink
Copy link
Copy Markdown
Contributor Author

Bump

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

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants