lirantal / dockly

Immersive terminal interface for managing docker containers and services

Home Page:https://lirantal.github.io/dockly/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better handling for modal windows / child windows - layer manager?

triforcely opened this issue · comments

This is more like an invitation to the discussion about the architecture of dockly than bug report at this point

Expected Behavior

You shouldn't be able to lose focus from the active dialog (like m:menu widget). As a contributor, I would like to define correct way of handling this problem in the future.

Actual Behavior

You can permanently lose focus when the tab is pressed while 'm'enu is open. There is no easy way of implementing "windows" displayed on top of the current screen.

What (I believe) is needed

Currently when we want to display something on top of current screen, widget is simply appended to the grid with layout settings. This looks fine but widgets "under" dialog can still be focused and they will receive events unless they are explicitly cancelled.

It would be nice to have some kind of layer system, where whenever dialog/window (like previously mentioned ones) are needed to be displayed, we could simply specify:

  • widget (content of our window)
  • layout (to position/define size of the window)
  • toolbar items (toolbar would be context sensitive - users would always see available actions and it would be impossible to trigger some action from the window behind active dialog)
    • this improves UX (e.g. when i:info is currently open it doesn't make much sense for /:search to be enabled)
    • helpful for power users (e.g. pressing "md" in a sequence would open the menu, select and confirm "delete container" action)

After that, widget and toolbar will be displayed as a new layer and users will be able to interact only with it (unless it is closed or new modal window is displayed on top of it).


I believe that this could be very helpful for me and other contributors interested in implementing additional functionality or more advanced flows based on windows/pop-ups/dialogs. Such layer manager could nicely isolate the widgets from each-other.

Let me know if you think something like that would be a welcome addition to the project. Maybe my idea is too complicated and I'm missing some obvious solutions to the problem? Let's have a brainstorming session!

Hey @triforcely did you have any drafts/ideas on how to implement this Layer Manager?

Yes, I was thinking of creating something like abstract "view" which could be pushed/popped to/from Layer Manager. But maybe I'm overthinking it and missing some simple solution?

I'll try to come up with a PoC for this feature in a few days but don't expect it too soon - don't let this issue block other work in the repository 😃

I'm closing this issue because after some time of thinking I realized that it might be unnecessary at this point.