Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add list hidden screen #4958

Merged
merged 12 commits into from
Aug 20, 2024
Merged

Add list hidden screen #4958

merged 12 commits into from
Aug 20, 2024

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Aug 20, 2024

Why

Whenever a list gets a !hide flag applied to it, the app should prevent users from viewing the list. However, users do still need to be able to remove the list from their pins or subscribed mod lists. Let's add a screen to do that.

We also were not hiding the list name from the title, since it was being set in useSetTitle(). I removed that, and it will show List Hidden in those cases.

How

Whenever viewing the list, a screen will be shown telling the user the list has been hidden. If they are the owner, they will have the option to delete the list. If they are subscribed to the moderation list, they will be able to unsubscribe. And if they have the list saved or in their pins, they'll be able to remove it from there.

Test Plan

Two test lists that I have made: http://localhost:19006/profile/haileyok.com/lists/3l247irgjn62r and http://localhost:19006/profile/haileyok.com/lists/3l24csobejw2r

You can also test deleting the list by changing the isHidden variable on line 151 in ProfileList.tsx to true.

Whenever you are the creator of the list, you should be able to still tap into the list with "Show anyway".

Screenshot 2024-08-20 at 11 29 05 AM

Non-creators should not be able to see the list.

Screenshot 2024-08-20 at 11 29 47 AM

However, if you are not the creator and you have saved or subscribed to the list, you should be given the ability to unsave/unsubscribe from that list.

Screenshot 2024-08-20 at 11 32 14 AM

Screenshot 2024-08-20 at 11 33 21 AM

Copy link

render bot commented Aug 20, 2024

}
}
}, [navigation, canGoBack, onGoBackProp])
const goBack = useGoBack(onGoBack)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No change, just extracting this function to a reusable hook.

Copy link

github-actions bot commented Aug 20, 2024

Old size New size Diff
7.1 MB 7.1 MB -354 B (-0.00%)

Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

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

Looks so good!

src/view/screens/ProfileList.tsx Show resolved Hide resolved
@estrattonbailey
Copy link
Member

We should also hide the list name under Moderation > Lists in user settings for subscribers

Co-authored-by: Hailey <me@haileyok.com>
@haileyok
Copy link
Contributor Author

We should also hide the list name under Moderation > Lists in user settings for subscribers

I'm going to PR this separately.

Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

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

Nice! Couple of nits. I can hit them in a bit if you don't beat me 👍

src/screens/List/ListHiddenScreen.tsx Show resolved Hide resolved
src/screens/List/ListHiddenScreen.tsx Show resolved Hide resolved
src/screens/List/ListHiddenScreen.tsx Show resolved Hide resolved
haileyok and others added 5 commits August 20, 2024 15:14
* cleanup

* hide title of moderation list

* temp

* clean

* add margin

* loosen types

* tweak type

* add an `override` prop to `hider`

* Props switcheroo

---------

Co-authored-by: Eric Bailey <git@esb.lol>
@haileyok haileyok merged commit 723896a into main Aug 20, 2024
6 checks passed
estrattonbailey added a commit that referenced this pull request Aug 20, 2024
estrattonbailey added a commit that referenced this pull request Aug 21, 2024
* origin/main: (50 commits)
  Add `list hidden` screen (#4958)
  Expose more methods, support disabled items (#4954)
  Expose more props from button (#4953)
  Fix orphaned feed slices, handle blocks (#4944)
  Tweak `expo-modules-core` hack patch (#4955)
  [Experiment] Always show bottom bar (#4946)
  Revert "[Video] Download videos" (#4945)
  Move global "Sign out" out of the current account row (#4941)
  Hack patch for testing OTA update crash behavior (#4942)
  [Video] Download videos (#4886)
  swap control files (#4936)
  [Embed] Starter pack embed embed (#4935)
  [Video] set audio category to ambient every time a new player is made (#4934)
  Add `/live/` to supported YouTube embed URLs (#4932)
  [Video] Try/catch video play/pause (#4930)
  Don't kick to login screen on network error (#4911)
  Remove .withProxy() calls (#4929)
  [Video] Audio duck off main thread (#4926)
  subclass agent to add setPersistSessionHandler (#4928)
  [Video] Fix crash when switching tabs (#4925)
  ...
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