templating icon indicating copy to clipboard operation
templating copied to clipboard

Improve UX for creating a Blazor Web App when selecting None for the interactivity type

Open danroth27 opened this issue 2 years ago • 15 comments
trafficstars

When creating a Blazor Web App, if you select None for the interactivity type then you can still select an interactivity location, which doesn't make any sense. Is there some way to disable the interactivity location option when the interactivity type is None? On the CLI should we make this an error?

danroth27 avatar Sep 26 '23 05:09 danroth27

@vlada-shubina this is a templating engine issue I believe. We've already setup the template to allow only one of these options but it seems the CLI ignores those. Where should I transfer this issue to for you to investigate?

mkArtakMSFT avatar Sep 26 '23 16:09 mkArtakMSFT

To clarify further, the behavior that would make most sense is:

  • On CLI, setting an option that's not enabled according to isEnabled should ideally be an error. The option shouldn't simply be ignored.
  • In VS, when an option isn't available according to isEnabled, it should be greyed out in the UI or even removed from the UI completely

If you don't want to add these behaviors to the existing isEnabled option, would you consider adding a new option called something like isAllowed with these behaviors?

SteveSandersonMS avatar Sep 26 '23 16:09 SteveSandersonMS

This is a request for the template engine

javiercn avatar Sep 27 '23 16:09 javiercn

We have an additional similar need in an upcoming Blazor Hybrid + Web project template scenario.

I want to have a UI in VS like this:

Create new Blazor Hybrid project

  • ✅ Include Blazor Web project with shared Razor UI
  • ✅ Configure for HTTPS (but ONLY enabled if previous checkbox is checked!)
  • ... and more options

In VS it would look like this when the top checkbox is checked:

image

And when it's unchecked:

image

As far as template.json syntax, I think it already exists, but apparently isn't supported in VS? See: https://github.com/dotnet/templating/issues/5648#issuecomment-1322400549, https://github.com/dotnet/templating/issues/3341

And it seems Blazor already uses isEnabled in its templates for this scenario: https://github.com/dotnet/aspnetcore/blob/d7109b13bcc87601227ab4d643638dbeb6a87295/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/.template.config/template.json

Eilon avatar Apr 03 '24 22:04 Eilon

cc @phenning for the VS template engine host request - conditional symbols would be the solution here but they are only supported in the CLI at the moment.

baronfel avatar Apr 03 '24 22:04 baronfel

Yup I just chatted with @phenning earlier today about this. We have workarounds for now but I think the best customer UI for our scenarios would require this new feature.

Eilon avatar Apr 04 '24 00:04 Eilon

I also need this VS feature. I have a custom template and I want to hide or disable certain parameters based on a checkbox. It's a really bad user experience without this ability.

Arclight3 avatar Apr 09 '24 10:04 Arclight3

@baronfel is there a different team we need to complain to for the VS pieces?

Banner-Keith avatar Apr 19 '24 17:04 Banner-Keith

Submitting feedback via the VS Developer Community would be the way to go. That'll get routed to @phenning and the rest of the team and can be used to help prioritize their backlog.

baronfel avatar Apr 19 '24 17:04 baronfel

@baronfel I found this one. I am assuming this covers this scenario and we should just go vote for it> https://developercommunity.visualstudio.com/t/conditional-parameter--hideshow-fields-/10254783

Banner-Keith avatar Apr 19 '24 17:04 Banner-Keith

@sayedihashimi @vijayrkn What's the best way for us to make progress on this issue? Are you already tracking https://developercommunity.visualstudio.com/t/conditional-parameter--hideshow-fields-/10254783 on the VS side?

danroth27 avatar May 07 '24 22:05 danroth27

@danroth27 we have move the item to our team. We will investigate. Hopefully this will be easy to implement, otherwise we may need to wait on adding this support. We will take a look to see how much effort this will take and then go from there.

Should we consider this an ask from the ASP.NET team to get this support added?

sayedihashimi avatar May 08 '24 16:05 sayedihashimi

Should we consider this an ask from the ASP.NET team to get this support added?

Yes, this is needed to improve the user experience for both the Blazor Web App template and the upcoming Blazor Hybrid + Web template.

danroth27 avatar May 08 '24 17:05 danroth27

@danroth27 thanks, we are investigating.

sayedihashimi avatar May 08 '24 17:05 sayedihashimi

@danroth27 thanks, we are investigating.

How far with the investigation?

prince272 avatar Jul 28 '24 09:07 prince272