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

GUI rework #399

Merged
merged 2 commits into from
Jul 6, 2023
Merged

Conversation

mark2185
Copy link
Contributor

This should make dive much more user friendly, in the sense that all the information is now available, irregardless of the number of layers, or the length of a certain command.

The Layer Details and Image Details panes are now selectable with the arrow keys (left and right) and can be scrolled with the arrow keys (up and down). The Image Details pane can even be scrolled with Page Up and Page Down.

I've taken the commit from #395 as well since it fixes a common issue, and I want this PR to be tested by users so why not.

This should close the following issues (and possibly more, I may have missed some):

@wagoodman I know you're busy, but I'd really like your feedback on this. I've had a great deal of fun learning the ins and outs of the project and I'll continue with solving the other issues, but I'd also like to hear your plans for dive (if any), and for this all to eventually be merged into master.

Instead of printing out multiple lines for some steps in Layer section,
now its only printing one line while other informations can be found in
Layer details. This change also provides fix for index out of bounds
error when user scrolls through steps in Layer section and there exists
at least one step with multi-line commands.
@mark2185 mark2185 force-pushed the feature/gui-layout-rework branch 4 times, most recently from b636f26 to 25194cc Compare April 29, 2022 22:05
The Details struct was split into two, LayerDetails and ImageDetails,
Each of the three views (Layer, LayerDetails, ImageDetails) takes up
a third of the available height of the screen, and they are all now
selectable and scrollable.
Copy link

@huanyang01 huanyang01 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@InCogNiTo124 InCogNiTo124 left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@mkep-dev
Copy link

This PR is now pending for a while but it would be great if you bring it to master.
So in case it was forgotten: A short reminder ;)

@mark2185
Copy link
Contributor Author

This PR is now pending for a while but it would be great if you bring it to master. So in case it was forgotten: A short reminder ;)

Don't hold your breath, the project hasn't been active in a while.

@mkep-dev
Copy link

mkep-dev commented Feb 27, 2023

Is there any hope, someone performs some kind of CPR? :D

@mark2185
Copy link
Contributor Author

Sure, feel free to tackle any issues you would like to see solved, just like this one!

I'm sure others will appreciate it!

@saran001
Copy link

@mark2185 Do you have a docker image that has these GUI changes? I have this UI issue as well where I can't scroll-down to see the Image and Layer details.

@mark2185
Copy link
Contributor Author

No, but you can just check out my branch and build it from source.

@saran001
Copy link

No, but you can just check out my branch and build it from source.

I tried building the exe from my laptop (Windows OS) using the "go build" cmd, but when I use the generated .exe to run in a SLES Linux server, it's failing with the error : bash: ./dive.exe: cannot execute binary file: Exec format error

@saran001
Copy link

@mark2185 Can you help me by providing the necessary build steps for me to set it up in my SLES server? Thanks. (NOTE : I'm able to run wagoodmans' RPM dive version, maybe is there any way we can build yours' as an rpm one?)

@mark2185
Copy link
Contributor Author

I tried building the exe from my laptop (Windows OS) using the "go build" cmd, but when I use the generated .exe to run in a SLES Linux server, it's failing with the error : bash: ./dive.exe: cannot execute binary file: Exec format error

You need to cross-compile.

Try changing the Makefile like this:

diff --git a/Makefile b/Makefile
index 4978254..76d7752 100644
--- a/Makefile
+++ b/Makefile
@@ -121,7 +121,7 @@ run-ci: build
 	CI=true $(BUILD_PATH) dive-example:latest --ci-config .data/.dive-ci
 
 build: gofmt
-	go build -o $(BUILD_PATH)
+	go build -o $(BUILD_PATH) -ldflags="-s -w -extldflags=-static"
 
 generate-test-data:
 	docker build -t dive-test:latest -f .data/Dockerfile.test-image . && docker image save -o .data/test-docker-image.tar dive-test:latest && echo 'Exported test data!'

Then build it in a docker, just run make dev and when it boots up run make. It'll download the dependencies and build a statically built binary dist/dive_linux_<cpuarch>/dive that you can copy to your linux server.

@@ -39,5 +41,5 @@ func (l *Layer) String() string {
}
return fmt.Sprintf(LayerFormat,
humanize.Bytes(l.Size),
l.Command)
strings.Split(l.Command, "\n")[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using the solution from #443 instead - replace newlines with the ↵ character but still show the whole command, in case the first line isn't very informative.

(Also, FYI, strings.Split(...)[0] is equivalent to strings.Cut)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the whole command is shown in the Layer details pane, this isn't much of a help, although it does help a bit. I'll cherry pick it, thanks!

@wagoodman
Copy link
Owner

Thanks for your time on this -- and sorry it took me so long to get to it! The polish looks wonderful, I'll try to get this released 🙌

@wagoodman wagoodman merged commit 8bf4341 into wagoodman:master Jul 6, 2023
@mark2185
Copy link
Contributor Author

mark2185 commented Jul 6, 2023

Thanks for getting around to it, I really appreciate it, even if it took a little while! :)

@gee-forr
Copy link

gee-forr commented Jul 7, 2023

Looking forward to seeing a new release version available with these changes!

@mark2185
Copy link
Contributor Author

mark2185 commented Jul 7, 2023

Do note that #447 introduced a regression by bumping up gocui, the scrolling feature is gone now, but I haven't had the time to look into it, only bisect it.

@sschuberth
Copy link

Do note that #447 introduced a regression by bumping up gocui, the scrolling feature is gone now, but I haven't had the time to look into it, only bisect it.

Should #181 be reopened then?

@mark2185
Copy link
Contributor Author

@sschuberth that's correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
10 participants