kevboh / longform

A plugin for Obsidian that helps you write and edit novels, screenplays, and other long projects.
Other
662 stars 31 forks source link

fix: use 'Scenes' tab as default (#141) #202

Closed chrisgrieser closed 11 months ago

chrisgrieser commented 12 months ago

fixes #141

chrisgrieser commented 12 months ago

Hmm, upon some usage, it appears that this fix has the weird drawback of somewhat breaking the tabs. Once the compile tab is selected, the longform sidebar is broken, whichever tab you then choose.

Tried scouring the code base and could not really find out why, and also could not find out any other location where the default tab might be set, so I am a bit puzzled here.

b-camphart commented 12 months ago

@chrisgrieser when you see that issue, is "A Short Story" or "An Essay" the project that's currently selected? I think the issue arises due to single-scene projects not having scene compile steps (errors are thrown before you even click the Compile tab).

b-camphart commented 12 months ago

Somehow, steps are being added to the workflow that are undefined which throws an error when deserializing, but also throws an error when the Compile tab is clicked. When an error is thrown from the GUI, the svelte engine stops working, which is why it becomes unresponsive.

chrisgrieser commented 12 months ago

Yeah, I have exactly zero experience with svelte, so...

Anyway, what would be the solution for this? Maybe something like selecting the project tab first and then selecting the scenes tab maybe?

b-camphart commented 12 months ago

I didn't do a full deep-dive to figure out where the undefined steps were coming from, but I think it has to do with how the settings are saved and/or loaded. We don't have strictNullChecks enabled in the tsconfig.json, so it's hard to tell where the problem might originate. If you don't want to debug this whole thing, maybe the place to make this feature work is in the GUI, instead of the store, since the "Scenes" tab doesn't necessarily apply to all projects.

chrisgrieser commented 12 months ago

hmm, yeah, I guess I simply lack the knowledge of svelte to figure out where to do this GUI-wise. Guess we'll have to wait for pointers from kevboh

kevboh commented 11 months ago

I was out of town this past weekend and away from my machine. I should have time to look at this this week. As a quick test: when exactly do you see this behavior? I see it when I switch from a single-scene project to a multi-scene one (which is more or less expect, but potentially a thing that can be changed).

chrisgrieser commented 11 months ago

Happens as soon as I switch to the compile tab. I have my one multi-scene project selected the whole time (don't have any single scene projects to begin with)

kevboh commented 11 months ago

Closing in favor of https://github.com/kevboh/longform/pull/206