Skip to content

feature: Add this_day filter#5637

Open
d-jankowski wants to merge 1 commit intousememos:mainfrom
d-jankowski:this-day-filter
Open

feature: Add this_day filter#5637
d-jankowski wants to merge 1 commit intousememos:mainfrom
d-jankowski:this-day-filter

Conversation

@d-jankowski
Copy link
Contributor

@d-jankowski d-jankowski commented Feb 16, 2026

Description

Adds a new this_day() CEL filter function that matches memos created on today's month-day in any year. Supports all three database dialects (SQLite, MySQL, PostgreSQL).

Changes

  • Add ThisDayCondition IR node in the filter pipeline.
  • Register this_day as a zero-arg boolean CEL function in the memo schema.
  • Parse this_day() calls into ThisDayCondition in the filter parser.
  • Render dialect-specific SQL comparing created_ts month-day against current date for SQLite, MySQL, and PostgreSQL.
  • Add CreatedTs builder method to test helpers for setting custom creation timestamps.
  • Add tests covering basic matching, combined filters, no-match, and negation.

Usage

this_day()                          # memos created on today's month-day in any year
this_day() && tag in ["work"]       # combine with other filters
!this_day()                         # exclude today's date matches

Related Issue

Resolves #5633

Testing

Manual

  1. Create a new shortcut with this_day() in the Filter field and save it.
  2. Create several memos, then edit their creation dates to fall on today's month-day but in different years (e.g., 2024, 2023).
  3. Create additional memos with creation dates that do not match today's month-day.
  4. Apply the shortcut. Only the memos from step 2 should appear.

Automated

  • TestMemoFilterThisDay - matches today + same day last year, excludes different day.
  • TestMemoFilterThisDayCombinedWithOtherFilters - combines with tag filter.
  • TestMemoFilterThisDayNoMatches - only different-day memos, expects 0 results.
  • TestMemoFilterThisDayNegated - verifies !this_day() negation.

@boojack boojack self-requested a review as a code owner February 24, 2026 14:23
@boojack boojack force-pushed the main branch 2 times, most recently from 2b6b987 to 47d9414 Compare February 24, 2026 14:54
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.

Show memos created on this day across all years

1 participant