Closed lamemakes closed 6 months ago
Drafting as my main branch was out of sync so this needs merge help but will still take feedback in the meantime @mikkeldenker!
This feedback is phenomenal! I really appreciate you taking the time to give in depth feedback. Svelte is completely new to me as I'm coming from an Angular/Vue/Django background so these pointers have been incredibly helpful. Especially cool all of the things you can do with bindings in regards to HTML Elements. I had no idea and wince a bit whenever I had to do DOM manipulation. I'll have some revisions up shortly!
Changes will be up tomorrow - didn't catch the keybindings in Searchbar
so those will also be included
Was hoping this method of implementation didn't clutter things but the aim was re-usability as Stract grows. Implementing it in the search bar felt like some overhead was definitely eliminated, along with code not being duplicated which was nice. Once feedback is given on those two comments I'll move the PR out of draft. Cheers!
This is great, thanks a ton for the fixes! Are you sure the keybind class isn't adding bloat? I can totally do a quick refactor and toss it all in the +page.svelte
like the search's bindings. Cheers!
I actually quite like to have it in a separate file to avoid routes/search/+page.svelte
becoming too enormous. I guess we can move keybind.ts
into routes/search
to indicate this is the only place we currently use it though.
Closes #146. The goal here was to create a simple system that could be reused to handle keyboard shortcuts. Thus as Stract grows and potentially implements more features/views, new shortcuts can be easily added. Most of the TSDoc comments speak for themselves but in summary:
Keybind
to handle all needed Keybindings for a routekeybind.ts
/search/+page.svelte
/search/+page.svelte
Let me know whatever feedback you've got, totally willing to refactor to your preferences. Cheers!