Skip to content

Comments

fix: re-open note after rename to prevent editor tab from closing#53

Merged
stanleygomes merged 3 commits intomasterfrom
copilot/fix-issue-51-description
Feb 20, 2026
Merged

fix: re-open note after rename to prevent editor tab from closing#53
stanleygomes merged 3 commits intomasterfrom
copilot/fix-issue-51-description

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

When a note is open in the editor and gets renamed, the editor tab closes because it was tracking the old file path, which no longer exists post-rename.

Changes

  • RenameNoteService: Injects OpenNotesService as a constructor parameter (default instance provided) and calls openAll() after a successful rename, so the note re-opens with the updated file path.
  • RenameNoteServiceTest: Adds tests covering the happy path (note re-opened after rename), rename failure (no open call), and user cancellation (no open call).
class RenameNoteService(
    private val openNotesService: OpenNotesService = OpenNotesService(),
) {
    // ...
    private fun performRename(...) {
        if (FileHelper.renameFile(note.filePath, newFileName)) {
            note.title = newTitle
            note.filePath = FileHelper.getNewFilePath(note.filePath, newFileName)
            NoteStorageRepository.getInstance().updateNote(note.id, newTitle)
            openNotesService.openAll(project, listOf(note)) // re-open with new path
        }
    }
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.jetbrains.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix issue #51 by updating note description handling fix: re-open note after rename to prevent editor tab from closing Feb 19, 2026
Copilot AI requested a review from stanleygomes February 19, 2026 13:37
@stanleygomes stanleygomes marked this pull request as ready for review February 19, 2026 15:46
Copilot AI and others added 2 commits February 19, 2026 18:25
Co-authored-by: stanleygomes <5298153+stanleygomes@users.noreply.github.com>
@stanleygomes stanleygomes force-pushed the copilot/fix-issue-51-description branch from d630164 to b50f6de Compare February 20, 2026 04:28
@github-actions
Copy link

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2025.1.1
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

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.

2 participants