Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: allow to skip modal prompt in CI/test environment #654

Merged
merged 6 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## 1.119.0 (unreleased)

- Use `QUARTO_VISUAL_EDITOR_CONFIRMED` > `PW_TEST` > `CI` to bypass (`true`) or force (`false`) the Visual Editor confirmation dialogue (<https://github.com/quarto-dev/quarto/pull/654>).

## 1.118.0 (Release on 2024-11-26)

- Provide F1 help at cursor in Positron (<https://github.com/quarto-dev/quarto/pull/599>)
Expand Down
14 changes: 14 additions & 0 deletions apps/vscode/src/providers/editor/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,20 @@ export class VisualEditorProvider implements CustomTextEditorProvider {

// prompt the user
const kVisualModeConfirmed = "visualModeConfirmed";

// Check for environment variables to force the state of the visual editor confirmation modal
// QUARTO_VISUAL_EDITOR_CONFIRMED > PW_TEST > CI
const envVars = [
"CI",
"PW_TEST",
"QUARTO_VISUAL_EDITOR_CONFIRMED"
];
envVars.forEach(envVar => {
if (process.env[envVar] !== undefined) {
this.context.globalState.update(kVisualModeConfirmed, process.env[envVar] === "true");
}
});

if (this.context.globalState.get(kVisualModeConfirmed) !== true) {
const kUseVisualMode = "Use Visual Mode";
const kLearnMore = "Learn More...";
Expand Down