Fixing PR #4111

58 views
Skip to first unread message

Edward K. Ream

unread,
Oct 22, 2024, 11:48:36 AM10/22/24
to leo-editor
PR #4111 must be fixed immediately. The PR enables VR3 willy-nilly, regardless of @enabled-plugins.

Happily, adding a guard seems to work. In << initialize data structures >>, the new code should be:

has_vr3 = is_module_loaded(VR3_MODULE_NAME)
if has_vr3:  # <----- new guard
    if (vr3 := self.find_widget('viewrendered3_pane')) is None:
        import leo.plugins.viewrendered3 as vr3_mod
        vr3 = vr3_mod.getVr3({'c': self.c})
    vr3.setParent(self)

I shall issue an emergency PR immediately. All tests. I shall also remove the 'use-*' commands. They restart Leo! Testing reveals that the new `legacy-*' commands are much better.

Edward

Edward K. Ream

unread,
Oct 22, 2024, 12:12:05 PM10/22/24
to leo-e...@googlegroups.com
On Tue, Oct 22, 2024 at 10:48 AM Edward K. Ream <edre...@gmail.com> wrote:

PR #4111 must be fixed immediately.
...
I shall issue an emergency PR immediately.

Done and merged. PR #4120 fixes all the apparent problems.

Please test the "devel" branch and report any problems.

We now resume our regularly scheduled programming.

Edward

Viktor Ransmayr

unread,
Oct 23, 2024, 7:01:07 AM10/23/24
to leo-editor
Hello Edward & Thomas,

Edward K. Ream schrieb am Dienstag, 22. Oktober 2024 um 18:12:05 UTC+2:
On Tue, Oct 22, 2024 at 10:48 AM Edward K. Ream <edre...@gmail.com> wrote:

PR #4111 must be fixed immediately.
...
I shall issue an emergency PR immediately.

Done and merged. PR #4120 fixes all the apparent problems.

Please test the "devel" branch and report any problems.

I performed an initial test using the current 'devel' branch in my Debian VM. - Here are my notes:

###

* Start with 'qt-layout-name = vertical-thirds' & only VR3 enabled.
* List ~ relevant ~ commands - See "Log-001".
* Try 'layout-legacy' - OK -> Layout changed (Ascii-Icon: " _ | _ ", still w/o VR pane ...
* -> 'Legacy' layout is what's still shown in the screenshot for Leo's main window on the home page.
*
* Try 'layout-restore-default' - OK -> Layout changed back (Ascii-Icon: " - | "), still w/o VR pane ...
* Try 'layout-big-tree' - OK? -> Layout changed (Ascii-Icon: " I "), now with VR pane using VR3 as  ~ renderer ~ ...
* ==> Is this implicit 'activation' intended / wanted ?
*
* Try 'layout-restore-default' - OK -> Layout changed (Ascii-Icon: " - | | "), still with VR pane ...
* Try 'layout-quadrant' - OK -> Layout changed to 'legacy' (Ascii-Icon: " + "), still with VR pane ...
* ==> What's the difference b/w 'legacy' & 'quadrant' command ?
* ==> I do not see any & would remove 'quadrant' !

*
* Try 'layout-restore-to-setting' - OK? -> Layout changed (Ascii-Icon: " - | | "), still with VR pane ...
* ==> What's the difference b/w the two 'restore' commands ?
* ==> I do not see any & would remove 'default' !

*
* Try 'layout-horizontal-thirds' - OK ->  Layout changed (Ascii-Icon: " = ' = "), still with VR pane ...
* Try 'layout-restore-default' - OK -> Layout changed (Ascii-Icon: " - | | "), still with VR pane ...
* Try 'layout-vertical-thirds2' - OK -> Layout changed (Ascii-Icon: " | - | "), still with VR pane ...
* Try 'layout-restore-default' - OK -> Layout changed (Ascii-Icon: " - | | "), still with VR pane ...
* Try 'layout-swap-log-panel' #1 - OK -> Layout changed (Ascii-Icon: " | | | "), still with VR pane ...
* Try 'layout-swap-log-panel' #2 - OK -> Layout changed (Ascii-Icon: " - | | "), still with VR pane ...
* Try 'layout-fallback-layout' - OK? -> No change to layout (Ascii-Icon: " - | | "), still with VR pane ...
* ==> What's the difference b/w 'fallback' & 'vertical-thirds' command ?
* ==> I do not see any & would remove 'fallback' !

*
* Try 'layout-render-focused' - OK -> Layout changed (Ascii-Icon: " = | "), still with VR pane ...
* Try 'layout-restore-default' - OK -> Layout changed (Ascii-Icon: " - | | "), still with VR pane ...

###

With kind regards,

Viktor
 

Edward K. Ream

unread,
Oct 23, 2024, 7:40:36 AM10/23/24
to leo-e...@googlegroups.com
On Wed, Oct 23, 2024 at 6:01 AM Viktor Ransmayr <viktor....@gmail.com> wrote:

> I performed an initial test using the current 'devel' branch in my Debian VM. - Here are my notes:

Thanks for your testing and comments.

* ==> What's the difference b/w 'legacy' & 'quadrant' command ?
* ==> I do not see any & would remove 'quadrant' !

I agree. The quadrant layout should definitely go.

* ==> What's the difference b/w the two 'restore' commands ?
* ==> I do not see any & would remove 'default' !

...
* ==> What's the difference b/w 'fallback' & 'vertical-thirds' command ?
* ==> I do not see any & would remove 'fallback' !

I'm not sure. Let's here what Thomas has to say.

Edward

Thomas Passin

unread,
Oct 23, 2024, 8:19:36 AM10/23/24
to leo-editor
On Wednesday, October 23, 2024 at 7:01:07 AM UTC-4 viktor....@gmail.com wrote:
Hello Edward & Thomas,

Edward K. Ream schrieb am Dienstag, 22. Oktober 2024 um 18:12:05 UTC+2:

I performed an initial test using the current 'devel' branch in my Debian VM. - Here are my notes:

###

* Start with 'qt-layout-name = vertical-thirds' & only VR3 enabled.
* List ~ relevant ~ commands - See "Log-001".
* Try 'layout-legacy' - OK -> Layout changed (Ascii-Icon: " _ | _ ", still w/o VR pane ...
* -> 'Legacy' layout is what's still shown in the screenshot for Leo's main window on the home page.
*
* Try 'layout-restore-default' - OK -> Layout changed back (Ascii-Icon: " - | "), still w/o VR pane ...
* Try 'layout-big-tree' - OK? -> Layout changed (Ascii-Icon: " I "), now with VR pane using VR3 as  ~ renderer ~ ...
* ==> Is this implicit 'activation' intended / wanted ?

Leo has always had VR available if VR3 is not enabled, even if VR isn't enabled in settings either. The intent with these layouts is that the VR/VR3 slot will be used by VR3 if it is enabled otherwise by VR.  If you have both VR and VR3 enabled that's not harmful but VR won't know where it should be shown and if it does show it won't be in the appointed place in the layout.
 
* Try 'layout-restore-default' - OK -> Layout changed (Ascii-Icon: " - | | "), still with VR pane ...
* Try 'layout-quadrant' - OK -> Layout changed to 'legacy' (Ascii-Icon: " + "), still with VR pane ...
* ==> What's the difference b/w 'legacy' & 'quadrant' command ?
* ==> I do not see any & would remove 'quadrant' !


There isn't a difference and "legacy" has already been removed. It is still aliased to "quadrant" for the time being in case anyone is using it by that name.  I think that Edward may want to remove "quadrant" as well but that's not decided for sure.
 
* Try 'layout-restore-to-setting' - OK? -> Layout changed (Ascii-Icon: " - | | "), still with VR pane ...
* ==> What's the difference b/w the two 'restore' commands ?
* ==> I do not see any & would remove 'default' !


I agree.  They are two names that actually run the same code.   'layout-restore-default' was a weak choice of name on my part so I added 'layout-restore-to-setting' as an alias for it. I'm not sure if we will retire the first one, again in case someone is using it, but I wouldn't be surprised.
 
* ==> What's the difference b/w 'fallback' & 'vertical-thirds' command ?
* ==> I do not see any & would remove 'fallback' !


"Fallback" was a provisional name I used for my preferred layout when I was developing this layout system so I always could "fall back" to it if necessary to do actual work (i.e., not just work on the layout system),. It did not have a slot for VR/VR3 but I could open VR3 where I wanted anyway. Now the two names are aliases for each other and "fallback" will probably go away soon.

Thomas Passin

unread,
Oct 23, 2024, 10:31:08 AM10/23/24
to leo-editor
We do need to be able to load a layout if the setting for the startup layout is missing or specifies a non-existent layout. If no one objects, I will make that be "vertical-thirds". (Actually, if the setting is missing one already gets a usable layout, similar to vertical thirds but (I think) with no slot for VR/VR3.  It's probably better to be explicit about which layout will be used, I think).

Viktor Ransmayr

unread,
Oct 23, 2024, 10:43:46 AM10/23/24
to leo-e...@googlegroups.com
I believe the default setting is 'legacy' coming from "leoSettings.leo". 

Sent from my phone !

--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/39b8eba3-dfc9-4654-a2c1-bd7877c0b978n%40googlegroups.com.

Thomas Passin

unread,
Oct 23, 2024, 11:06:28 AM10/23/24
to leo-editor
On Wednesday, October 23, 2024 at 10:43:46 AM UTC-4 viktor....@gmail.com wrote:
I believe the default setting is 'legacy' coming from "leoSettings.leo".

Ha! You are so right.  We better remember to change that if we eliminate the "legacy" layout.

Edward K. Ream

unread,
Oct 23, 2024, 1:09:05 PM10/23/24
to leo-e...@googlegroups.com
On Wed, Oct 23, 2024 at 7:19 AM Thomas Passin <tbp1...@gmail.com> wrote:

* ==> What's the difference b/w 'legacy' & 'quadrant' command ?
* ==> I do not see any & would remove 'quadrant' !


There isn't a difference and "legacy" has already been removed. It is still aliased to "quadrant" for the time being in case anyone is using it by that name.  I think that Edward may want to remove "quadrant" as well but that's not decided for sure.

Thomas, imo there is no reason to retain confusing command names. There is no downside to doing so. The names are recent, people have no right to expect stability just yet, and changing them does not constitute a breaking change to Leo.

 * ==> What's the difference b/w the two 'restore' commands ?
* ==> I do not see any & would remove 'default' !


I agree.  They are two names that actually run the same code.   'layout-restore-default' was a weak choice of name on my part so I added 'layout-restore-to-setting' as an alias for it. I'm not sure if we will retire the first one, again in case someone is using it, but I wouldn't be surprised.

Of course we should retire  'layout-restore-default' !

* ==> What's the difference b/w 'fallback' & 'vertical-thirds' command ?
* ==> I do not see any & would remove 'fallback' !


"Fallback" was a provisional name I used for my preferred layout when I was developing this layout system so I always could "fall back" to it if necessary to do actual work (i.e., not just work on the layout system),. It did not have a slot for VR/VR3 but I could open VR3 where I wanted anyway. Now the two names are aliases for each other and "fallback" will probably go away soon.

Whew!

Edward

Edward K. Ream

unread,
Oct 23, 2024, 1:11:14 PM10/23/24
to leo-e...@googlegroups.com
On Wed, Oct 23, 2024 at 9:31 AM Thomas Passin <tbp1...@gmail.com> wrote:
We do need to be able to load a layout if the setting for the startup layout is missing or specifies a non-existent layout. If no one objects, I will make that be "vertical-thirds".

Any default is fine with me. You are talking about an edge case because LeoSettings.leo will supply a default.

Edward

Thomas Passin

unread,
Oct 23, 2024, 1:20:49 PM10/23/24
to leo-editor
In the case where a user has specified an initial layout in myLeoSettings.leo but had a typo in the layout name, the setting in leoSettings.leo wouldn't be known. I don't think this is terribly unlikely.  So there has to be reasonable default to use in this situation.  I've tested this case, BTW, and the code works as intended.  PR coming up very soon.

Edward K. Ream

unread,
Oct 23, 2024, 2:00:46 PM10/23/24
to leo-e...@googlegroups.com
On Wed, Oct 23, 2024 at 12:20 PM Thomas Passin <tbp1...@gmail.com> wrote:
In the case where a user has specified an initial layout in myLeoSettings.leo but had a typo in the layout name, the setting in leoSettings.leo wouldn't be known. I don't think this is terribly unlikely.  So there has to be reasonable default to use in this situation.  I've tested this case, BTW, and the code works as intended.  PR coming up very soon.

Sounds good!

Edward
Reply all
Reply to author
Forward
0 new messages