phosphorjs / phosphor

The PhosphorJS Library
BSD 3-Clause "New" or "Revised" License
1.04k stars 169 forks source link

Tearing off DockPanel tabs into floating dialogs #308

Open jjrv opened 7 years ago

jjrv commented 7 years ago

phosphor-float-area now adds support for tearing tabs off DockPanels into freely movable dialogs.

Best to see the online demo first.

Features in the demo:

Could this be linked from the PhosphorJS docs / readme? Any further improvements needed for that to happen?

Currently adding useful content in the "Main" area (under the dialogs) requires subclassing the FloatArea widget. Next step is to allow passing it a separate background widget which will then always stretch to fill the FloatArea and remain under all dialogs. In my application it will show a zoomable world map.

jasongrout commented 7 years ago

Wow, that demo is pretty nice! Thanks for sharing this!

jjrv commented 7 years ago

Hopefully it's useful for others. My intention is to maintain it and make it easy to include in any PhosphorJS apps.

Some other ideas:

Those could be buttons or popup menu options when right-clicking the dialog drag handle or edges.

jjrv commented 7 years ago

The included demo itself is somewhat interesting. When developing it only requires 5 other NPM packages (counting the entire dependency hierarchy except PhosphorJS) for the whole pipeline of compiling TypeScript and serving it to a browser together with necessary CSS.

Meanwhile during development PhosphorJS example-dockpanel depends on 315 packages...

I'm a big fan of SystemJS and TypeScript IDEs with compileOnSave to minimize build system bloat.

nmichaud commented 6 years ago

@jjrv This implementation looks interesting. What's the use case for having free dialogs that are constrained to the browser window?

jjrv commented 6 years ago

@nmichaud In my case, floating toolbars and other controls over a world map. You can see that kind of interface for example in Photoshop or Illustrator.

If you were to turn them into separate browser windows, then interacting with the main window would immediately hide the floating windows under it. In my opinion this is a worse user experience than windows always floating on top, even if their movement is constrained.