buzz icon indicating copy to clipboard operation
buzz copied to clipboard

Restructure config

Open DanielVoogsgerd opened this issue 2 years ago • 3 comments

As promised, a restructured version of the config as mentioned in: #6.

I tried to keep fairly consistent with the current code structure and not refactor too much. However, I think it might not be the worst idea to refactor at least the configuration parsing, as this is becoming quite unwieldy.

This however will probably suffice for the major version bump. If you like to see any changes or if you have some tips, let me know, those are always welcome.

DanielVoogsgerd avatar Dec 17 '23 21:12 DanielVoogsgerd

Codecov Report

Attention: Patch coverage is 0% with 124 lines in your changes are missing coverage. Please review.

Project coverage is 0.0%. Comparing base (d932999) to head (41fe28d). Report is 7 commits behind head on main.

Additional details and impacted files
Files Coverage Δ
src/tray_icon.rs 0.0% <0.0%> (ø)
src/main.rs 0.0% <0.0%> (ø)

codecov-commenter avatar Dec 17 '23 21:12 codecov-commenter

Oh, sorry I wasn't clear — I think we should move to #[derive(Deserialize)] for an actual type (or set of types). That should make all of this much less unwieldy :sweat_smile:

See https://docs.rs/toml/latest/toml/#deserialization-and-serialization for a reference.

jonhoo avatar Jan 03 '24 15:01 jonhoo

No worries, I tried to stay consistent with the current codebase to get the changes as small as possible, but I will gladly move the deserialization to serde.

DanielVoogsgerd avatar Jan 05 '24 09:01 DanielVoogsgerd

That took longer than I had hoped, but I finally found some time to do the refactor. Not my best work; there is a fair bit of cloning that can be removed by restructuring or reference counting, but I wanted to keep the changes semi in-scope. Feel free to nitpick, but I'm not sure how soon I can get around to fixing everything. Feedback is always welcome.

Thanks

DanielVoogsgerd avatar Feb 10 '24 14:02 DanielVoogsgerd

Thanks for the detailed feedback, almost all the suggestions have been applied, only the removal of the clones is not really possible I think (see response on review). This could possibly be solved using references, but I'm not sure if that is worth the hassle.

DanielVoogsgerd avatar Feb 18 '24 13:02 DanielVoogsgerd

I don't think that is correct. Where normally, we would define accounts as named tables. It has been replaced with an array of tables called account now.

That does remind me of the fact that we should update the README accordingly. I'll try to push a change later today.

Considering the support around the tray-icon has changed as well, I think a major bump is due.

One final thing to consider is that if you bump the version, do you want to continue to support both the folder and the folders configuration option. I did it like this to make it backwards compatible, but maybe it is best to drop folder right now, as people will have to adjust their configuration anyway.

DanielVoogsgerd avatar Feb 25 '24 08:02 DanielVoogsgerd

Good call!

And yes, I think you're right we should then just have folders :+1:

jonhoo avatar Mar 02 '24 13:03 jonhoo

I'll try to push a change later today.

Yeah, that did not happen :sweat_smile:

But, I think it should be correct now. folder has been removed and README.md has been updated.

DanielVoogsgerd avatar Apr 07 '24 18:04 DanielVoogsgerd

Perfect, thank you! Release coming shortly :+1:

jonhoo avatar Apr 28 '24 07:04 jonhoo

Released as 2.0.0 :tada:

jonhoo avatar Apr 28 '24 08:04 jonhoo