Conversation
Only make the search window persistable
| import {ZuiWindow} from "./zui-window" | ||
|
|
||
| export class AboutWindow extends ZuiWindow { | ||
| persistable: false |
There was a problem hiding this comment.
There's the bug! The ":" should have been a "="
| await Promise.all(windows.map((w) => this.register(w))) | ||
| } | ||
| if (this.count === 0) await this.create("search") | ||
| if (this.byName("search").length === 0) await this.create("search") |
There was a problem hiding this comment.
Always ensure a search window gets created.
| lastFocused: number | ||
| state: State | undefined | ||
| dimens: Dimens | null = null | ||
| persistable = true |
There was a problem hiding this comment.
It now defaults to false.
philrz
left a comment
There was a problem hiding this comment.
@jameskerr: I tested this out on the branch and it's definitely hitting the goal of making sure there's always a search window when a user opens the app. However, when testing I noticed what's captured in the attached video, which I suspect may be an unrelated thing that was hiding behind this primary issue, but I figured I'd point it out. If I do the same sequence where I close the main search window first and then the Details window, the History for that search window is not present when I relaunch. I suspect this is a repeat of something we've discussed in the past where closing windows is assumed to express willingness to lose the tabs/history that were attached to that window, though I seem to remember we'd made some special exceptions for the "last window" just in case users saw no difference between "closing the last window" and "exiting the app". If I have all that correct, then maybe what I'm witnessing here is the Detail window being treated as "last window" in a way it maybe shouldn't? In any case, I'm happy to merge what's here since it's a significant improvement and I'd be happy to open a fresh issue if you think it's something worth looking into more.
Only make the search window persistable.
I found the bug. I was setting the "type" of the persistable property in the Detail Window class when I needed to set the "value" of it. The difference was a ":" needed to be an "=". They were both valid syntax so typescript didn't complain.
I've made it so that windows are not persistable by default. You have to opt in.
The only window that opts in is the Search Window.
And for people with old state, I make a check on startup that ensures at least on search window always opens when the app is first launched.
That should fix the issue.
Fixes #2730