Skip to content

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

Merged
eliandoran merged 41 commits into
TriliumNext:mainfrom
BeatLink:main
Jul 4, 2026
Merged

eliandoran merged 41 commits into
TriliumNext:mainfrom
BeatLink:main

Conversation

@BeatLink

@BeatLink BeatLink commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

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.

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

Copy link
Copy Markdown
Contributor

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

BeatLink commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

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

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Contributor

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

BeatLink commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

@eliandoran can you take a look?

@BeatLink

BeatLink commented Mar 7, 2026

Copy link
Copy Markdown
Contributor Author

@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

@eliandoran eliandoran left a comment

Copy link
Copy Markdown
Contributor

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.

@BeatLink

Copy link
Copy Markdown
Contributor Author

Bump

@eliandoran eliandoran modified the milestones: v0.103.0, v0.104.0 May 14, 2026
@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds calendar day view and configurable time slots. The main changes are:

  • Adds timeGridDay as a selectable calendar view.
  • Adds calendar:slotDuration and calendar:slotLabelInterval handling.
  • Adds ribbon and property-menu controls for time-slot settings.
  • Updates calendar documentation and English UI strings.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/client/src/widgets/collections/calendar/index.tsx Adds day view support and applies validated slot settings to FullCalendar.
apps/client/src/widgets/ribbon/collection-properties-config.tsx Adds time-slot controls with values that match the calendar duration format.
apps/client/src/widgets/react/NotePropertyMenu.tsx Adds submenu and option-group rendering for collection properties.
apps/client/src/widgets/ribbon/CollectionPropertiesTab.tsx Adds ribbon rendering for option-group properties and flattened submenu entries.
docs/User Guide/User Guide/Collections/Calendar.md Documents day view and the new calendar slot attributes.
apps/server/src/assets/doc_notes/en/User Guide/User Guide/Collections/Calendar.html Updates the bundled calendar guide with the new day view and slot attributes.

Reviews (7): Last reviewed commit: "fix(calendar): keep the properties menu ..." | Re-trigger Greptile

Comment thread apps/client/src/widgets/collections/calendar/index.tsx
Comment thread docs/User Guide/User Guide/Collections/Calendar.md Outdated
Comment thread docs/User Guide/User Guide/Collections/Calendar.md Outdated
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.00000% with 28 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/client/src/widgets/react/NotePropertyMenu.tsx 0.00% 14 Missing ⚠️
...ent/src/widgets/ribbon/CollectionPropertiesTab.tsx 0.00% 8 Missing ⚠️
.../client/src/widgets/collections/calendar/index.tsx 33.33% 4 Missing ⚠️
...rc/widgets/ribbon/collection-properties-config.tsx 60.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Bundle Report

Changes will decrease total bundle size by 53.27MB (-51.8%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
client-esm 49.56MB 3.65kB (0.01%) ⬆️
standalone-esm (removed) -53.27MB (-100.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: client-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
src/dist-*.js -1 bytes 56 bytes -1.75%
src/dist-*.js 1 bytes 57 bytes 1.79%
src/src-*.js 27 bytes 18.55kB 0.15%
src/content_renderer-*.js 41 bytes 201.83kB 0.02%
src/Code-*.js 1 bytes 182.54kB 0.0%
src/calendar-*.js 504 bytes 14.6kB 3.57%
src/setup-*.js 40 bytes 13.35kB 0.3%
src/NoteDetail-*.js 339 bytes 11.4kB 3.07%
src/CollectionPropertiesTab-*.js 1.13kB 9.75kB 13.09% ⚠️
src/SetupPage-*.css 60 bytes 9.16kB 0.66%
src/SidebarChat-*.js 47 bytes 5.72kB 0.83%
src/LlmChat-*.js 122 bytes 5.31kB 2.35%
src/NotePropertyMenu-*.js 599 bytes 2.6kB 29.86% ⚠️
src/RightPanelWidget-*.js 51 bytes 1.23kB 4.33%
src/BlobStub-*.js (New) 572 bytes 572 bytes 100.0% 🚀
src/BlobStub-*.css (New) 120 bytes 120 bytes 100.0% 🚀

Files in src/calendar-*.js:

  • ./src/widgets/collections/calendar/index.tsx → Total Size: 14.84kB

  • ./src/widgets/collections/calendar/utils.ts → Total Size: 2.55kB

Files in src/CollectionPropertiesTab-*.js:

  • ./src/widgets/ribbon/collection-properties-config.tsx → Total Size: 5.56kB

  • ./src/widgets/ribbon/CollectionPropertiesTab.tsx → Total Size: 5.79kB

Files in src/NotePropertyMenu-*.js:

  • ./src/widgets/react/NotePropertyMenu.tsx → Total Size: 4.83kB

@BeatLink

BeatLink commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@eliandoran bump

BeatLink and others added 6 commits July 4, 2026 09:00
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>
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jul 4, 2026
{
label: t("calendar_view.slot_duration"),
type: "option-group",
bindToLabel: "calendar:slotDuration",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 One-Hour Slots Reset

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)

Fix in Claude Code

…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>
@eliandoran
eliandoran merged commit 9d08c26 into TriliumNext:main Jul 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants