Squirrel
- 26 Devlogs
- 73 Total hours
Squirrel *aims* to be a cross-platform clipboard manager that is intuitive and something you'd use on the daily. Squirrel is written in Rust with Tauri+Svelte for it's GUI.
Squirrel *aims* to be a cross-platform clipboard manager that is intuitive and something you'd use on the daily. Squirrel is written in Rust with Tauri+Svelte for it's GUI.
some performance enhancements with images. made the clipboard image data fetching happen in Tauri’s dedicated thread pool, effectively parallelizing the operation. this made image copying a lot faster. image support should be merged into master soon enough.
we now have lazy loading for images. image data isn’t loaded until it is scrolled into view. makes startup quick.
enabled Dependabot updates and optimized the lint workflows for PRs. previously, all of the project was lint+checked on PR when changing anything. now it only checks the part that’s changed (i.e. frontend or backend)
we finally have some form of working image support in Squirrel. This required even more sweeping refactoring changes to the codebase, which was a bit painful and im sure the new code isn’t the best quality either and will bite me later, but we’ll deal with it when we deal with it.
getting images is a bit slow however, as right now we’re storing the image as base64 encoded PNGs.
i plan to use the SQLite blob type to just store the raw bytes and pass that back and forth to improve the performance a bit (maybe some sort of caching as well?). there are also other areas where that are to be improved but i wanted to get a somewhat working prototype as fast as i can.
i’ve been distracted by some life stuff, making me neglect my projects a bit. i also got distracted by the ESP32, fun little device. that is where the 9 days went. but, expect me to work semi-regularly again. thanks for reading.
(apologies for the uneventful devlog attachment, i have nothing interesting to show except just code)
to make it a bit more manageable when adding image support, a bunch of refactoring and reorganizing has been done in the backend.
like i’ve previously mentioned, the codebase leaned too hard into only supporting text events. this fixes that.
today’s changes also make the internal communication a bit more efficient. there are a couple more places where performance can be improved. and we will need every bit of performance we can get when dealing with image data.
(shoutout @Hridya for stardance utils, just discovered this)
currently writing the Release workflow for Squirrel. i have to figure out how to upload the artifacts to a github release with proper versioning and all that. the strategy is to run the workflow whenever something is pushed to the release branch.
that is all for today.
bumped the minor version. Squirrel is officially v0.2.0, yippi.
plus, updated the README, adding more explanation about the Wayland issue. also showcased the pin feature. i’ll try to whip up a release workflow to add to my CI tomorrow.
I’m debating whether i should ship v0.2.0. the only major change from 0.1.0 is the addition of pinning. i might wait until i have image support and ship later, or i might change my mind, im unsure.
moved the global launch hotkey logic from the frontend to the backend. it didn’t behave well in certain situations, failing to activate and bringing up the Squirrel window.
we’re experimenting with images. the current functionality is very much caveman and needs a lot of attention to make it actually usable. i’ve decided to stick with clipboard_rs for now, we’ll see how that pans out.
so i just found out that Tauri’s global shortcut plugin does not yet support Wayland, which is sad to discover this deep into development. but, there is an active PR addressing this issue, which is nice. what this means for Squirrel is that proper Wayland support will unfortunately have to wait until this is merged.
the joys of using a not-yet-completely-matured framework i suppose. though it does make me feel a bit guilty for calling Squirrel “cross-platform”.
--silent launch flag that makes it start with the window hidden. useful when the app is set to launch on system startup.Ctrl+Shift+Del will clear history permanently. (i forgot about clear history functionality in the first ship even though the code for it existed, there just wasnt a button in the frontend to call it)dipped my toes into github workflows, messed around, an got check&lint workflows working on pull requests. will make a release workflow some time later. this change however, was only a part of this devlog’s time.
turns out, using clipboard_rs might’ve been the subpar choice for interfacing with the system clipboard. while clipboard_rs provides a easy way to listen to clipboard changes and get text from it, fetching raw clipboard data is buggy and inconvenient. when i sat down to work on image support, i was immediately brick-walled by how messy it is to just get raw data first. it would’ve been simple if i was building for just one target os but considering both windows and linux, it’s less than ideal. on top of this, the documentation for the crate is very lackluster.
all this to say, i am very much debating migrating my clipboard stuff to using arboard. arboard doesnt provide direct functionality to listen to clipboard changes so i will have to implement that myself. but, it does have first class support for wayland. a very enticing choice, but we will see.
slight refactoring and bugfixes for frontend navigation. the navigation was kinda wonky before this and sometimes wouldn’t highlight the entry that was actually selected in the background. most of this devlog’s work was to make it so that what you see is what you get.
also, a touch of color has been added to pinned entries (tentative).
we now have basic entry pinning support. this was a bit less difficult than i thought it was going to be. but now you can pin an item and it always stays at the top of the list (unless you’re searching). anyways, that is one item ticked off the todo list.
apart from that, i had to do some minor backend refactoring and reorganizing so that it is easier to build more upon.
image and/or file copy support. this is one monumental task. i think the way we’ll approach this is by storing the entire file if it’s smaller than, say 5mb, and if it is larger, we just store the path to the file. we dont want to store the user’s 5gb video file they just copied.
for images, i think the play is to generate a low quality thumbnail of the image to display in the app. for files, if it is a text file, we can show just the first 5 or so lines with a link to the file, other wise we’ll just give a link.
until now, the code i’ve written sadly relies too much on the fact that every event is a text copy as we ignore everything else. it’s going to be a rather painstaking experience refactoring the codebase.
the challenge is going to be keeping Squirrel quick and responsive while supporting all of this additional functionality.
ofcourse critical bugs pop up when im trying to release.
the system tray icon wouldnt show up when running the single-file executable on any platform. that is now fixed.
plus a couple more things have been done to make Squirrel behave like a good cross platform app, like storing the data in the OS’s appdata directory.
there are some more things i would like to do but i think the app is in a releasable state and i’ve wanted to ship it for a while. I’ve set up the GitHub release and all the relevant instructions in the README. might be last devlog before ship #1.
more readme refining, linux support clarity, and installation instructions.
also, i completely forgot about the tray icon actually needing an image icon, so until now it was just blank. anyways, we now have an icon.
next, we put out releases on github and ship, hopefully. unfortunately we have to wait until tomorrow for linux builds.
i want squirrel to use whatever theme the system is set to. currently it’s forced light mode but dark mode is something i’d be crucified for not adding.
unfortunately, I in my infinite wisdom didn’t have the foresight to have consistent colors across even the light theme itself. there’s just random #aaa, #666, etc colors everywhere where i went with what looked good. so work needs to be done to standardize the colors with css variables. then just modify the variables for dark theme accordingly.
yes, i’m aware this is standard practice.
Squirrel now loads the history on launch. doing this was easier than i expected, but it’s a very naive way to do it (literally just send all of the history on launch).
we also now have a logo. im no graphic designer by any means so this is the best i could do. shows in the titlebar and when your history is empty. check the project banner for a larger version if you feel like it. i might change the logo in the future, i just wanted an icon.
nothing significant. just docs and comments and cleanup. slowly making progress planning wise into loading the history at launch.
the idea is to use a custom Tauri IPC Channel for incrementally streaming data to the frontend on app start. channels are supposedly faster for this and are meant for continuous messages like this in comparison to events. from the Tauri docs:
Channels are designed to be fast and deliver ordered data. They are used internally for streaming operations such as download progress, child process output and WebSocket messages.
i may implement a lazy loading system if i feel like it.
i have nothing interesting to show so have a squirrel again
i’ve wanted to add this for a long time but it needed a lot of refactoring in the frontend so i put it off for later. it is now later. we have instant search. press / or any of the non shortcut keys to start searching.
frontend logic has had a big refactor making navigation and other operations more predictable and less wonky. it took a bit of battling with the specifics of Svelte’s each loop and bind:this directive but it was worth it. there is still some cleanup that can be done, the code is not idiomatic by a long shot, but im happy we have a very essential feature complete.
we now have buttons on the clipboard entries so you can also use the mouse to perform the basic functions like copy, delete, etc. (pins wip). there have also been a bunch of UI improvements and tweaks in general. deleting feels instant. navigation is fixed (for the most part).
slight optimization in the pasting operation, plus a couple of fixes and doc comments.
as i mentioned before, im in the process of simplifying the UI. i hid the native titlebar and made a custom one. also tweaked the shape of the window to feel more like a clipboard. that is all that’s changed significantly this devlog.
development will probably slow down a little bit in the coming days because i have irl stuff to deal with.
there isnt any significant change in the frontend but there’s a ton of backend refactoring and bugfixes. performance should be slightly better now with large copy/pastes.
anyways, attached image is the tentative color palette i might implement. i have no idea how to do this and which colors to use where or if it would even look good so i might just ditch it in the future. we’ll see.
still have to test on linux and load history on app launch. probably will work on that next.
we now have Ctrl+Shift+V as the shortcut to bring up Squirrel.
(i know it’s used for “Paste as plain text” in some programs and used for “Paste in place” in photoshop but whatever).
once up, you can select items from your history using arrow keys. pressing Return pastes the selected item into your last window. we’re having some issues with permissions but i’ll look into it.
i’m now slowly simplifying the UI to be geared more towards improving user ergonomics and make it something that is not cluttered and easy to use.
apart from this, i’ve cleaned up the code a bit removing stray debug prints and random commented code, it was getting out of hand. will write proper doc comments soon.
that’s pretty much it, stay tuned.
edit: please ignore the VC_UNDEFINED keys in the input overlay in the attached video, it’s Enigo inputs not translating well.
on the topic of UI, i’m getting around to deciding a color palette for the app. i will probably work more on the UI for a bit before switching gears to add more functionality (like image support). if i decide i want to ship early, v0.1 will probably go without image support and just get a lot of polish with text only functionality.
frontend improvements! spent some time battling css for this relatively simple UI but it’s atleast somewhat pleasant to look at. will work on either image support or making it the app run in the background next.
nothing much has changed visually, but we now have a database to store the user’s clipboard actions. plus some refactoring changes and a bunch of minor improvements here and there. i have nothing to show for it except code so instead have an image of a squirrel
init.
figuring out Tauri’s emit/invoke mechanism and capturing clipboard copy events. slow start.
we’ll do the color palette and icon and all the frontend pleasantries at a later date.