Skip to content

Disable editing of Notes Directory in settings#67

Merged
stanleygomes merged 2 commits intomasterfrom
copilot/disable-notes-directory-change
Mar 12, 2026
Merged

Disable editing of Notes Directory in settings#67
stanleygomes merged 2 commits intomasterfrom
copilot/disable-notes-directory-change

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

Users need to see where notes are stored but should not be able to change that path for now, to avoid file-loss scenarios from directory changes. This PR keeps the setting visible while making the directory field non-editable.

  • Settings UI behavior

    • Updated NotesConfigFormComponent to render the Notes Directory text field as disabled.
    • The field remains visible and populated via existing reset/apply flows; only manual editing is blocked.
  • Targeted coverage

    • Added NotesConfigFormComponentTest to assert the notes directory field is disabled after form construction.
  • Implementation snippet

    notesDirectoryField =
        JBTextField().apply {
            isEnabled = false
        }
  • Screenshot

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:

Original prompt

This section details on the original issue you should resolve

<issue_title>disable notes directory change</issue_title>
<issue_description>### Describe the need of your request

I need to prevent users from changing the folder where they save their notes, as this will cause file loss problems.

Once an improvement has been made to manage these files more effectively, this setting can be reverted.

Therefore, I only need the option to remain on screen, and only the text field where the user types the path to be disabled. This way, they can only see the folder where they are saving their notes.

Additional context

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Disable changing notes directory path Disable editing of Notes Directory in settings Mar 2, 2026
@stanleygomes stanleygomes force-pushed the copilot/disable-notes-directory-change branch from 69325ba to 86dffb7 Compare March 11, 2026 22:21
@stanleygomes stanleygomes marked this pull request as ready for review March 11, 2026 22:22
Copilot AI review requested due to automatic review settings March 11, 2026 22:22
Copilot AI and others added 2 commits March 11, 2026 19:22
Co-authored-by: stanleygomes <5298153+stanleygomes@users.noreply.github.com>
Co-authored-by: stanleygomes <5298153+stanleygomes@users.noreply.github.com>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Disables the Notes Directory text field in the settings UI to prevent users from changing the notes storage path, avoiding potential file-loss scenarios.

Changes:

  • Disabled the notesDirectoryField in NotesConfigFormComponent by setting isEnabled = false
  • Added a unit test to verify the field is disabled after form construction

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
NotesConfigFormComponent.kt Sets isEnabled = false on the notes directory text field
NotesConfigFormComponentTest.kt New test asserting the directory field is disabled

@stanleygomes stanleygomes force-pushed the copilot/disable-notes-directory-change branch from 86dffb7 to 6978625 Compare March 11, 2026 22:23
@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.48%. Comparing base (54c3ec4) to head (6978625).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #67      +/-   ##
==========================================
+ Coverage   40.01%   45.48%   +5.47%     
==========================================
  Files          98       98              
  Lines        1537     1539       +2     
  Branches      189      189              
==========================================
+ Hits          615      700      +85     
+ Misses        901      818      -83     
  Partials       21       21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@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

@stanleygomes stanleygomes merged commit 5daf4c6 into master Mar 12, 2026
8 checks passed
@stanleygomes stanleygomes deleted the copilot/disable-notes-directory-change branch March 12, 2026 01:45
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.

disable notes directory change

4 participants