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

Add warning if selected config has type = 'unknown' #2533

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@
>Edit the Configuration</a
>.
</p>

<p v-if="home.config.active.isUnknownType">
The selected Configuration has an unknown type.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The selected Configuration has an unknown type.
Please set the framework type:

Something slightly more active + describing it as "framework type" might be more helpful for folks. The type hinting will tell them what the values are once they get there (so long as they have evenbettertoml installed), but maybe even tossing in an example?

Copy link
Collaborator

Choose a reason for hiding this comment

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

And FWIW my suggestion there I'm not super excited about please do feel free to wordsmith

Copy link
Collaborator

Choose a reason for hiding this comment

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

The experience of manually updating a configuration from an "unknown" inspection result into a valid one is a rough road. If you haven't tried it, you can recreate the lovely experience by selecting a python file from a hello world example.

Building on what @jonkeane was suggesting, but also considering that we try to keep that text short when warnings/errors are displayed, perhaps you could display a helpful message with further explanation off of an anchor in the warning? I'm visualizing the link opening a modal notification in the center of the IDE with the additional directions, with an OK button to dismiss.

<a
class="webview-link"
role="button"
@click="
onEditConfiguration(home.selectedConfiguration!.configurationPath)
"
>Edit the Configuration</a
>.
</p>

<p v-if="home.config.active.isUnknownError">
The selected Configuration has an error.
<a
Expand Down
8 changes: 8 additions & 0 deletions extensions/vscode/webviews/homeView/src/stores/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,14 @@ export const useHomeStore = defineStore("home", () => {
);
}),

isUnknownType: computed((): boolean => {
return Boolean(
selectedConfiguration.value &&
!isConfigurationError(selectedConfiguration.value) &&
selectedConfiguration.value.configuration.type === "unknown",
);
}),

isUnknownError: computed((): boolean => {
return Boolean(
selectedConfiguration.value &&
Expand Down
Loading