lmparppei / Beat

Beat - a simple and elegant screenwriting app for macOS
Other
175 stars 30 forks source link

Suggestions: put plugin window in same screen/"space" as corresponding document + make plugin window(s) of current document frontmost plugin window(s) #85

Closed ftolsson closed 2 years ago

ftolsson commented 2 years ago

For when you have the time (and not before that)...

While these thoughts came about using my own plugin, they would arguably be valuable for any plugin — not least your in-its-own-window index card addon. Here goes:

Background: I am currently editing six contiguous episodes for a miniseries. For that, I was thinking I'd put the script of each ep in its own MacOS "space", and then use ctrl+arrow left and right to quickly jump between all eps. What works perfectly: I love that Beat allows me to open several instances of a plugin, so that I can have one open for each episode. Also, Beat's own windows do exactly what I want them to, staying on their assigned spaces, allowing me to jump back and forth. But what stops me is this:

So. For the purpose of efficiently editing multiple scripts, here is a wishlist (in descending order, I think) of what would be really helpful:

1. Ideally, making plugin windows space-aware just like document windows, so they could stay alongside their "parent" doc and appear when we shift to the space of that doc. 2. If not doable, making any plugin window that is child of currently focused document float to the top would at least alway put the current plugin above all others, obscuring the ones I am not affecting right now anyway 3. If that is not doable either, it would be nice if a resort could be making plugin windows hide/disappear when its corresponding document loses focus as an individual version of what's already happening globally to all plugin windows when the entire app loses focus. That would in effect be a faux version of 1 and 2 combined.

Here's hoping any of these can be done!

PS. I did try to do this myself from within the plugin (using window.focus() whenever Beat.on...Change() fires) but I suspect I'm not really meant to have access to talk to the top level window like that. Right?

lmparppei commented 2 years ago

Could you elaborate option 1? Do you mean that the plugins could be a part of the document window itself? This honestly is a bit difficult to implement.

I'm in the process of allowing widgets, which are intended for smaller and less intensive plugins which are running in the background. They will live in the sidebar and allow both native UI elements and an HTML area. Sidebar won't be too ideal for your purposes, though, because it's intended to be quite narrow.

I'm pretty sure the other two are doable.

ftolsson commented 2 years ago

No need to make it part of the same window of course! (even though I couldn't help thinking about that when I saw your widget post on discord) Part of the point with your windowed index card plugin (as well as my outliner) is to be able to keep it on a separate monitor, and that would be less convenient if they were just one window.

My thinking (option 1) was that the most complete version of making the html window geographically aware, would be to allow them to check what space their "parent" document window resides on, and then have them stay on that space when I switch to a new space where the parent is not (even if some other Beat document window is living on that space).

But truth be told, even just number three would in effect solve the problem just as well -- point just being that ideally, whatever document I start typing in should send any plugins that are "connected" to it to the top.

lmparppei commented 2 years ago

True, true. Current behavior is not expected, it's caused by modal window level. I think I know a way around this.

lmparppei commented 2 years ago

Implemented in 1.923. When a document window becomes key (is focused), it should bring all of its plugin windows to front, while the other documents force their child panels become normal-level windows.

ftolsson commented 2 years ago

Lovely!