binaryfire
binaryfire
FFilament
Created by binaryfire on 5/18/2024 in #❓┊help
Optimizing / compressing image uploads before saving to disk (no media library)
Nice. saveUploadedFileUsing is what I needed. It’s undocumented, but now I know what I look for in the repo. Thanks!
7 replies
FFilament
Created by binaryfire on 5/18/2024 in #❓┊help
Optimizing / compressing image uploads before saving to disk (no media library)
@Lara Zeus Saw that one. It’s using Spatie Media Library. That’s lots of code I’d need to dig through to use it as a reference - including deep diving into the Spatie package and the Filament integration for it. I’m definitely not opposed to source diving, but it’s a huge amount of work for what (I think?) must have an easy solution. Eg some way to access the path of uploads while they’re still in Livewire’s tmp dir and process them before they are moved from there to the disk?
7 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
For sure. I think a lot of people would really use / appreciate it.
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Maybe something you could tackle @pboivin 🙂
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Yeah that's fair enough. The current drafts plugins don't really do the autosave / optionally-recover-autosave-on-crash thing we're talking about - could be a good candidate for a new plugin
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
The idea of a drafts table for a timed autosave feature for resource edit pages that was discussed above was what I meant. Could be cool in core.
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
That would overwrite the main content though, not save an autosave draft right?
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
I know @Dan Harrin hates being pinged and will probably ban me for life, but there are some interesting ideas here. May be worth a look
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Back to the autosave though - I think some kind of drafts / restore draft dialog system is pretty essential tbh. Data loss when authoring long-form content is such deal-breaker for so many apps. Dan wasn't above adding some extra tables for import / export. Maybe he'd consider something similar for an autosave feature? Otherwise a plugin would be great, but I'm not sure you'd be able to hook into enough core functionality with a plugin to make it work
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Oh nice, that'd be a sweet addition to Peek! Btw let me know when you've got that in-form preview field ready to test - keen to try it out and give feedback
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Yeah that's what I was thinking. A bit above my skillset to implement though.
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
I guess you could store the hash of the last autosave in localstorage maybe?
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
I.e. just autosave if there has been a change
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Could also take a look at the form hash logic that the unsaved changes feature uses. I dug into that a bit in my PR to add it to SPA mode. It takes a hash of the current state, then compares it to the current state when the user tries to leave the page. It all happens on the frontend. I wonder if something similar could be used to prevent endless polling if the user leaves a page open overnight?
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Plus something like wire:poll, yeah
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Separate drafts table + a relationship to the resource which is checked when the edit form is re-opened, and if an entry is found, a modal appears saying there's an autosave and do you want to restore it
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Yeah exactly
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
lol
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
Ideally there'd be a way to save the raw form state without any validation, then just repopulate the fields
31 replies
FFilament
Created by binaryfire on 5/17/2024 in #❓┊help
Autosave entire edit form with debounce
That's a good point... Hadn't considered that 🤔
31 replies