Skip to content

Add duplicate notes action#806

Merged
Crustack merged 2 commits intomainfrom
feat/493
Jan 27, 2026
Merged

Add duplicate notes action#806
Crustack merged 2 commits intomainfrom
feat/493

Conversation

@Crustack
Copy link
Owner

@Crustack Crustack commented Jan 27, 2026

Closes #493

  • Adds "Duplicate" Action to Notes Overview
  • Adds "Duplicate" Action to Not More Actions

Summary by CodeRabbit

New Features

  • Added note duplication capability enabling users to create copies of existing notes
  • Duplicated notes automatically receive updated titles for easy identification
  • Duplicate action accessible via note action menu and bulk selection toolbar
  • Supports duplicating single notes and multiple selected notes in batch operations

Chores

  • Updated translation coverage statistics

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 27, 2026

📝 Walkthrough

Walkthrough

This PR implements a note duplication feature across the application. It adds UI elements for duplicating notes (menu items and bottom sheet actions), introduces model methods to copy and persist duplicated notes with updated metadata, and refactors navigation logic into a reusable extension function.

Changes

Cohort / File(s) Summary
Core Duplication Logic
app/src/main/java/com/philkes/notallyx/presentation/viewmodel/BaseNoteModel.kt
Added three public suspend/regular functions: duplicateNote(), duplicateNotes(), and duplicateSelectedBaseNotes(). These methods create note copies with new IDs, append "copy" suffix to titles, update timestamps, and persist via DAO. The selected-notes variant also closes action mode and displays a toast.
Navigation Refactoring
app/src/main/java/com/philkes/notallyx/utils/AndroidExtensions.kt, app/src/main/java/com/philkes/notallyx/presentation/activity/note/EditNoteActivity.kt
Added openNote() Activity extension function to centralize navigation logic (routes to EditNoteActivity or EditListActivity based on note type, optionally clears back stack). Refactored EditNoteActivity to use this helper instead of manual Intent construction and conditional routing.
UI Action Integration
app/src/main/java/com/philkes/notallyx/presentation/activity/main/MainActivity.kt, app/src/main/java/com/philkes/notallyx/presentation/view/note/action/MoreNoteBottomSheet.kt
Added duplicate menu item to MainActivity action mode for NOTES and ARCHIVED folders (content_copy icon). Extended MoreActions interface with duplicate() method and added corresponding action to bottom sheet. Both trigger duplication callbacks.
Note Editing
app/src/main/java/com/philkes/notallyx/presentation/activity/note/EditActivity.kt
Added duplicate() override function that saves the current note, duplicates it via viewmodel, and navigates to the new note with back stack cleared. Imported openNote utility.
String Resources
app/src/main/res/values/strings.xml
Added string resource duplicate and plurals resource duplicated_notes with singular/plural variants for UI labels and toast messages.
Translation Statistics
TRANSLATIONS.md
Updated Coverage table entries from 326/326 to 328/328 for all languages, reflecting new string additions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 With whiskers twitched and ears held high,
I've added buttons, can't deny!
Duplicate notes with just a tap—
Copy, save, and close the gap! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
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.
Out of Scope Changes check ❓ Inconclusive The pull request introduces a potential concern: a duplicate method appears twice in EditActivity.kt, which may be an unintended duplication outside scope. Verify whether the duplicate() method appearing twice in EditActivity.kt is intentional or an accidental duplication that should be removed.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add duplicate notes action' is concise and clearly summarizes the main change: introducing a duplicate functionality for notes.
Linked Issues check ✅ Passed All code changes comprehensively implement the requirement to add a duplicate action accessible from both Notes Overview and More Actions menu [#493].

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@Crustack Crustack merged commit dea32af into main Jan 27, 2026
1 check passed
@Crustack Crustack deleted the feat/493 branch January 27, 2026 18:19
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.

Button to make a copy of note

1 participant