Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use terminal editor for Edit Collection action #263

Merged
merged 1 commit into from
Jun 13, 2024
Merged

Conversation

LucasPickering
Copy link
Owner

Description

Describe the change. If there is an associated issue, please include the issue link (e.g. "Closes #xxx"). For UI changes, please also include screenshots.

Instead of using the default system editor for .yml files when launching the Edit Collection action, we now defer to the $VISUAL/$EDITOR env vars. This means we will probably open a text-based editor like vim, where previously it was likely a GUI editor like VSCode. This could potentially be annoying but I think in most cases will be more convenient for users. If we get complaints we can make it configurable.

This also includes a new utility EnvGuard, which should be used in tests that access environment variables. Since the process environment is global mutable state, tests that access and modify it can fight with each other. This mutex ensures the tests each take their turn. It also makes it easy for them to clean up after themselves.

Closes #262

Known Risks

What issues could potentially go wrong with this change? Is it a breaking change? What have you done to mitigate any potential risks?

This is a change in functionality that could potentially break someone's workflow. In general I think it will be an improvement but it could be annoying for some users.

QA

How did you test this?

Manual testing in TUI, added some unit tests

Checklist

  • Have you read CONTRIBUTING.md already?
  • Did you update CHANGELOG.md?
    • Only user-facing changes belong in the changelog. Internal changes such as refactors should only be included if they'll impact users, e.g. via performance improvement.
  • Did you remove all TODOs?
    • If there are unresolved issues, please open a follow-on issue and link to it in a comment so future work can be tracked

Instead of using the default system editor for `.yml` files when launching the Edit Collection action, we now defer to the `$VISUAL`/`$EDITOR` env vars. This means we will probably open a text-based editor like vim, where previously it was likely a GUI editor like VSCode. This could potentially be annoying but I think in most cases will be more convenient for users. If we get complaints we can make it configurable.

Closes #262
@LucasPickering LucasPickering merged commit 166434d into master Jun 13, 2024
7 checks passed
@LucasPickering LucasPickering deleted the vim-editor branch June 13, 2024 20:49
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.

Allow editing of collections with $EDITOR, or a way to configure the same
1 participant