Skip to content

Commit 20d463f

Browse files
pfrazeeestrattonbaileytkusanohaileyok
authored
3p moderation services [WIP] (#2550)
* Add modservice screen and profile-header-card * Drop the guidelines for now * Remove ununsed constants * Add label & label group descriptions * Not found state * Reorg, add icon * Subheader * Header * Complete header * Clean up * Add all groups * Fix scroll view * Dialogs side quest * Remove log * Add (WIP) debug mod page * Dialog solution * Add note * Clean up and reorganize localized moderation strings * Memoize * Add example * Add first ReportDialog screen * Report dialog step 2 * Submit * Integrate updates * Move moderation screen * Migrate buttons * Migrate everything * Rough sketch * Fix types * Update atoms values * Abstract ModerationServiceCard * Hook up data to settings page * Handle subscription * Rough enablement * Rough enablement * Some validation, fixes * More work on the mod debug screen * Hook up data * Update invalidation * Hook up data to ReportDialog * Fix native error * Refactor/rewrite the entire moderation-application system * Fix toggles * Add copyright and other option to report * Handle reports on profile vs content * Little cleanup * Get post hiding back in gear * Better loading flow on Mod screen * Clean up Mod screen * Clean up ProfileMod screen * Handle muting correctly * Update enablement on ProfileMod screen * Improve Moderation screen and dialog * Styling, handle disabled labelers * Rework list of labels on own content * Use moderateNotification() * ReportDialog updates * Fix button overflow * Simplify the ProfileModerationService ui * Mod screen design * Move moderation card from the profile header to a tab * Small tweaks to the moderation screen * Enable toggle on mod page * Add notifs to debugmod and dont filter notifs from followed users * Add moderator-service profile view * Wire up more of the modservice data to profiles * A bunch of speculative non-working UI * Cleanup: delete old code * Update ModerationDetailsDialog * Update ReportDialog * Update LabelsOnMe dialog * Handle ReportDialog load better * Rename LabelsOnMeDialog, fix close * Experiment to put labeling under a tab of a normal profile * Moderator variation of profile * Remove dead code and start moving toward latest modsdk * Remove a bunch of now-dead label strings * Update ModDebug to be a bit more intuitive and support custom labels * Minor ui tweaks * Improve consistency of display name blurring * Fix profile-card warning rendering * More debugmod UI tuning * Update to use new labeler semantics * Delete some dead code and do some refactoring * Update profile to pull from labeler definition * Implement new label config controls (wip) * Tweak ui * Implement preference controls on labelers * Rework label pref ui * Get moderation screen working * Add asyncstorage query persistence * Implement label handling * Small cleanup * Implement Likes dialog * Fix: remove text outside of text element * Cleanup * Fix likes dialog on mobile * Implement the label appeal flow * Get report flow working again with temporarily fixed report options * Update onboarding * Enforce limit of ten labeler subscriptions * Fix type errors * Fix lint errors * Improve types of RQ * Some work on Likes dialog, needs discussion * Bit of ReportDialog cleanup * Replace non-single-path SVG * Update nudity descriptions * Update to use new sdk updates * Add adult-content-enabled behavior to label config * Use the default setting of custom labels * Handle global moderation label prefs with the global settings * Fix missing postAuthor * Fix empty moderation page * Add mutewords control back to Mod screen * Tweak adult setting styles * Remove deprecated global labels * Handle underage users on mod screen * Adjust font sizes * Swap in RichText * Like button improvements * Tweaks to Labeler profile * Design tweaks for mod pref dialog * Add tertiary button color * Switch moderation UIs to tertiary color * Update mutewords and hiddenposts to use the new sdk * Add test-environment mod authority * Switch 'gore' to 'graphic-media' * Move nudity out of the adult content control * Remove focus styles from buttons - let the browser behavior handle it * Fixes to the adult content age-gating in moderaiton * Ditch tertiary button color, lighten secondary button * Fix some colors * Remove focused overrides from toggles * Liked by screen * Rework the moderationlabelpref * Fix optimistic like * Cleanup * Change how onboarding handles adult content enabled/disabled * Add special handling of the mod authorities * Tweaks * Update the default labeler avatar to a shield * Add route to go server * Avoid dups due to bad config * Fix attrs * Fix: dont try to detect link/label mismatches on post meta * Correctly show the label behavior when adult content is disabled * Readd the local hiddenPosts handling * WIP * Fix bad merge * Conten hider design tweaks * Fix text string breakage * Adjust source text in ContentHider * Fix link bug * Design tweaks to ContentHider and ModDetailsDialog * Adjust spacing of inform badges * Adjust spacing of embeds in posts * Style tweaks to post/profile alerts * Labels on me and dialog * Remove bad focus styles from post dropdown * Better spacing solution * Tune moderation UIs * Moderation UI tweaks for mobile * Move labelers query on Mod screen * Update to use new SDK appLabelers semantics * Implement report submission * Replace the report modal entirely with the report dialog * Add @ to mod details dialog handle * Bump SDK package * Remove silly type * Add to AWS build CI * Fix ToggleButton overflow * Clean up ModServiceCard, rename to LabelingServiceCard * Hackfix to translate gore labels to graphic-media * Tune content hider sizing on web desktop * Handle self labels * Fix spacing below text-only posts * Fix: send appeals to the right labeler * Give mod page links interactive states * Fix references * Remove focus handling * Remove remnant * Remove the like count from the subscribed labeler listing * Bump @atproto/api@0.11.1 * Remove extra @ * Fix: persist labels to local storage to reduce coverage gaps * update dipendencies * revert dipendencies * Add some explainers on how blocking affects labelers * Tweak copy * Fix underline color in header * Fix profile menu * Handle card overflow * Remove metrics from header * Mute 'account' not 'user' * Show metrics if self * Show the labels tab on logged out view * Fix bad merge * Use purple theming on labelers * Tighten space on LabelerCard * Set staleTime to 6hrs for labeler details * Memoize the memoizers * Drop staleTime to 60s * Move label defs into a context to reduce recomputes * Submit view tweaks * Move labeler fetch below auth * Mitigation: hardcode the bluesky moderation labeler name * Bump sdk * Add missing translated string Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Add missing translated string Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Hailey's fix for incorrect profile tabs Co-authored-by: Hailey <me@haileyok.com> * Feedback * Fix borders, add bottom space * Hailey's fix pt 2 Co-authored-by: Hailey <me@haileyok.com> * Fix post tabs * Integrate feedback pt 1 Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Integrate feedback pt 2 Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Integrate feedback pt 3 Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Integrate feedback pt 4 Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Integrate feedback pt 5 Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Integrate feedback pt 6 Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Integrate feedback pt 7 Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Integrate feedback pt 8 Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> * Format * Integrate new bday modal * Use public agent for getServices * Update casing --------- Co-authored-by: Eric Bailey <git@esb.lol> Co-authored-by: Takayuki KUSANO <65759+tkusano@users.noreply.github.com> Co-authored-by: Hailey <me@haileyok.com>
1 parent d5ebbeb commit 20d463f

File tree

165 files changed

+7029
-5004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+7029
-5004
lines changed

.github/workflows/build-and-push-bskyweb-aws.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ on:
33
push:
44
branches:
55
- main
6-
- traffic-reduction
7-
- respect-optout-for-embeds
6+
- 3p-moderators
7+
88
env:
99
REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }}
1010
USERNAME: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_USERNAME }}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

