-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add option limiting the number of events to be displayed #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds an optional numeric event_limit configuration (default 0) across config, defaults, editor UI, validation, localization, README; and updates calendar event filtering to apply an optional post-filter slice based on event_limit. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant E as Editor UI
participant CFG as Config Store
participant C as Card Renderer
participant CAL as calendar.filterEvents
U->>E: set event_limit (0 or N)
E->>CFG: save config { event_limit, ... }
C->>CAL: filterEvents(events, CFG)
rect rgb(240,248,255)
note right of CAL: apply existing filters (all-day, past, sorting)
CAL->>CAL: filteredEvents = events.filter(...)
end
alt event_limit == 0
CAL-->>C: return filteredEvents
else event_limit > 0
CAL-->>C: return filteredEvents.slice(0, event_limit)
end
C-->>U: render events
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai generate docstrings |
✅ Actions performedDocstrings generation started. |
Docstrings generation was requested by @skateman. * #48 (comment) The following files were modified: * `src/functions/calendar.ts`
|
Note Generated docstrings for this pull request at #49 |
|
Most likely the docstrings are not needed in the context of the PR. |
|
I like it. Thanks! You're right with the docstrings. I'll need to tweak the Coderabbit config. |
|
@JonasDoebertin what else do you need from me to get this in and released? |
I guess it's obvious what this does, if you have many calendar events a day, you might want to limit the list to the next 3-4. The default behavior is to not limit, which happens if it is set to
0.Without a limit:

With a limit:

Summary by CodeRabbit
New Features
Localization
Documentation