bluetui icon indicating copy to clipboard operation
bluetui copied to clipboard

Implement favorite paired devices (#72)

Open sermuns opened this issue 3 months ago • 7 comments

sermuns avatar Sep 18 '25 09:09 sermuns

I need some assistance @pythops: where should we store the state, the favorited devices? Should it write itself into the users config?

sermuns avatar Sep 18 '25 09:09 sermuns

@sermuns, you can use ~/.cache directory for that. bluetui has dirs crate as dependency already, and you can get the cache directory easily https://docs.rs/dirs/6.0.0/dirs/fn.cache_dir.html

pythops avatar Sep 18 '25 12:09 pythops

Thanks, I will try that!

sermuns avatar Sep 18 '25 12:09 sermuns

@sermuns, you can use ~/.cache directory for that.

Clearing cache shouldn't rather result in user's favourites disappearing. It should rather go to $XDG_DATA_HOME (~/.local/share).

Jorenar avatar Oct 16 '25 21:10 Jorenar

I agree with @Jorenar on this one

pythops avatar Oct 20 '25 21:10 pythops

I have now had some time to try to implement this.

ec432f9 works, but I am not proud of this approach since it performs way too much I/O, reading from disk everytime the App::refresh is invoked.

I think I need to create a little in-memory state to "cache" the reading from disk, or am I overthinking this?

sermuns avatar Oct 25 '25 20:10 sermuns

@sermuns maybe we should sync about it so we agree on the implementation. @eHammarstrom @Jorenar you are welcome to join if you want to. I have my Discord server https://discord.gg/mfSRc9Jann, so we can take the discussion there

pythops avatar Nov 02 '25 20:11 pythops