Skip to content

Conversation

@contributor
Copy link
Contributor

@contributor contributor commented Nov 12, 2025

This allows to use date keywords in #dateNote label to create “permanent” date notes like today (#dateNote=TODAY), yesterday (#dateNote=TODAY-1) and so on.

This way you can see which notes have been edited on recent days without using full calendar tree or scroll via Recent Changes modal window.

Example use case: replace keyboard shortcut “Open Today's Journal Note” (#7472) with note label #keyboardShortcut='key-combo' to have today note in single predictable place instead of jumping/expanding calendar tree.

image

MONTH and YEAR keywords are supported too, you can create note like:

  • this month (#dateNote=MONTH)
  • last month (#dateNote=MONTH - 1)
  • this year (#dateNote=YEAR)
  • last year (#dateNote=YEAR - 1)

MONTH and YEAR are seem to be less useful than TODAY. Edited Notes for those are likely to be capped by current 50 note limit in edited-noted sql query (I have not changed the limit in this PR, but for month/year notes it certainly should be higher).

The logic is written to be extendable with “date range” queries in the future. But this will require an additional label. Single label #dateNote is not enough for that.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 12, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @contributor, 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 significantly improves the usability of date-based notes by enabling dynamic date keyword recognition within #dateNote labels. Users can now easily reference "today," "this month," or "last year" notes, along with numerical offsets, streamlining the process of creating and accessing recurring or time-sensitive information. This change centralizes date-related note access and enhances the overall navigation experience.

Highlights

  • Dynamic Date Keywords: Introduced support for 'TODAY', 'MONTH', and 'YEAR' keywords in #dateNote labels, allowing for dynamic date resolution.
  • Relative Date Offsets: Keywords can now include numerical offsets (e.g., 'TODAY-1', 'MONTH+2') to specify relative dates.
  • Refactored Date Note Logic: The 'getEditedNotesOnDate' functionality, including the new 'resolveDateParams' logic, has been moved to a dedicated 'edited-notes.ts' module.
  • Comprehensive Testing: New unit tests have been added for the 'resolveDateParams' function to ensure correct date keyword resolution.
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
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 a great new feature allowing the use of date keywords like TODAY, MONTH, and YEAR for date notes. The implementation is well-structured, involving a clean refactoring of existing logic into a new edited-notes.ts file with its own comprehensive test suite. My review includes a few suggestions to improve robustness, address a functional limitation, and enhance code quality. Overall, this is a solid contribution.

@contributor contributor marked this pull request as draft November 13, 2025 19:53
@contributor contributor force-pushed the edited-notes-recognize-keywords branch from 6690220 to 7c70101 Compare November 16, 2025 18:14
@contributor contributor force-pushed the edited-notes-recognize-keywords branch from 7c70101 to bcff929 Compare November 16, 2025 18:14
@contributor
Copy link
Contributor Author

/gemini review

Copy link
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 a great new feature for recognizing date keywords like TODAY, MONTH, and YEAR. The implementation is well-structured, with the logic correctly extracted into a new edited-notes.ts file and accompanied by a comprehensive test suite.

My review includes a few suggestions to improve robustness and readability:

  • Tightening the validation for date string prefixes.
  • Improving variable naming to avoid shadowing in the React component.
  • A suggestion to enhance the new test suite.
  • Removing some leftover commented-out code.

Overall, this is a solid contribution.

@contributor
Copy link
Contributor Author

contributor commented Nov 16, 2025

Ready for review.

Command to run tests:
pnpm run --filter server test routes/api/edited-notes.spec.ts

Test results:

 ✓ src/routes/api/edited-notes.spec.ts (17 tests) 59ms
   ✓ edited-notes::dateNoteLabelKeywordToDateFilter (17)
     ✓ resolves 'TODAY' to today's date 4ms
     ✓ resolves 'TODAY+1' to tomorrow's date 1ms
     ✓ resolves 'MONTH' to current month 1ms
     ✓ resolves 'YEAR' to current year 1ms
     ✓ resolves 'TODAY-1' to yesterday's date 0ms
     ✓ resolves 'MONTH-2' to 2 months ago 0ms
     ✓ resolves 'YEAR-1' to last year 0ms
     ✓ returns original string for day 0ms
     ✓ returns original string for month 1ms
     ✓ returns original string for partial month 0ms
     ✓ returns original string for partial month with trailing dash 0ms
     ✓ returns original string for year 0ms
     ✓ returns original string for potentially partial day 0ms
     ✓ returns null for partial year 0ms
     ✓ returns null for arbitrary string 0ms
     ✓ returns null for missing delta 0ms
     ✓ resolves 'today' (lowercase) to today's date 0ms

 Test Files  1 passed (1)
      Tests  17 passed (17)
   Start at  20:27:29
   Duration  4.82s (transform 1.02s, setup 49ms, collect 4.19s, tests 59ms, environment 2ms, prepare 211ms)

@contributor contributor marked this pull request as ready for review November 16, 2025 18:29
Copy link
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.

Here I have a few questions and remarks:

This only affects the "Edited Notes" functionality?

If so, do we really need this?

As I user I find it a bit strange that I have a "Today" note that I can write into but it has no other special meaning, apart from the list of edited notes in the ribbon.

Can't this be replicated with already existing functionality such as Saved Search. If not, can we alter that instead? This would have the benefit of actually displaying the results inside the note content instead of just the ribbon.


The other remark is that the documentation also needs to be updated to reflect this new functionality.

@eliandoran eliandoran marked this pull request as draft November 17, 2025 06:39
@contributor
Copy link
Contributor Author

contributor commented Nov 17, 2025

This only affects the "Edited Notes" functionality?

If so, do we really need this?

As I user I find it a bit strange that I have a "Today" note that I can write into but it has no other special meaning, apart from the list of edited notes in the ribbon.

“Today” is a name you chose yourself. You can name it whatever you like (e.g. “Edited Today”) or not create it at all.

Yes, it's a kind of a “pseudo” note. But regular day notes is “pseudo” notes in my use case too. I never write in them. They only exist for Edited Notes functionality - so I can view what was edited this day or this month etc. Most often I need this for today or yesterday notes. And for this, I don't want to dive into full-blown calendar tree to view those (and pollute the tree by auto-creating concrete date notes that will be used once - I even have "auto-expire/auto-delete" task in backlog to remove them, along with search history tree notes and other temporal notes).

Can't this be replicated with already existing functionality such as Saved Search. If not, can we alter that instead? This would have the benefit of actually displaying the results inside the note content instead of just the ribbon.

I tried to use Saved Search for this purpose for years - it didn't work:

  • saved search is unwieldy - you end up with big (hierarchical) tree
  • you cannot navigate up/down in that tree to view notes - eventually it will jump out of saved search note tree to a note's original branch
  • you often need to manually refresh the node to get the children
  • saved search note looks exactly like regular search - easy to inadvertently screw up your crafted search query (and they don't have #readOnly support)

In contrast, “Edited Today” is single note in predicted place in the tree (and with assigned keyboard shortcut). From the edited notes ribbon you open a note you interested in.

(My edited notes has custom styles and looks different from default - the ribbon tab is almost “full screen”, and displays one note link per line, not a heap of links - this is not in the PR).

The other remark is that the documentation also needs to be updated to reflect this new functionality.

I will add the docs if this going to be merged

@contributor contributor changed the title day notes: recognize TODAY keyword edited notes: recognize TODAY keyword Nov 17, 2025
to be compatible with existing search syntax
@contributor
Copy link
Contributor Author

contributor commented Nov 17, 2025

This would have the benefit of actually displaying the results inside the note content instead of just the ribbon.

@eliandoran

I do have a similar feature. It creates temporal note called “Edited notes [date]” with children which are clones of edited notes. It is independent/complimentary to “Edited today”or any note that has “Edited notes” ribbon. This is experimental feature, I don't use it as often as simple “Edited today” note from this PR (which became my “recent inbox cache” (for general quick access) and “inbox memory” (for quick access to notes that moved out of inbox to their (deep-in-tree) proper place)

Reify edited notes

image

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.

2 participants