Skip to content

Conversation

@Aryan171
Copy link
Contributor

@Aryan171 Aryan171 commented Oct 29, 2025

Purpose / Description

When copying a note in the note editor, the card type was not retained. This PR solves this issue along with solving a solving a race condition in a unit test.

Fixes

How Has This Been Tested?

Tested on an android 15 phone

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Screen recording

WhatsApp.Video.2025-10-30.at.02.51.06_73446498.mp4

A new `EXTRA_NOTE_TYPE_ID` constant is added to `NoteEditorFragment`.
This allows passing the note type ID as an intent extra.
The `AddNote` launcher data class now includes an optional `noteTypeId` parameter. This allows callers to specify the desired note type when launching the NoteEditor to add a new note.
Allow the note type to be specified via `EXTRA_NOTE_TYPE_ID` when creating a new note. If a valid `noteTypeId` is provided, the NoteEditor will pre-select the corresponding note type from the spinner. If no ID is provided or the ID is invalid, it defaults to the first available note type.
When copying a note, the current note's type ID is now explicitly passed to the new NoteEditor instance. This ensures the copied note correctly defaults to the same type as the original.
The `col.notetypes.setCurrent()` call was replaced with the more appropriate `noteEditor.setCurrentlySelectedNoteType()` to set the notetype in the `NoteEditorFragment` test builder.

An `advanceRobolectricLooper()` call was added to ensure the UI updates correctly after setting the notetype.
@BrayanDSO BrayanDSO added Needs Author Reply Waiting for a reply from the original author Needs Review and removed Needs Author Reply Waiting for a reply from the original author labels Oct 30, 2025
@Aryan171 Aryan171 changed the title 19378 card type retention when copying card type retention when copying Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Actual card type must be respected during copy

2 participants