Skip to content

Add Raindrop management#2

Merged
davep merged 64 commits intomainfrom
raindrop-editing
Jan 3, 2025
Merged

Add Raindrop management#2
davep merged 64 commits intomainfrom
raindrop-editing

Conversation

@davep
Copy link
Copy Markdown
Owner

@davep davep commented Dec 31, 2024

Add the ability to add, edit and delete raindrops.

TODO:

  • Implement add
  • Implement edit
  • Implement delete
  • Ensure add doesn't cause loss of position
  • Ensure edit doesn't cause loss of position
  • Ensure delete doesn't cause loss of position
  • Tweak how the dialog handles the editing of tags; Raindrop allows spaces in tags!
  • Tag suggestions
  • Tag auto-completion

This is just a placeholder, the endpoint is a TODO for now.
@davep davep added the Enhancement New feature or request label Dec 31, 2024
@davep davep self-assigned this Dec 31, 2024
@davep davep added the Raindrop Feature A feature of Raindrop that I want to support label Dec 31, 2024
davep added 25 commits December 31, 2024 16:25
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).
davep added 27 commits January 2, 2025 11:38
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.
@davep davep marked this pull request as ready for review January 3, 2025 10:59
@davep davep merged commit a41589c into main Jan 3, 2025
@davep davep deleted the raindrop-editing branch January 3, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Raindrop Feature A feature of Raindrop that I want to support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant