Skip to content

feat(Postblock): Make options UI items links if possible#719

Merged
marcustyphoon merged 58 commits into
AprilSylph:masterfrom
marcustyphoon:postblock-links
May 27, 2026
Merged

feat(Postblock): Make options UI items links if possible#719
marcustyphoon merged 58 commits into
AprilSylph:masterfrom
marcustyphoon:postblock-links

Conversation

@marcustyphoon

@marcustyphoon marcustyphoon commented Aug 22, 2022

Copy link
Copy Markdown
Collaborator

User-facing changes

  • Postblock's options UI links to posts you have blocked, so you can tell what they actually are if you want to unblock them. Posts that have not been seen since this upgrade won't have links, since we didn't store the required information previously.
  • When viewing a single blocked post in /blog/view, there is a visual indicator with an unhide and unblock button instead of, you know, nothing.

Technical explanation

A map* of post ID -> blog UUID entries is stored as a separate storage entry, rather than migrating the blocked posts list to e.g. an array of [id, ?uuid]. You could definitely do the latter, but that kind of thing requires a bit of thinking to ensure you correctly migrate old entries and don't have race conditions.

*I unapologetically call POJO records "maps." Sue me.

Issues this closes

discussion #402

Testing steps

  • Load a saved set of preference data with blocked posts. Confirm that they function correctly but are not links in the options UI.
  • Block a post. Confirm that it is a link in the options UI, and that the link opens the post in question when clicked.
  • Confirm that blocked posts have a new UI when viewed alone, that the new UI looks correct both with and without the "use blog colors when viewing blogs" option, and that its buttons function.
  • Navigate to a post that was blocked before switching to this code. Confirm that it becomes a link.

@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

Uhhhhhhh. Is this impossible now? Can you no longer go to a post on a blog given the blog UUID and post ID?

@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

Yeah, it looks to me like you can go to https://www.tumblr.com/@t:UUIDGOESHERE and https://www.tumblr.com/blog/view/t:UUIDGOESHERE/, but cannot append /POSTID or /post/POSTID to either one.

@AprilSylph

Copy link
Copy Markdown
Owner

Shit, really? What happens if you do? (Mainly want to see if it ends up on a Redpop 404 page; if it does, my redirection code handling this is busted but can probably be fixed.)

@marcustyphoon

marcustyphoon commented Dec 8, 2022

Copy link
Copy Markdown
Collaborator Author

@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

Oh, I guess that's a silly reason to abandon this; it can just look up the blog name via an API request before navigation. Well, not "just," actually, since we can't access apiFetch from a settings panel. But it's solvable.

@marcustyphoon marcustyphoon marked this pull request as ready for review February 16, 2023 01:49
Co-Authored-By: April Sylph <28949509+AprilSylph@users.noreply.github.com>
@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

Hm. Not sure if:

  • this url hash should be prefixed (post-id-${blockedPostID} or whatever)
  • this code should skip the extra api fetch since we have the blog name in location.pathname now

@AprilSylph

Copy link
Copy Markdown
Owner

I would prefix it with postBlock: and drop the API fetch, I think.

  • Test that the hash starts with postBlock:
  • Check that the rest of the hash consists of only 0-9
  • Check that the rest of the hash is a valid length for a post ID (don't remember what the upper bound is, sorry)
  • tumblr.navigate(`./${postId}`);

@marcustyphoon

This comment was marked as resolved.

@marcustyphoon

This comment was marked as resolved.

marcustyphoon and others added 5 commits April 25, 2026 12:22
Co-Authored-By: April Sylph <28949509+AprilSylph@users.noreply.github.com>
Co-Authored-By: April Sylph <28949509+AprilSylph@users.noreply.github.com>
Co-Authored-By: April Sylph <28949509+AprilSylph@users.noreply.github.com>
Co-Authored-By: April Sylph <28949509+AprilSylph@users.noreply.github.com>
Comment thread src/features/postblock/index.js Outdated
Comment thread src/features/postblock/index.js Outdated
Co-authored-by: April Sylph <28949509+AprilSylph@users.noreply.github.com>
@marcustyphoon marcustyphoon self-assigned this May 4, 2026
@marcustyphoon marcustyphoon mentioned this pull request May 4, 2026
@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

Ah, this PR straight-up merge conflicts with #2132, doesn't it. So if I merge this PR, I'll then be immediately deleting some of the code in it in that PR. Fun!

@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

Feel free to bikeshed 03fd22f.

@marcustyphoon marcustyphoon requested a review from AprilSylph May 6, 2026 10:10
@marcustyphoon marcustyphoon removed their assignment May 17, 2026

@AprilSylph AprilSylph left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After four years in development, hopefully it will have been worth the wait.

Comment thread src/features/postblock/index.css
@marcustyphoon

Copy link
Copy Markdown
Collaborator Author

It might be a liiiittle hard to see on some palettes? But, like, eh. Do I really want to bikeshed the bikeshedding? No, not really. (And we can always change it later.)

@marcustyphoon marcustyphoon merged commit 50501a1 into AprilSylph:master May 27, 2026
2 checks passed
marcustyphoon added a commit that referenced this pull request May 27, 2026
Co-Authored-By: April Sylph <28949509+AprilSylph@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants