Skip to content

Add 'Do not show again' checkbox to lint confirmation modals#1475

Merged
pjkaufman merged 9 commits intoplaters:masterfrom
jancbeck:suppress-lint-all-files-modal
Apr 18, 2026
Merged

Add 'Do not show again' checkbox to lint confirmation modals#1475
pjkaufman merged 9 commits intoplaters:masterfrom
jancbeck:suppress-lint-all-files-modal

Conversation

@jancbeck
Copy link
Copy Markdown
Contributor

@jancbeck jancbeck commented Mar 3, 2026

Summary

  • Adds a "Do not show this confirmation again" checkbox to the lint confirmation modals (lint-all-files and lint-all-files-in-folder)
  • When checked and submitted, persists the preference to data.json so future invocations skip the modal
  • Single shared flag for both commands
  • No standalone settings toggle — the checkbox on the modal itself is the only UI surface

Motivation

Closes #1474

The confirmation modals block automation workflows — running these commands via Obsidian CLI, MCP, or other programmatic invocations shows a dialog that can't be dismissed without user interaction.

Rather than a standalone settings toggle, the preference is set directly from the modal via a "Do not show again" checkbox, which is more discoverable and follows common UI patterns.

Test plan

  • Run "Lint all files" → modal shows checkbox before buttons
  • Check the box + click Submit → next invocation skips modal entirely
  • Same behavior for "Lint all files in folder"
  • Preference persists across plugin reloads
  • Checkbox absent when saveSuppressPreference callback not provided
  • Setting no longer appears in General settings tab

🤖 Generated with Claude Code

jancbeck and others added 3 commits March 3, 2026 20:17
This allows the lint-all-files command to run without the confirmation
dialog, making it usable from the Obsidian CLI and other automation tools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds translated strings for de, es, ja, ru, tr, and zh-cn locales.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename suppressLintAllFilesConfirmationModal to suppressLintConfirmationModal
so a single toggle suppresses the confirmation modal for both "lint all
files" and "lint all files in folder" commands. This makes the folder
lint command headless/CLI-friendly as well.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jancbeck jancbeck changed the title Add setting to suppress lint all files confirmation modal Add setting to suppress lint confirmation modals Mar 3, 2026
@pjkaufman
Copy link
Copy Markdown
Collaborator

I would prefer this be a "do not show again" checkbox on both the folder and lint all modals. It would get stored in the data.json in order to persist it, but it would not be its own setting.

@pjkaufman
Copy link
Copy Markdown
Collaborator

Going through the CLI will need to be handled via a CLI handler or what have you in order to prevent even asking for the UI confirmation. But that will have to come separately.

@jancbeck jancbeck changed the title Add setting to suppress lint confirmation modals Add 'Do not show again' checkbox to lint confirmation modals Mar 3, 2026
@jancbeck
Copy link
Copy Markdown
Contributor Author

jancbeck commented Mar 3, 2026

@pjkaufman updated PR.

jancbeck and others added 2 commits March 3, 2026 22:54
Move the suppress-confirmation preference from a standalone General
settings toggle into a checkbox rendered directly on the lint
confirmation modals. More discoverable and follows common UI patterns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pjkaufman
Copy link
Copy Markdown
Collaborator

Sorry about the delay. I will go ahead and take a look and see how things look and function.

@pjkaufman
Copy link
Copy Markdown
Collaborator

My main concern from just looking at the code is that the code uses the same logic to suppress both modals. But that may not be the intent. I would expect each modal to have its own setting for suppressing seeing it. That hopefully would not be too bad to implement. But I will look at the actual way in which it works in the app.

@pjkaufman
Copy link
Copy Markdown
Collaborator

pjkaufman commented Mar 12, 2026

Well, it looks like it may have just been added to linting all files instead of also for linting a folder. I will double check this though.

Edit: operator error here. I needed to swap to the branch and check. It looks like both modals do indeed use the same setting, so that would need changing. I can see wanting to suppress the modal for folder lints, but not the lint all functionality as well.

@pjkaufman
Copy link
Copy Markdown
Collaborator

I can attest to the logic working. So it just needs to use one boolean for each of the actual modals (folder and all files).

Copy link
Copy Markdown
Collaborator

@pjkaufman pjkaufman left a comment

Choose a reason for hiding this comment

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

Looks and seems to work good except for one checkbox being used for both modals. If we can get that swapped over to two settings instead of one, this should be good for merging.

Split suppressLintConfirmationModal into suppressLintAllFilesConfirmationModal
and suppressLintAllFilesInFolderConfirmationModal so each modal can be
independently dismissed. Includes migration for existing data.json values.
@jancbeck
Copy link
Copy Markdown
Contributor Author

Split the single suppressLintConfirmationModal boolean into two separate booleans:

  • suppressLintAllFilesConfirmationModal — for the lint-all-files modal
  • suppressLintAllFilesInFolderConfirmationModal — for the lint-folder modal

Each modal's "Do not show again" checkbox now only affects that specific modal. Added migration in loadSettings() to carry over the old setting for existing users.

@aamikus
Copy link
Copy Markdown

aamikus commented Apr 10, 2026

this is a useful change for agentic workflows. let's get this merged

Comment thread src/main.ts Outdated
Copy link
Copy Markdown
Collaborator

@pjkaufman pjkaufman left a comment

Choose a reason for hiding this comment

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

Looks good now that I removed the logic around migrating a setting that does not exist.

@pjkaufman pjkaufman merged commit 5bc9d34 into platers:master Apr 18, 2026
1 check 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.

Bug: Running lint-all-files command doesn't lint all files but shows warning dialog that can't be suppressed

3 participants