Skip to content

Conversation

@teamcons
Copy link
Contributor

@teamcons teamcons commented Jun 11, 2025

Fixes #3

Still a draft - Doing this during break at work. It is a windows box, and i dont have admin rights for MSYS2, so i am going fully blind with no building, no linter, and no language server to check for errors beyond syntax

First commit is to move lambdas to handlers - Lambdas are handy but confusing and limiting, handlers allow greater control and are cleaner
and theres not yet in latest vala the fix that prevents for good lambdas from being walking memory leaks

If you prefer lambdas i can restore to the previous state/style, but after ive implemented autosave. Else im just gonna be confused and do back and forth

@teamcons teamcons marked this pull request as ready for review June 11, 2025 19:35
@teamcons
Copy link
Contributor Author

Okay so theres the following changes:
-A classic mistake is assuming the data directory exists. It doesnt by default, and user can delete dotfiles any moment and cause issues. With jorts, the app agressively checks if there is one and recreate it to save properly and not lose anything - I ported that up, so here there is autosaving for unsaved documents even if the user constantly deletes datadir

-Upon startup, the app just loops opens everything it can finds in the saved data folder. If there is nothing it does a new one. It infers from the looping how much unsaved documents we have, so any new window goes from there.

-The app has a proper handler to open files (Dont Repeat Yourself), and the AppWindow does that by default with whatever you feed it

-If an unsaved document is empty when closed, it just gets deleted. So we avoid having several empty windows showing up.

-Testing and having no keyboard shortcut pissed me off, so i added those, and it shows up when hovering the buttons. Only Save As is missing, because i forgor how to do it from AppWindow, and Application doesnt want to call AppWindow custom methods. The code is commented, you can try it.

it may be dumb as rocks, but it's not gonna be stupid

@wpkelso
Copy link
Owner

wpkelso commented Jun 12, 2025

Thanks so much for doing this! I'll take a look at the commented code when I have a little more time and see if I can get it working

teamcons and others added 2 commits June 12, 2025 07:38
Co-authored-by: William Kelso <[email protected]>
Co-authored-by: William Kelso <[email protected]>
@teamcons
Copy link
Contributor Author

Alright
In the meantime, once tested on your side, if this one works for you, could we merge it ?
Doing the rename from inside and dragdrop relies on this because of the handlers, and i suck at git too much to figure out multi branch drifting - i shouldve done a PR only for handlers

@wpkelso wpkelso merged commit 057fdd1 into wpkelso:main Jun 12, 2025
3 checks passed
@teamcons
Copy link
Contributor Author

(i hope it didnt sound as if i was pushing you)

@wpkelso
Copy link
Owner

wpkelso commented Jun 12, 2025

Not at all 🙂

I was planning to merge before figuring out the save as action because it wasn't blocking anything and could be tested independently

@teamcons
Copy link
Contributor Author

Alright. Please let me know if i am overbearing on your app. I dont want to rob your fun or put any pressure, just contribute until people go "yo that app is cool"

I see something cool, and my brain tend to latch on it. Charlie is asleep these days so since we dont share that hobby i may as well do everything at once.

Also wont add any buttons or anything to make it more than just a slate :p

@teamcons teamcons deleted the autosave branch June 12, 2025 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Temporary storage for "New Document"

2 participants