-
Notifications
You must be signed in to change notification settings - Fork 255
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
Remote Source Tile View Implementation #518
Conversation
Great start! I think we should have something for the placeholder images. Definitely like what I am seeing. |
@gep13 first thoughts
|
@punker76 yes, image caching was something that had occurred to me as well. Would need to extend the current control to look in the local cache before reaching out to the interwebs. |
That's weird. If you're using the same control as on PackageView, it is caching. Maybe the the delay is reading from disk?
Agreed.
As well as install/outdated status, preferably. |
@gep13 Sounds like a good idea to me. Also would like to see version and status (installed, outdated, pinned) in the view (maybe as overlays) |
@RichiCoder1 yip, it is the same control as on the package details view. Perhaps the issue is the number of requests at the same time. |
@RichiCoder1 @gep13 @pascalberger @ferventcoder Something for the eye... |
@punker76 to me, this looks like exactly what we want 😄 I think the word |
@gep13 |
Or perhaps the term outdated, which is what Chocolatey itself uses should be in there. Either way, it is a small point, everything else looks 👍 |
@RichiCoder1 there is something up with the caching implementation. Sometimes the Metadata isn't set, which means it goes back out to the internet to fetch the image again. Sometimes it works, sometimes it doesn't 😢 |
The InternetImage try to cache the images for 1 day and do this by adding an expired date as meta data. Setting this with the SetMetadata method for the file storage doesn't work. Requesting of this meta data returns a undefined DateTime. But setting this directly to the meta data of the uploaded image stream works perfectly.
@gep13 @RichiCoder1 Caching images for InternetImage should be fixed now. The InternetImage try to cache the images for 1 day and do this by adding an expired date as meta data. Setting this with the SetMetadata method for the file storage doesn't work. Requesting of this meta data returns a undefined DateTime. But setting this directly to the meta data of the uploaded image stream works perfectly. |
use StretchDirection DownOnly use PackIconEntypoKind.CircleWithCross for error use PackIconEntypoKind.Block for empty urls
extract PackageListTemplate and PackageTileTemplate from ListViewItem use PackagesContextMenu for PackageTileTemplate too TextTrimming for title
@gep13 Intermediate result... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -36,7 +35,8 @@ public partial class InternetImage | |||
"IconUrl", typeof(string), typeof(InternetImage), new PropertyMetadata(default(string))); | |||
|
|||
private static readonly ILogger Logger = Log.ForContext<InternetImage>(); | |||
private static readonly Lazy<BitmapSource> ErrorIcon = new Lazy<BitmapSource>(GetErrorImage); | |||
private static readonly Lazy<ImageSource> ErrorIcon = new Lazy<ImageSource>(() => GetPackIconEntypoImage(PackIconEntypoKind.CircleWithCross, Brushes.OrangeRed)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
to throw my fife cents in: I love what's going on, but I'd prefer a solution close to what Richard suggested - having more concrete borders around elements from the first place, without selecting anything .. (I think it'd be a cleaner interface) |
@mwallner I've thought of that, too... |
@punker76 oooo, this is really starting to shape up, I like it! One point... I think the name of the application should appear above the version number. Also, while I think about it, while I don't dislike the current no icon symbol, I had thought about using a "washed out" version of the Chocolatey Icon, when there isn't a Icon Url defined. What are your thoughts on that? |
@gep13 what do you mean with "washed out"? Name above version... |
@gep13 @RichiCoder1 @ferventcoder maybe I don't know enough about it, but it seems this could work... in var installed = await _chocolateyPackageService.GetInstalledPackages();
var outdated = await _chocolateyPackageService.GetOutdatedPackages();
PageCount = (int)(((double)result.TotalCount / (double)PageSize) + 0.5);
Packages.Clear();
result.Packages.ToList().ForEach(p =>
{
if (installed.Any(package => package.Id == p.Id))
{
p.IsInstalled = true;
}
if (outdated.Any(package => package.Item1 == p.Id))
{
p.IsLatestVersion = false;
}
Packages.Add(Mapper.Map<IPackageViewModel>(p));
}); |
@gep13 @RichiCoder1 @ferventcoder @pascalberger I think I'm done for now, last one is the RadioButton style for the ListViewMode... |
This looks amazing!! The only thing I might change - a watermarked default image when no image is available - that greyed out choco icon (maybe previously mentioned). |
@ferventcoder I am assuming in this case that you are ok with the official Chocolatey Logo being modified? Or should this be an icon that makes it's way into the official Media Kit for Chocolatey? |
This is an official Chocolatey client so 👍 |
@gep13 @ferventcoder also on all other places |
Faster image loading: we don't need to delete the file, cause a upload does: Send file or stream to database. Can be used with file or Stream. If file already exists, file content is overwritten. do not lock over the entire operation
@punker76 so, where are we with this? Is there anything left that you are looking to add? Or is this ready for review? Should/could we add the same tile view to the Local Packages Tab as well? Should/could we add an application level setting which specifies the default view to use within the application? |
I'm done
That would be consistent. But we should do this maybe in a new PR.
👍 |
@punker76 agree on new PR's for other pieces of work. Let's get this part reviewed and pulled in, and we can discuss further. I will try to take it for a proper spin tonight. |
so use `string.Equals(package.Id, p.Id, StringComparison.OrdinalIgnoreCase)` instead `package.Id == p.Id`
@pascalberger Which prev version? The 0.15 or one prev of these PR? And can you try it again with the latest from this PR? Thx. |
@punker76 It was a 0.16 prev version installed over which I installed the version from this PR |
Couldn't reproduce it with the latest build from this PR (but couldn't also reproduce it before either :) ) |
Hmm. Looks like I didn't set a switch on Image Magick's svg conversion to use transparent backgrounds. Will need to enable that.... |
@punker76 just had a play with this, and from what I can see, we can |
@gep13 👏 so let me create the next one for the local view 😉 |
Relates to #517 |
@RichiCoder1 @ferventcoder @punker76 @mwallner @pascalberger This is VERY much a Work In Progress, but I just wanted to put this out there for discussion.
What are your immediate thoughts on this?
User can switch between List and Tile view using buttons here:
Existing list view stays exactly the same as it is, but when switching to Tile, you see "something" like the following:
Interesting side effect of the InternetImage control that we are using, that when you first hit the new tile view, you see something like this:
So thoughts? Good idea? Bad idea? What needs to be different?