Skip to content

Swipe actions#133

Merged
jwr1 merged 7 commits intomainfrom
swipe_actions
Mar 29, 2025
Merged

Swipe actions#133
jwr1 merged 7 commits intomainfrom
swipe_actions

Conversation

@olorin99
Copy link
Copy Markdown
Contributor

@olorin99 olorin99 commented Mar 28, 2025

Adds customizable swipe gestures to content items. Currently available actions include

  • upvote
  • downvote
  • boost
  • bookmark
  • reply
  • moderatePin
  • moderateMarkNSFW
  • moderateDelete
  • moderateBan

Copy link
Copy Markdown
Member

@jwr1 jwr1 left a comment

Choose a reason for hiding this comment

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

Looks great so far, just have a few points:

  • Could you change the way it's stored in the profile to be four separate fields, instead of an array? I don't think we'd ever have any more or less than four options, so I think it's fine to do it that way. Changing it away from an array would also mean you wouldn't have to use those var newActions = List<SwipeAction>.from lines in multiple places.
  • Could you change the names of the settings to make it more obvious which gesture it's changing? Like use "Left" and "Right" in the names. Not exactly sure how to differentiate the ones that are on the same side though. Maybe "Short" and "Long"? And then also use the new name as the key in the profile as well.
  • Could you make it so the autofocus in the markdown editor is an optional parameter? I certainly agree it should be auto focused in certain contexts, like while replying, but in others, like creating a post, there are other fields as well, and it shouldn't really be automatically focused.
  • Also, I like the upvote and boost being on the left, but could you have a bookmark (short) and reply (long) on the right as the default?

Copy link
Copy Markdown
Member

@jwr1 jwr1 left a comment

Choose a reason for hiding this comment

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

I know this would be more work, but could you also add the swipe actions to the ContentItemCompactPost widget as well, as that's the kind of context where it would really be best in. Maybe you could extract out the changes you made to the ContentItem widget to a separate "wrapper" widget, which would make it easy to implement for both content item widgets without duplicating code.

Remove SwipeAction list in profile.
Change swipe setting names to left/right short/long combinations.
Change swipe action defaults.
Add swipe gestures to compact posts.
@olorin99 olorin99 requested a review from jwr1 March 29, 2025 12:19
Copy link
Copy Markdown
Member

@jwr1 jwr1 left a comment

Choose a reason for hiding this comment

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

Thank you! It's looking great.

@jwr1 jwr1 merged commit 56ead1d into main Mar 29, 2025
2 checks passed
@jwr1 jwr1 deleted the swipe_actions branch March 29, 2025 14:02
@jwr1 jwr1 mentioned this pull request Mar 29, 2025
@jwr1 jwr1 added this to the v0.9.1 milestone Mar 31, 2025
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