sharpenrocks / Sharpen

Visual Studio extension that intelligently introduces new C# features into your existing codebase
https://sharpen.rocks
MIT License
418 stars 32 forks source link

Add About Dialog #32

Open ironcev opened 4 years ago

ironcev commented 4 years ago

The About Dialog should roughly look like this:

image

The dialog cannot change its window size. Pick up a size that is not too small and not too big and can fit on a 14" laptop screen ;-)

About Tab

If there is an internet connection fetch the data from GitHub and VS Marketplace and display them. If not or if any error happens during fetching do not display anything.

This might be useful:

Version History Tab

The Version History tab lists the versions on one side and when a version is selected the details for that version are displayed on the left:

image

To render the details use WPF Documents.

The whole content of the Version History tab should be generated on the fly based on the content of the Changelog file.

This might be useful:

afrlan commented 4 years ago

Oh, looks like a nice challenge. It is good first issue.

afrlan commented 4 years ago

Unfortunately, markdowntextblock requires Universal, 10.0.16299.0 or higher. I suppose we won't be changing project type to accomodate that (it's usable only on win10 and higher). I have several options: unpack that control or use stack panel with scroll viewer. Second option is a bit brute-force. I'm inclined using second option.

ironcev commented 4 years ago

Thanks for investigating the issues further @afrlan! No, we will not go for Universal. Markdowntextblock is a convenience but not strictly necessary. The Markdown that we have in the CHANGELOG is rather simple and it will remain simple. I would experiment with a combination of parsing Markdown using Markdown parser and creating the WPF Document based on the parsed Markdown document. Maybe it makes sense to experiment a bit with the Markdown Renderers supported by the parser. Whatever is easier and more convenient to build the WPF document.

ironcev commented 4 years ago

One generall remark and requirement actually. To speed up the development of the About Dialog and also in the future of other dialogs that are not embedded into VIsual Studio we need a possibility to develop the dialog without the need to run the Sharpen extension inside of Visual Studio. This is important for iterating quickly and also to try out the Dialog(s) in different circumstances e.g. in the case of the About Dialog to see how it behaves when the internet connection is not available and the number of e.g. Github stars is not displayed.

A typical way to do this is to have a separate tryout project and to (mis)use some unit testing framework as a runner for displaying the dialog.

afrlan commented 4 years ago

I started developing in "Lab" folder. After I complete it, i'll transfer it to Solution as separate project. It doesn't require any starting parameters.

Should navigation, if possible be in VisualStudio, as for "Learn more..." links, or should it always open in default browser?

ironcev commented 4 years ago

Ok Lab is the right place to put it so far because there is a plenty of experimenting involved. In the next step we will need a “tryout” project for regular development.

ironcev commented 4 years ago

The links should open in the standard browser.

afrlan commented 4 years ago

Markdown parser expects somewhat different format of ReleaseNotes.txt (https://en.wikipedia.org/wiki/Markdown)

Headings2 should be preceded with ##; bulletpoints should be marked * instead of -.

There are 2 obvious options going forward: I can parse ReleaseNotes.txt as is, adding additional options as need arises, or we can rewrite the document using expected notation.

ironcev commented 4 years ago

ReleaseNotes.txt is actually a “txt”fied version of the CHANGELOG.md file because VS install dialog does not support Markdown. We can use changelog file as an input since it is a proper Markdown file. We can also parse ReleaseNotes as proposed which will also work fine for now but it might be that in the future we will have e.g. links in the Markdown or something (in the changelog). So parsing the changelog would be a better option.

Note that at the moment Changelog is not a part of the package and the ReleaseNotes are created manually out of the changelog.

afrlan commented 4 years ago

I'll get changelog.md and add it to my project.

afrlan commented 4 years ago

I believe about box is ready for tryout phase.

ironcev commented 4 years ago

☺☺ Awesome! Does it mean you will do a pull request now with the lab version or you have something else on your mind when you say "tryout"?

afrlan commented 4 years ago

Let's try.

Several notes: It loads assembly information from project. (It should, eventualy, be part of project.) I tried something with threetool and it remained part of my commits. I'll re-fork master after this goes throug.

Also, I'll rework markdown => flowdocument to be a bit more general, but that can be a separate issue.

ironcev commented 3 years ago

@afrlan When you start adding the About Dialog to Sharpen extension be aware that you have to derive the dialog from the DialogWindow as explained here: https://docs.microsoft.com/en-us/visualstudio/extensibility/creating-and-managing-modal-dialog-boxes?view=vs-2019