purr-data merge requestshttps://git.purrdata.net/jwilkes/purr-data/-/merge_requests2023-09-04T16:34:46Zhttps://git.purrdata.net/jwilkes/purr-data/-/merge_requests/863Autosave Feature2023-09-04T16:34:46ZPrakhar AgarwalAutosave Feature# Autosave Feature
### Description
The autosave feature solves the problem of data loss in case of application crashes. It automatically creates a backup copy of the dirty canvases in a hidden directory, which gets replaced with the la...# Autosave Feature
### Description
The autosave feature solves the problem of data loss in case of application crashes. It automatically creates a backup copy of the dirty canvases in a hidden directory, which gets replaced with the latest changes after every specified interval of time(sec).
### How to Use?
The Autosave feature is turned on by default and the autosave interval is set to 10 seconds which can be configured from the preferences dialog. Here's a screenshot of the setting (at the bottom of the dialog).
![Preferences_Dialog](/uploads/0963485bf6bea67db4ca1ef5a5bc972c/Preferences_Dialog.png)
After an app crash, when the user opens up the app, a dialog will show up, listing all the files that can be recovered. If the user selects "OK" then all the listed files are recovered and opened up on the screen.
![Recovery_Dialog](/uploads/4a145f22d8610c7679662ce27dbb3edb/Recovery_Dialog.png)
The user can then manually save those files.
### Internal Working
1. Once the engine is ready, we take the autosave interval value(say x) and call a `setInterval()` function, which makes calls to the autosave function in `g_readwrite.c` file after every x seconds.
2. Now we generate a unique filename for the backup file by appending the current timestamp in `"%Y-%m-%d_%H-%M-%S"` format to the name of the canvas `<name_of_canvas>_<timestamp>.pd` and save it inside of a hidden directory which is **\~/AppData/Roaming/Purr-Data/autosave** in Windows and **\~/.purr-data/** in Linux/macOS.
3. We maintain a `autosave.json` file that stores key-value pairs that maps `<original_canvas_file_path>:<autosaved_backup_file_path>`. This helps in saving only a single backup copy of a canvas while recovering files after a crash. Here's some data inside the JSON file.
```
{ "/home/prakhar/purr-data/Untitled-1": "/home/prakhar/.purr-data/autosave/Untitled-1_2023-08-26_04-30-51.pd",
"/home/prakhar/purr-data/Untitled-2": "/home/prakhar/.purr-data/autosave/Untitled-2_2023-08-26_04-30-51.pd",
"/home/prakhar/purr-data/Untitled-3": "/home/prakhar/.purr-data/autosave/Untitled-3_2023-08-26_04-30-51.pd"
}
```
4. When the user boots up after the crash, we check for any backup files present in the hidden folder by scanning the autosave.json file, If there are, then they get listed in a popup dialog which the user can then recover by clicking "OK".
5. `gl_recovered=1` flag is set to the newly opened backup files, to differentiate them from normal files and force the user to save as the file instead of just save on a new location.
### Screencast
https://youtu.be/S3Tu2epynQY
Signed-off-by: prakharagarwal1 prakharagarwal3031@gmail.comhttps://git.purrdata.net/jwilkes/purr-data/-/merge_requests/862Add workflow_dispatch2023-08-29T11:51:14ZAlbert GräfAdd workflow_dispatchThis is for the GitHub CI. It adds the necessary `workflow_dispatch` trigger to the GH workflow so that I can manually trigger a build on any branch; see https://build5nines.com/configuring-manual-triggers-in-github-actions-with-workflow...This is for the GitHub CI. It adds the necessary `workflow_dispatch` trigger to the GH workflow so that I can manually trigger a build on any branch; see https://build5nines.com/configuring-manual-triggers-in-github-actions-with-workflow_dispatch/.Jonathan WilkesJonathan Wilkeshttps://git.purrdata.net/jwilkes/purr-data/-/merge_requests/860issue #5432023-04-03T22:19:59Zbrittney allenissue #543Hi Jonathan, here's my attempt at remedying issue #543. Here's a screenshot of the new [import] help file.
![import-help](/uploads/d5bd8aca9381a24ae93ecf758fbe37b7/import-help.png)Hi Jonathan, here's my attempt at remedying issue #543. Here's a screenshot of the new [import] help file.
![import-help](/uploads/d5bd8aca9381a24ae93ecf758fbe37b7/import-help.png)https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/858Draft: draft of listbox2023-03-05T21:43:18ZJonathan WilkesDraft: draft of listboxchecked against:
1. initial commit
2. future patches in git
3. current state of the files in the repo
The way this is supposed to work:
* if user *double-clicks* a listbox, Pd Vanilla triggers the rtext_key bullshit to allow text editio...checked against:
1. initial commit
2. future patches in git
3. current state of the files in the repo
The way this is supposed to work:
* if user *double-clicks* a listbox, Pd Vanilla triggers the rtext_key bullshit to allow text edition while in runmode. However, in Purr we just intercept rtext_activate in a contentEditable div (vis a vis new_object_textentry) and let the GUI handle all text edition
* when single-clicking a float or symbol atom, same behavior
* when the user is finished editing junk in the listbox, we send it to the backend, use canvas_buftotext to update the buffer, then send a mouse event to trigger the gatom_retext call inside canvas_doclick
current issues:
- [ ] the text typed into a listbox isn't getting displayed properly. We're getting the text from GUI -> canvas_buftotext -> canvas_doclick ok. But in line 3772 of g_editor.c we're calling gatom_key, which in turns calls rtext_activate with a value of zero. When that happens, the gl_editor gets its e_textedfor member set to zero, and *that* causes us to fail the condition in 3829 of g_editor.c where we're supposed to call rtext_retext. We *could* just move that call to canvas_buftotext, but given this nasty, sprawling patch for such a finicky widget I'm much rather stay as close as we can to Pd Vanilla.
- [ ] listbox, float atom, and symbol atom all have bogus initialization values when you create them from the "Put" menu (to test listbox, do File -> Message and add the word "listbox" after the highlighted canvas ID)
- [ ] probably need slightly different GUI behavior for the runmode listbox/atom text mode. E.g., on <Enter> we want to trigger the new valueJonathan WilkesJonathan Wilkeshttps://git.purrdata.net/jwilkes/purr-data/-/merge_requests/830Remove windows menu option from global menu2022-03-10T17:35:59ZPaarth AgarwalRemove windows menu option from global menuRemoved the Windows menu as it was redundant in web app because of its SPA structure. Fixes #867.
Now it'll look like:
![image](/uploads/fb60de02b3935c10e1ae37f7679862d3/image.png)Removed the Windows menu as it was redundant in web app because of its SPA structure. Fixes #867.
Now it'll look like:
![image](/uploads/fb60de02b3935c10e1ae37f7679862d3/image.png)https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/829Added missing download tooltip2022-03-07T10:23:35ZPaarth AgarwalAdded missing download tooltipI have added tooltip for download. Fixes #870
**Demo:**
![image](/uploads/fd9ad7563370d1cd59ed3679f17faa17/image.png)I have added tooltip for download. Fixes #870
**Demo:**
![image](/uploads/fd9ad7563370d1cd59ed3679f17faa17/image.png)https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/828Fixed highlighting all matches when "Highlight All" is unchecked2022-03-06T11:11:12ZPaarth AgarwalFixed highlighting all matches when "Highlight All" is uncheckedI have fixed the bug. Now it looks like:
![image](/uploads/0b5428e51ef953ba8a22d2262458741e/image.png)
Fixes #869.I have fixed the bug. Now it looks like:
![image](/uploads/0b5428e51ef953ba8a22d2262458741e/image.png)
Fixes #869.https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/827Added placeholder text to Find2022-03-05T08:13:34ZPaarth AgarwalAdded placeholder text to FindI have added placeholder text in the find textbox in canvas which now says, Search in Canvas. Fixes #868I have added placeholder text in the find textbox in canvas which now says, Search in Canvas. Fixes #868https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/826Added color change on hovering close button2022-03-02T12:40:12ZPaarth AgarwalAdded color change on hovering close buttonI have added hover effect to close buttons( in patch header, message dialog header, etc)
**Demo:**
![ubuntu__Running__-_Oracle_VM_VirtualBox_2022-03-02_18-05-35_Trim](/uploads/8b653066a724dfdf2e58a1d57fb9a6bf/ubuntu__Running__-_Oracle_...I have added hover effect to close buttons( in patch header, message dialog header, etc)
**Demo:**
![ubuntu__Running__-_Oracle_VM_VirtualBox_2022-03-02_18-05-35_Trim](/uploads/8b653066a724dfdf2e58a1d57fb9a6bf/ubuntu__Running__-_Oracle_VM_VirtualBox_2022-03-02_18-05-35_Trim.mp4)https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/825Ask to save unsaved changes on closing patch2022-02-28T09:48:33ZPaarth AgarwalAsk to save unsaved changes on closing patchOn clicking the close patch button of an edited patch a dialog box will appear asking if the user would like to save changes or not. Fixes #849, related MR !792.
**Demo:**
![ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-27_19-58-31...On clicking the close patch button of an edited patch a dialog box will appear asking if the user would like to save changes or not. Fixes #849, related MR !792.
**Demo:**
![ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-27_19-58-31_Trim](/uploads/b94a6eea539f726d124ace5e118d994b/ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-27_19-58-31_Trim.mp4)https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/824Added dialog for saving patch (web app)2022-02-27T10:45:24ZPaarth AgarwalAdded dialog for saving patch (web app)Now a dialog will appear when we save patch instead of the default browser prompt. Fixes #866
**Demo:**
![ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-27_15-55-48_Trim](/uploads/e43064c7b32e0a90d948e0e38f8c66c3/ubuntu__Running__-_...Now a dialog will appear when we save patch instead of the default browser prompt. Fixes #866
**Demo:**
![ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-27_15-55-48_Trim](/uploads/e43064c7b32e0a90d948e0e38f8c66c3/ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-27_15-55-48_Trim.mp4)
Note: I have used data-bs... classes instead of data-... class because of Bootstrap 5. Current version of purr-data uses Bootstrap 4 which I have updated in !813https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/823updated the web app link2022-02-24T09:43:03ZPaarth Agarwalupdated the web app linkThe webapp link given in purr-data/emscripten/project/purr-data/README.md was not working so I replaced it with the new working link. Fixes #858.The webapp link given in purr-data/emscripten/project/purr-data/README.md was not working so I replaced it with the new working link. Fixes #858.https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/822DSP toggle button fix2022-02-23T08:41:46ZPaarth AgarwalDSP toggle button fixI have updated the CSS files and added DSP button styles to them. Fixes #864I have updated the CSS files and added DSP button styles to them. Fixes #864https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/821Draft: fixed inconsistent cursor in same canvas area2022-02-22T13:26:25ZPaarth AgarwalDraft: fixed inconsistent cursor in same canvas areaI have fixed the cursor issue. Fixes #865
After fix:
![ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-21_23-21-12_Trim](/uploads/5d81929bd5bbd391c1f01f63524a6172/ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-21_23-21-12_Trim.mp4)I have fixed the cursor issue. Fixes #865
After fix:
![ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-21_23-21-12_Trim](/uploads/5d81929bd5bbd391c1f01f63524a6172/ubuntu__Running__-_Oracle_VM_VirtualBox_2022-02-21_23-21-12_Trim.mp4)https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/820Remove duplicate keys(master)2022-02-17T14:47:05ZPaarth AgarwalRemove duplicate keys(master)Removed duplicate object keys. Fixes #785Removed duplicate object keys. Fixes #785https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/819Remove duplicate keys from translation.json files (emscripten)2022-02-17T12:14:27ZPaarth AgarwalRemove duplicate keys from translation.json files (emscripten)I have removed "label_right" and "label_left" and updated the de/translation.json according to en/translation.json. Fixes #863I have removed "label_right" and "label_left" and updated the de/translation.json according to en/translation.json. Fixes #863https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/818fixed console behavior on reload2022-03-06T11:37:07ZPaarth Agarwalfixed console behavior on reloadFixed wrong arrow direction and animation and the console is in a correctly collapsed state by default on reloading. Earlier it appeared to be partially collapsed. Fixes #861Fixed wrong arrow direction and animation and the console is in a correctly collapsed state by default on reloading. Earlier it appeared to be partially collapsed. Fixes #861https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/817Adding darkmode2022-02-13T12:54:45ZPaarth AgarwalAdding darkmodeAdds dark mode to the web app. Fixes #860
Final look:
![image](/uploads/c248dc761a23ec0cd4ee15dad08280c5/image.png)Adds dark mode to the web app. Fixes #860
Final look:
![image](/uploads/c248dc761a23ec0cd4ee15dad08280c5/image.png)https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/816Update nvm version2022-02-10T12:14:35ZPaarth AgarwalUpdate nvm versionI have updated instructions in `emscripten/project/purr-data/README.md` so that the latest version of nvm will be installed.I have updated instructions in `emscripten/project/purr-data/README.md` so that the latest version of nvm will be installed.https://git.purrdata.net/jwilkes/purr-data/-/merge_requests/815Update WebMIDI version2022-02-10T11:36:20ZPaarth AgarwalUpdate WebMIDI versionI have updated the WebMIDI version to the latest stable 3.0.10. Fixes #859I have updated the WebMIDI version to the latest stable 3.0.10. Fixes #859