From b6b5373999d7199535cb13490502d5723eb03d1b Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 22 Oct 2022 19:51:51 -0700 Subject: [PATCH] fix some glitchiness caused by indeterminate sorting --- pkg/commands/container.go | 6 ------ pkg/gui/images_panel.go | 10 +++++++++- pkg/gui/list_panel.go | 1 - 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/commands/container.go b/pkg/commands/container.go index 2756cafa..669f4897 100644 --- a/pkg/commands/container.go +++ b/pkg/commands/container.go @@ -35,7 +35,6 @@ type Container struct { ProjectName string ID string Container types.Container - DisplayString string Client *client.Client OSCommand *OSCommand Config *config.AppConfig @@ -140,11 +139,6 @@ func (c *Container) GetDisplayCPUPerc() string { return utils.ColoredString(formattedPercentage, clr) } -// ProducingLogs tells us whether we should bother checking a container's logs -func (c *Container) ProducingLogs() bool { - return c.Container.State == "running" && c.DetailsLoaded() && c.Details.HostConfig.LogConfig.Type != "none" -} - // GetColor Container color func (c *Container) GetColor() color.Attribute { switch c.Container.State { diff --git a/pkg/gui/images_panel.go b/pkg/gui/images_panel.go index a11e60cd..1d405eab 100644 --- a/pkg/gui/images_panel.go +++ b/pkg/gui/images_panel.go @@ -52,7 +52,15 @@ func (gui *Gui) getImagesPanel() *SideListPanel[*commands.Image] { return true } - return a.Name < b.Name + if a.Name != b.Name { + return a.Name < b.Name + } + + if a.Tag != b.Tag { + return a.Tag < b.Tag + } + + return a.ID < b.ID }, getDisplayStrings: func(image *commands.Image) []string { return []string{image.Name, image.Tag, utils.FormatDecimalBytes(int(image.Image.Size))} diff --git a/pkg/gui/list_panel.go b/pkg/gui/list_panel.go index 0c37c1da..f9101283 100644 --- a/pkg/gui/list_panel.go +++ b/pkg/gui/list_panel.go @@ -96,7 +96,6 @@ type IGui interface { FocusY(selectedLine int, itemCount int, view *gocui.View) ShouldRefresh(key string) bool GetMainView() *gocui.View - PopupPanelFocused() bool // TODO: replace with IsCurrentView() bool CurrentView() *gocui.View FilterString(view *gocui.View) string