wjs018

joined 3 weeks ago
[–] wjs018@piefed.wjs018.xyz 1 points 1 day ago

I actually kind of like it being a separate endpoint, so I don't mind that. One thing I thought about changing though, that I opted not to, was to make both /ban and /unban the same request method. Right now /ban is a post while /unban is a put. I feel like they should both be the same. However, this felt like more of a bigger change than some field name tweaking, so I held off.

 

As part of our ongoing effort to make our api self-documenting and validating our api input/output, we have been working through the api endpoints one at a time to make things a bit more consistent and logical. I just finished doing this for our existing /community endpoints and thought I would share the changelog here for awareness and feedback.

As of right now, these changes are only live on my instance and on our new, dedicated testing instance, crust.piefed.social. The self-documenting swagger for 1.2 (a WIP) can be found here.

1.2 Community Endpoints Changelog

  • PUT /community
    • input parameter community_id properly documented (was previously erroneously documented as id)
  • GET /community/list
    • made next_page nullable if there is no next page
    • this change was backported to 1.1 already
  • GET /community/moderate/bans
    • banned_by replaces bannedBy - transitioning everything to snake case
    • banned_user replaces bannedUser - transitioning everything to snake case
    • expired_at replaces expiredAt - transitioning everything to snake case
    • expired_at value of null indicates a permanent ban
    • expired_at only returned if ban has expired
    • expires_at field added, only returned if ban is still in effect
    • expires_at value of null indicates permanent ban
  • PUT /community/moderate/unban
    • same field name changes as above (snake_case instead of camelCase)
    • expired_at is now set equal to current time if ban was found (indicating that it was just set to expired) and returned in standard timestamp format found elsewhere in the api (2025-06-07T02:29:07.980084Z)
  • POST /community/moderate/ban
    • Input:
      • expires_at replaces expiredAt/expired_at for input
      • expires_at uses standard timestamp format (2025-06-07T02:29:07.980084Z)
      • expires_at is optional
      • expires_at is checked to make sure it is in the future, raises an exception if it is not
      • permanent is new optional boolean field, supercedes expires_at if true
      • If expires_at is not provided and permanent is either false or not provided, then the ban is set to expire in one year
    • Output:
      • same field name changes as above (snake_case instead of camelCase)
      • expires_at value of null indicates permanent ban
      • standardize timestamp format of expires_at
      • only returns expires_at because it is a time in the future (does not return expired_at)
[–] wjs018@piefed.wjs018.xyz 6 points 1 week ago (2 children)

Add ability to use keyword filter on community names

This should already be live. In your user settings on the Blocks & Filters page, you will want to look for these options:

Since you are on piefed.social, rimu has tried to designate basically all the meme communities as "low quality" so that they are easily filterable by checking that box (new ones pop up all the time though). Additionally, the text box below lets you filter based on community name.

[–] wjs018@piefed.wjs018.xyz 5 points 1 week ago (1 children)

I'd like to sort communities by Top X amount of time, IIRC that was already in the works.

This is already live. If you are viewing a community, click Top in the bar and it should be a dropdown menu where you select the timerange:

If you are on a small mobile screen (like using the PWA), the different time options are listed out with the other sort options:

[–] wjs018@piefed.wjs018.xyz 2 points 1 week ago

Yeah, that should work then. I haven't really looked at that portion of the code, but I can try to take a peek.

[–] wjs018@piefed.wjs018.xyz 8 points 1 week ago (6 children)

Hmm, that is an interesting idea...

I might look into this one. Would something like voting buttons in the crosspost dropdown be an acceptable alternative? I think I would prefer to keep 1 action (click) means 1 vote, but making it easier to vote on crossposts makes sense with the way that piefed consolidates comments.

So, voting buttons here maybe? (no promises, just an idea) -

[–] wjs018@piefed.wjs018.xyz 6 points 1 week ago

This is planned for the 1.2 release (at least it is on the kanban board).

[–] wjs018@piefed.wjs018.xyz 3 points 1 week ago (3 children)

Do you mean on the bar with the voting buttons instead of being behind the three dots menu?

[–] wjs018@piefed.wjs018.xyz 4 points 1 week ago (2 children)

Are you using an app or the web ui? It is still an open issue that posts are not being marked as read when they are interacted with via the api. It should work as expected if you use the web ui.

[–] wjs018@piefed.wjs018.xyz 7 points 1 week ago (1 children)

I've done a lot of work on the markdown to html edge cases. So, I think things like bold and italics intermingling and garbling each other shouldn't happen any more. If it does, feel free to let me know!

[–] wjs018@piefed.wjs018.xyz 4 points 1 week ago (1 children)

I don't think that's the issue since you can upload images for an image post. It's more the effort of doing file uploads from a dynamically inserted part of the page (the reply box). I don't know enough Javascript to be able to do that.

[–] wjs018@piefed.wjs018.xyz 8 points 1 week ago (2 children)

Not a bad suggestion. When you are browsing the /communities page for example, the leave buttons are in the warning color (yellow if you are using the default dark theme) while the join buttons are in the primary color (blue). I can try to whip up some code for this.

 

As part of our ongoing effort to make the piefed api self-documenting and validate the input and output, there have been a couple tweaks to the api. I realized that I should probably document them here since not everybody is keeping tabs on every codeberg PR that comes through the repo.

  • canAuthUserModerate has been renamed to can_auth_user_moderate in the CommentView schema. This transitioning from camelCase to snake_case will be a theme as I work my way through the endpoints, this is just the first that I ran across.
  • The title field in the PersonView schema will now be equal to the user_name instead of null if the user never set a display name. The way this was handled was a bit inconsistent between local and remote users, but now all users should have this behave the same way.
  • All of the timestamps in the InstanceWithoutFederationState schema have been standardized to the same format. Previously, these were in the standard iso format, but didn't have the Z at the end.
  • The Site schema can now return the site sidebar in html and markdown (if both formats are present). The sidebar field will continue to be html, while the new sidebar_md field will provide the markdown rendition of the sidebar. In the past, the sidebar was only in html, so the markdown version will only become available after an admin updates their instance's sidebar to use markdown instead of html.

That's all the changes that are live up to this point. I will continue to make posts in this community as changes are made to try to keep you all in the loop.

While we are talking about the future, other plans for the future are to have a dedicated development instance for testing bleeding edge code while keeping piefed.social on a more stable branch. In the meantime, feel free to peruse my instance's swagger ui (json version), which is up to date with the api changes as I am working on them (community endpoints are next).

[–] wjs018@piefed.wjs018.xyz 2 points 2 weeks ago

I think that is fine and don't see a problem with that. As for when this issue will get fixed, I merged a fix so other instances hopefully don't get it, but that won't make it onto piefed.social until the Kiwis wake up and @rimu@piefed.social is back online.

view more: next ›