Merged
Conversation
This is just a placeholder, the endpoint is a TODO for now.
More work to do on it, but it's the end of the coding day and I want to ensure I have this backed up.
Until now it's always been a case of has the last action on the server happened later than the last download time, to the deepest fraction of a second. I now think it's possible for raindrop.io to perform (and record) an action but not make any changes; an example would be for pro users where it might be seeing if a new link is broken, recording the last action time as when it did that, but not actually update because the link wasn't broken. So here I'm changing this to use the last update time for now, and also giving it a little bit of wiggle room for the time difference; this is working on the assumption there could be a fraction of a second difference. Note to self: I should also ensure I always make this comparison in a timezone-safe way. I think I am right now, but I need to be 100% sure.
Here you can set it to None (so nothing highlighted -- this really just does what setting highlight to does) or to a specific Raindrop object. If it doesn't exist then this is a no-op. The idea here being that I can see the highlighted raindrop iff it's in the current view, otherwise the current view is undisturbed.
I think it makes more sense to just keep the newly-input data as a draft and let the user discover that it's still there if they try and create the raindrop again. Whatever error happens could be something they want to act upon, so it doesn't make sense to force them into a dialog they might not want to be in right now.
Either start out with the one passed in, or a freshly-created one, and then patch a clone of it with the new values before passing it back. This way I can safely add more and more support for the content without anything being lost when it comes to the edit operation.
Also switch the choice on when to suggest a link to be one that checks if there is a link at all, but doesn't care if this is a new raindrop or not.
Also add json_time. The module was already kinda badly-named anyway, and adding json_time just made it worse. So this adds json_time *and* fixes the naming.
This needs a wee bit more work, but it's the basic layout of the code. The one big issue here (and with adding a raindrop too really) is that, once done, we force going back to the "All" view. I don't want this. It's good enough to get all the other parts in place, but I want adds and edits to not disturb the state and UI more than is necessary.
I had been using a space-separated approach, as I used to in Tinboard. It seems that Raindrop allows spaces in tags, so I'm going to move to a comma-separated approach instead. Hopefully Raindrop doesn't allow commas in tags! (actually, if it does, I think I'm going to make "do not use commas in tags" an opinionated choice here).
LSP getting carried away and I didn't notice it during a commit.
Goodness knows where that fever dream of a check came from...
Have a single source of truth about what the separator is for the string version of tags.
There was a moment where I was thinking I'd need this down the road, but I really don't.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the ability to add, edit and delete raindrops.
TODO: