Skip to content

feat: add text-based date tokens to default note name template#139

Open
feraranas wants to merge 1 commit intoerictli:mainfrom
feraranas:feat/text-date-tokens-default-note-name
Open

feat: add text-based date tokens to default note name template#139
feraranas wants to merge 1 commit intoerictli:mainfrom
feraranas:feat/text-date-tokens-default-note-name

Conversation

@feraranas
Copy link
Copy Markdown

@feraranas feraranas commented Apr 20, 2026

Usecase I found useful for readability when opening New Notes:

  • Adds five human-readable date tokens to the default note name template: {monthName}, {monthShort}, {weekday}, {weekdayShort}, {dayOrdinal}.

  • Lets users produce names like Note-April-Sunday-19th alongside the existing numeric Note-{year}-{month}-{day}.

Screenshot 2026-04-19 at 10 42 33 p m

Summary by CodeRabbit

  • New Features
    • Enhanced note naming with additional template tags: {monthName}, {monthShort}, {weekday}, {weekdayShort}, and {dayOrdinal}. Users can now use human-readable date formats like "February", "Feb", "Sunday", "Sun", and "15th" in automatic note names.

Adds {monthName}, {monthShort}, {weekday}, {weekdayShort}, and {dayOrdinal}
tokens so users can produce human-readable note names like
`Note-April-Sunday-19th` in addition to the existing numeric variants.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97b5182f-29a1-4c0c-850a-b9e9d4bfacf3

📥 Commits

Reviewing files that changed from the base of the PR and between 6d443e9 and 9efcbae.

📒 Files selected for processing (2)
  • src-tauri/src/lib.rs
  • src/components/settings/GeneralSettingsSection.tsx

📝 Walkthrough

Walkthrough

Added support for English date formatting tags ({monthName}, {monthShort}, {weekday}, {weekdayShort}, {dayOrdinal}) to the note name template system. Backend helper function computes ordinal suffixes; frontend documentation updated to display new placeholder references with examples.

Changes

Cohort / File(s) Summary
Backend Date Formatting
src-tauri/src/lib.rs
Added ordinal_suffix helper function for ordinal number suffixes and extended expand_note_name_template to support new date text tags: {monthName}, {monthShort}, {weekday}, {weekdayShort}, and {dayOrdinal} using chrono's Datelike trait.
Frontend Template Documentation
src/components/settings/GeneralSettingsSection.tsx
Added template-tag reference entries displaying newly supported date placeholders with human-readable examples (e.g., "February", "Feb", "Sunday", "Sun", "15th").

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Hopping through templates with dates so fine,
Ordinal tags and monthNames align,
Weekdays and weekshorts now have their place,
A calendar's dance in note-naming grace! ✨📅

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding text-based date tokens ({monthName}, {monthShort}, {weekday}, {weekdayShort}, {dayOrdinal}) to the default note name template feature.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant