Skip to content

feat: persist last open note and add currency pills#4

Merged
VariableThe merged 1 commit into
mainfrom
feature/currency-and-open-note
Jun 15, 2026
Merged

feat: persist last open note and add currency pills#4
VariableThe merged 1 commit into
mainfrom
feature/currency-and-open-note

Conversation

@VariableThe

@VariableThe VariableThe commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Enhanced editor now recognizes and highlights currency values with distinct visual styling for better readability
    • App now remembers and automatically restores the last opened note when you return
  • Style

    • Added teal-themed visual styling for currency value formatting

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d24b3c7c-2be7-4be9-9e21-0dfbaf2ef598

📥 Commits

Reviewing files that changed from the base of the PR and between e0524df and 65084de.

📒 Files selected for processing (2)
  • src/App.css
  • src/App.tsx

📝 Walkthrough

Walkthrough

Two features are added to App.tsx and App.css: a currency value decoration pass in the CodeMirror editor that regex-matches common currency formats and applies teal pill/highlight styles, and localStorage-based persistence that saves and restores the last-opened note's id across sessions.

Changes

Currency Highlighting and Note Persistence

Layer / File(s) Summary
Currency decoration: regex pass and CSS styles
src/App.tsx, src/App.css
A new "Currency Formats" pass in the decoration builder regex-matches currency strings (common symbols + numeric formats) and applies cm-currency-pill or cm-currency-highlight based on cursor overlap. Two matching teal-themed CSS selectors define pill border/color and highlight background.
Last-opened note persistence
src/App.tsx
A useEffect writes the active note's id to localStorage key papercache-last-open-note on currentNoteIndex changes. The initial notes-loading flow reads that key and sets currentNoteIndex to the matching note index when found.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop, hop — I found a coin!
A teal little pill where dollars join,
And when I close my burrow door,
My last-read note waits as before.
The carrot stays where I left it, hooray!
No searching through the warren today. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures both main changes: persisting the last open note and adding currency pill styling for visual highlighting.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/currency-and-open-note

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.

@VariableThe VariableThe merged commit c0d1328 into main Jun 15, 2026
3 checks passed
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