jesseduffield / lazydocker

The lazier way to manage everything docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Correct previous view behaviour

bravmi opened this issue · comments

First of all thanks a lot for your work <3
And an excuse to dig deep(er) into go! :)

Return from shell

Let's say we start at the containers view
// action: current view - previous views stack (from the top)
init: containers - []
switch to: images - [containers]
switch to: containers - [images]
shell and back: images - []
But I think it makes much more sense to stay at containers from where we fired a shell.

Function of interest: gui.RunWithSubprocesses
Currently we push to the stack, then run a command, then pop what we pushed, which doesn't seem to change anything. I propose to change the order of push and pop, so that containers view got properly restored on return.

Return from context menu

Let's say we start at the containers view
// action: current view - previous views stack
init: containers - []
switch to: images - [containers]
switch to: menu - [images containers]
switch to: bulk - [containers]
cancel: containers - []
But again probably we should've returned to images from where the menu got invoked.

Functions of interest:
gui.returnFocus
Currently we push the previous view only if it's not a popup but pop regardless. I propose we do the pop in only if the current view is not a popup, why pop if we didn't push for it?
gui.switchFocus
Pop here is needed so that the views don't stack.

Tested on current master (12 Jan), ubuntu 18.04

Here's my stab at that: #297

ezoic increase your site revenue