bskyweb/cmd/bskyweb/server.go

+2
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ func serve(cctx *cli.Context) error {
188188
e.GET("/settings/threads", server.WebGeneric)
189189
e.GET("/settings/external-embeds", server.WebGeneric)
190190
e.GET("/sys/debug", server.WebGeneric)
191+
e.GET("/sys/debug-mod", server.WebGeneric)
191192
e.GET("/sys/log", server.WebGeneric)
192193
e.GET("/support", server.WebGeneric)
193194
e.GET("/support/privacy", server.WebGeneric)
@@ -203,6 +204,7 @@ func serve(cctx *cli.Context) error {
203204
e.GET("/profile/:handleOrDID/lists/:rkey", server.WebGeneric)
204205
e.GET("/profile/:handleOrDID/feed/:rkey", server.WebGeneric)
205206
e.GET("/profile/:handleOrDID/feed/:rkey/liked-by", server.WebGeneric)
207+
e.GET("/profile/:handleOrDID/labeler/liked-by", server.WebGeneric)
206208

207209
// profile RSS feed (DID not handle)
208210
e.GET("/profile/:ident/rss", server.WebProfileRSS)

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"update-extensions": "scripts/updateExtensions.sh"
4545
},
4646
"dependencies": {
47-
"@atproto/api": "^0.10.5",
47+
"@atproto/api": "^0.11.2",
4848
"@bam.tech/react-native-image-resizer": "^3.0.4",
4949
"@braintree/sanitize-url": "^6.0.2",
5050
"@emoji-mart/react": "^1.1.1",
@@ -76,7 +76,9 @@
7676
"@segment/sovran-react-native": "^0.4.5",
7777
"@sentry/react-native": "5.5.0",
7878
"@tamagui/focus-scope": "^1.84.1",
79+
"@tanstack/query-async-storage-persister": "^5.25.0",
7980
"@tanstack/react-query": "^5.8.1",
81+
"@tanstack/react-query-persist-client": "^5.25.0",
8082
"@tiptap/core": "^2.0.0-beta.220",
8183
"@tiptap/extension-document": "^2.0.0-beta.220",
8284
"@tiptap/extension-hard-break": "^2.0.3",

src/App.native.tsx

+28-19
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import React, {useState, useEffect} from 'react'
55
import {RootSiblingParent} from 'react-native-root-siblings'
66
import * as SplashScreen from 'expo-splash-screen'
77
import {GestureHandlerRootView} from 'react-native-gesture-handler'
8-
import {QueryClientProvider} from '@tanstack/react-query'
8+
import {PersistQueryClientProvider} from '@tanstack/react-query-persist-client'
99
import {
1010
SafeAreaProvider,
1111
initialWindowMetrics,
@@ -22,7 +22,11 @@ import {s} from 'lib/styles'
2222
import {Shell} from 'view/shell'
2323
import * as notifications from 'lib/notifications/notifications'
2424
import * as Toast from 'view/com/util/Toast'
25-
import {queryClient} from 'lib/react-query'
25+
import {
26+
queryClient,
27+
asyncStoragePersister,
28+
dehydrateOptions,
29+
} from 'lib/react-query'
2630
import {TestCtrls} from 'view/com/testing/TestCtrls'
2731
import {Provider as ShellStateProvider} from 'state/shell'
2832
import {Provider as ModalStateProvider} from 'state/modals'
@@ -33,6 +37,7 @@ import {Provider as InvitesStateProvider} from 'state/invites'
3337
import {Provider as PrefsStateProvider} from 'state/preferences'
3438
import {Provider as LoggedOutViewProvider} from 'state/shell/logged-out'
3539
import {Provider as SelectedFeedProvider} from 'state/shell/selected-feed'
40+
import {Provider as LabelDefsProvider} from '#/state/preferences/label-defs'
3641
import I18nProvider from './locale/i18nProvider'
3742
import {
3843
Provider as SessionProvider,
@@ -79,21 +84,23 @@ function InnerApp() {
7984
// Resets the entire tree below when it changes:
8085
key={currentAccount?.did}>
8186
<StatsigProvider>
82-
<LoggedOutViewProvider>
83-
<SelectedFeedProvider>
84-
<UnreadNotifsProvider>
85-
<ThemeProvider theme={theme}>
86-
{/* All components should be within this provider */}
87-
<RootSiblingParent>
88-
<GestureHandlerRootView style={s.h100pct}>
89-
<TestCtrls />
90-
<Shell />
91-
</GestureHandlerRootView>
92-
</RootSiblingParent>
93-
</ThemeProvider>
94-
</UnreadNotifsProvider>
95-
</SelectedFeedProvider>
96-
</LoggedOutViewProvider>
87+
<LabelDefsProvider>
88+
<LoggedOutViewProvider>
89+
<SelectedFeedProvider>
90+
<UnreadNotifsProvider>
91+
<ThemeProvider theme={theme}>
92+
{/* All components should be within this provider */}
93+
<RootSiblingParent>
94+
<GestureHandlerRootView style={s.h100pct}>
95+
<TestCtrls />
96+
<Shell />
97+
</GestureHandlerRootView>
98+
</RootSiblingParent>
99+
</ThemeProvider>
100+
</UnreadNotifsProvider>
101+
</SelectedFeedProvider>
102+
</LoggedOutViewProvider>
103+
</LabelDefsProvider>
97104
</StatsigProvider>
98105
</React.Fragment>
99106
</Splash>
@@ -118,7 +125,9 @@ function App() {
118125
* that is set up in the InnerApp component above.
119126
*/
120127
return (
121-
<QueryClientProvider client={queryClient}>
128+
<PersistQueryClientProvider
129+
client={queryClient}
130+
persistOptions={{persister: asyncStoragePersister, dehydrateOptions}}>
122131
<SessionProvider>
123132
<ShellStateProvider>
124133
<PrefsStateProvider>
@@ -140,7 +149,7 @@ function App() {
140149
</PrefsStateProvider>
141150
</ShellStateProvider>
142151
</SessionProvider>
143-
</QueryClientProvider>
152+
</PersistQueryClientProvider>
144153
)
145154
}
146155

src/App.web.tsx

+28-19
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'lib/sentry' // must be near top
22

33
import React, {useState, useEffect} from 'react'
4-
import {QueryClientProvider} from '@tanstack/react-query'
4+
import {PersistQueryClientProvider} from '@tanstack/react-query-persist-client'
55
import {SafeAreaProvider} from 'react-native-safe-area-context'
66
import {RootSiblingParent} from 'react-native-root-siblings'
77

@@ -13,7 +13,11 @@ import {init as initPersistedState} from '#/state/persisted'
1313
import {Shell} from 'view/shell/index'
1414
import {ToastContainer} from 'view/com/util/Toast.web'
1515
import {ThemeProvider} from 'lib/ThemeContext'
16-
import {queryClient} from 'lib/react-query'
16+
import {
17+
queryClient,
18+
asyncStoragePersister,
19+
dehydrateOptions,
20+
} from 'lib/react-query'
1721
import {Provider as ShellStateProvider} from 'state/shell'
1822
import {Provider as ModalStateProvider} from 'state/modals'
1923
import {Provider as DialogStateProvider} from 'state/dialogs'
@@ -23,6 +27,7 @@ import {Provider as InvitesStateProvider} from 'state/invites'
2327
import {Provider as PrefsStateProvider} from 'state/preferences'
2428
import {Provider as LoggedOutViewProvider} from 'state/shell/logged-out'
2529
import {Provider as SelectedFeedProvider} from 'state/shell/selected-feed'
30+
import {Provider as LabelDefsProvider} from '#/state/preferences/label-defs'
2631
import I18nProvider from './locale/i18nProvider'
2732
import {
2833
Provider as SessionProvider,
@@ -56,21 +61,23 @@ function InnerApp() {
5661
// Resets the entire tree below when it changes:
5762
key={currentAccount?.did}>
5863
<StatsigProvider>
59-
<LoggedOutViewProvider>
60-
<SelectedFeedProvider>
61-
<UnreadNotifsProvider>
62-
<ThemeProvider theme={theme}>
63-
{/* All components should be within this provider */}
64-
<RootSiblingParent>
65-
<SafeAreaProvider>
66-
<Shell />
67-
</SafeAreaProvider>
68-
</RootSiblingParent>
69-
<ToastContainer />
70-
</ThemeProvider>
71-
</UnreadNotifsProvider>
72-
</SelectedFeedProvider>
73-
</LoggedOutViewProvider>
64+
<LabelDefsProvider>
65+
<LoggedOutViewProvider>
66+
<SelectedFeedProvider>
67+
<UnreadNotifsProvider>
68+
<ThemeProvider theme={theme}>
69+
{/* All components should be within this provider */}
70+
<RootSiblingParent>
71+
<SafeAreaProvider>
72+
<Shell />
73+
</SafeAreaProvider>
74+
</RootSiblingParent>
75+
<ToastContainer />
76+
</ThemeProvider>
77+
</UnreadNotifsProvider>
78+
</SelectedFeedProvider>
79+
</LoggedOutViewProvider>
80+
</LabelDefsProvider>
7481
</StatsigProvider>
7582
</React.Fragment>
7683
</Alf>
@@ -93,7 +100,9 @@ function App() {
93100
* that is set up in the InnerApp component above.
94101
*/
95102
return (
96-
<QueryClientProvider client={queryClient}>
103+
<PersistQueryClientProvider
104+
client={queryClient}
105+
persistOptions={{persister: asyncStoragePersister, dehydrateOptions}}>
97106
<SessionProvider>
98107
<ShellStateProvider>
99108
<PrefsStateProvider>
@@ -115,7 +124,7 @@ function App() {
115124
</PrefsStateProvider>
116125
</ShellStateProvider>
117126
</SessionProvider>
118-
</QueryClientProvider>
127+
</PersistQueryClientProvider>
119128
)
120129
}
121130

src/Navigation.tsx

+13-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import {SearchScreen} from './view/screens/Search'
4646
import {FeedsScreen} from './view/screens/Feeds'
4747
import {NotificationsScreen} from './view/screens/Notifications'
4848
import {ListsScreen} from './view/screens/Lists'
49-
import {ModerationScreen} from './view/screens/Moderation'
49+
import {ModerationScreen} from '#/screens/Moderation'
5050
import {ModerationModlistsScreen} from './view/screens/ModerationModlists'
5151
import {NotFoundScreen} from './view/screens/NotFound'
5252
import {SettingsScreen} from './view/screens/Settings'
@@ -61,6 +61,7 @@ import {PostThreadScreen} from './view/screens/PostThread'
6161
import {PostLikedByScreen} from './view/screens/PostLikedBy'
6262
import {PostRepostedByScreen} from './view/screens/PostRepostedBy'
6363
import {Storybook} from './view/screens/Storybook'
64+
import {DebugModScreen} from './view/screens/DebugMod'
6465
import {LogScreen} from './view/screens/Log'
6566
import {SupportScreen} from './view/screens/Support'
6667
import {PrivacyPolicyScreen} from './view/screens/PrivacyPolicy'
@@ -78,6 +79,7 @@ import {createNativeStackNavigatorWithAuth} from './view/shell/createNativeStack
7879
import {msg} from '@lingui/macro'
7980
import {i18n, MessageDescriptor} from '@lingui/core'
8081
import HashtagScreen from '#/screens/Hashtag'
82+
import {ProfileLabelerLikedByScreen} from '#/screens/Profile/ProfileLabelerLikedBy'
8183
import {logEvent, attachRouteToLogEvents} from './lib/statsig/statsig'
8284

8385
const navigationRef = createNavigationContainerRef<AllNavigatorParams>()
@@ -198,11 +200,21 @@ function commonScreens(Stack: typeof HomeTab, unreadCountLabel?: string) {
198200
getComponent={() => ProfileFeedLikedByScreen}
199201
options={{title: title(msg`Liked by`)}}
200202
/>
203+
<Stack.Screen
204+
name="ProfileLabelerLikedBy"
205+
getComponent={() => ProfileLabelerLikedByScreen}
206+
options={{title: title(msg`Liked by`)}}
207+
/>
201208
<Stack.Screen
202209
name="Debug"
203210
getComponent={() => Storybook}
204211
options={{title: title(msg`Storybook`), requireAuth: true}}
205212
/>
213+
<Stack.Screen
214+
name="DebugMod"
215+
getComponent={() => DebugModScreen}
216+
options={{title: title(msg`Moderation states`), requireAuth: true}}
217+
/>
206218
<Stack.Screen
207219
name="Log"
208220
getComponent={() => LogScreen}

src/alf/atoms.ts

+10
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export const atoms = {
5050
h_full: {
5151
height: '100%',
5252
},
53+
h_full_vh: web({
54+
height: '100vh',
55+
}),
5356

5457
/*
5558
* Border radius
@@ -243,6 +246,9 @@ export const atoms = {
243246
font_normal: {
244247
fontWeight: tokens.fontWeight.normal,
245248
},
249+
font_semibold: {
250+
fontWeight: '500',
251+
},
246252
font_bold: {
247253
fontWeight: tokens.fontWeight.semibold,
248254
},
@@ -528,6 +534,10 @@ export const atoms = {
528534
/*
529535
* Margin
530536
*/
537+
mx_auto: {
538+
marginLeft: 'auto',
539+
marginRight: 'auto',
540+
},
531541
m_2xs: {
532542
margin: tokens.space._2xs,
533543
},

src/alf/tokens.ts

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export const dimScale = generateScale(12, 100)
1212
export const color = {
1313
trueBlack: '#000000',
1414

15+
temp_purple: 'rgb(105 0 255)',
16+
temp_purple_dark: 'rgb(83 0 202)',
17+
1518
gray_0: `hsl(${BLUE_HUE}, 20%, ${scale[14]}%)`,
1619
gray_25: `hsl(${BLUE_HUE}, 20%, ${scale[13]}%)`,
1720
gray_50: `hsl(${BLUE_HUE}, 20%, ${scale[12]}%)`,

0 commit comments

Comments
 (0)