From 3113e19a8525be7e1ea881745fb5370c61287a45 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 8 Jul 2025 10:44:45 +0300 Subject: [PATCH] add ids to every common screen for web --- src/Navigation.tsx | 129 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 1 deletion(-) diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 19447ec0f2..ec83111fb6 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -103,7 +103,7 @@ import { import {Wizard} from '#/screens/StarterPack/Wizard' import TopicScreen from '#/screens/Topic' import {VideoFeed} from '#/screens/VideoFeed' -import {type Theme, useTheme} from '#/alf' +import {type Theme, useTheme, web} from '#/alf' import { EmailDialogScreenID, useEmailDialogControl, @@ -150,31 +150,37 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) { name="NotFound" getComponent={() => NotFoundScreen} options={{title: title(msg`Not Found`)}} + getId={web(() => 'not-found')} /> 'lists')} /> ModerationScreen} options={{title: title(msg`Moderation`), requireAuth: true}} + getId={web(() => 'moderation')} /> ModerationModlistsScreen} options={{title: title(msg`Moderation Lists`), requireAuth: true}} + getId={web(() => 'moderation-modlists')} /> ModerationMutedAccounts} options={{title: title(msg`Muted Accounts`), requireAuth: true}} + getId={web(() => 'moderation-muted-accounts')} /> ModerationBlockedAccounts} options={{title: title(msg`Blocked Accounts`), requireAuth: true}} + getId={web(() => 'moderation-blocked-accounts')} /> 'moderation-interaction-settings')} /> 'moderation-verification-settings')} /> SettingsScreen} options={{title: title(msg`Settings`), requireAuth: true}} + getId={web(() => 'settings')} /> LanguageSettingsScreen} options={{title: title(msg`Language Settings`), requireAuth: true}} + getId={web(() => 'language-settings')} /> ({ title: bskyTitle(`@${route.params.name}`, unreadCountLabel), })} + getId={web( + (route: React.ComponentProps['route']) => + `profile-${route.params.name}`, + )} /> ({ title: title(msg`People following @${route.params.name}`), })} + getId={web( + ( + route: React.ComponentProps['route'], + ) => `profile-followers-${route.params.name}`, + )} /> ({ title: title(msg`People followed by @${route.params.name}`), })} + getId={web( + (route: React.ComponentProps['route']) => + `profile-follows-${route.params.name}`, + )} /> ({ title: title(msg`Followers of @${route.params.name} that you know`), })} + getId={web( + ( + route: React.ComponentProps< + typeof ProfileKnownFollowersScreen + >['route'], + ) => `profile-known-followers-${route.params.name}`, + )} /> ProfileListScreen} options={{title: title(msg`List`), requireAuth: true}} + getId={web( + (route: React.ComponentProps['route']) => + `profile-list-${route.params.name}`, + )} /> ({ title: title(msg`Search @${route.params.name}'s posts`), })} + getId={web( + (route: React.ComponentProps['route']) => + `profile-search-${route.params.name}`, + )} /> ({ title: title(msg`Post by @${route.params.name}`), })} + getId={web( + (route: React.ComponentProps['route']) => + `post-thread-${route.params.name}-${route.params.rkey}`, + )} /> ({ title: title(msg`Post by @${route.params.name}`), })} + getId={web( + (route: React.ComponentProps['route']) => + `post-liked-by-${route.params.name}-${route.params.rkey}`, + )} /> ({ title: title(msg`Post by @${route.params.name}`), })} + getId={web( + (route: React.ComponentProps['route']) => + `post-reposted-by-${route.params.name}-${route.params.rkey}`, + )} /> ({ title: title(msg`Post by @${route.params.name}`), })} + getId={web( + (route: React.ComponentProps['route']) => + `post-quotes-${route.params.name}-${route.params.rkey}`, + )} /> ProfileFeedScreen} options={{title: title(msg`Feed`)}} + getId={web( + (route: React.ComponentProps['route']) => + `profile-feed-${route.params.name}-${route.params.rkey}`, + )} /> ProfileFeedLikedByScreen} options={{title: title(msg`Liked by`)}} + getId={web( + ( + route: React.ComponentProps< + typeof ProfileFeedLikedByScreen + >['route'], + ) => + `profile-feed-liked-by-${route.params.name}-${route.params.rkey}`, + )} /> ProfileLabelerLikedByScreen} options={{title: title(msg`Liked by`)}} + getId={web( + ( + route: React.ComponentProps< + typeof ProfileLabelerLikedByScreen + >['route'], + ) => `profile-labeler-liked-by-${route.params.name}`, + )} /> Storybook} options={{title: title(msg`Storybook`), requireAuth: true}} + getId={web(() => 'storybook')} /> DebugModScreen} options={{title: title(msg`Moderation states`), requireAuth: true}} + getId={web(() => 'debug-mod')} /> SharedPreferencesTesterScreen} options={{title: title(msg`Shared Preferences Tester`)}} + getId={web(() => 'shared-preferences-tester')} /> LogScreen} options={{title: title(msg`Log`), requireAuth: true}} + getId={web(() => 'log')} /> AppPasswordsScreen} options={{title: title(msg`App Passwords`), requireAuth: true}} + getId={web(() => 'app-passwords')} /> SavedFeeds} options={{title: title(msg`Edit My Feeds`), requireAuth: true}} + getId={web(() => 'saved-feeds')} /> 'following-feed-preferences')} /> ThreadPreferencesScreen} options={{title: title(msg`Threads Preferences`), requireAuth: true}} + getId={web(() => 'threads-preferences')} /> 'external-media-preferences')} /> 'accessibility-settings')} /> 'appearance-settings')} /> 'account-settings')} /> 'privacy-and-security-settings')} /> 'activity-privacy-settings')} /> NotificationSettingsScreen} options={{title: title(msg`Notification settings`), requireAuth: true}} + getId={web(() => 'notification-settings')} /> 'reply-notification-settings')} /> 'mention-notification-settings')} /> 'quote-notification-settings')} /> 'like-notification-settings')} /> 'repost-notification-settings')} /> 'new-follower-notification-settings')} /> 'likes-on-reposts-notification-settings')} /> 'reposts-on-reposts-notification-settings')} /> 'activity-notification-settings')} /> 'miscellaneous-notification-settings')} /> 'content-and-media-settings')} /> 'interests-settings')} /> 'about-settings')} /> 'app-icon-settings')} /> HashtagScreen} options={{title: title(msg`Hashtag`)}} + getId={web( + (route: React.ComponentProps['route']) => + `hashtag-${route.params.tag}-${route.params.author ?? 'all'}`, + )} /> TopicScreen} options={{title: title(msg`Topic`)}} + getId={web( + (route: React.ComponentProps['route']) => + `topic-${route.params.topic}`, + )} /> MessagesConversationScreen} options={{title: title(msg`Chat`), requireAuth: true}} + getId={web( + ( + route: React.ComponentProps< + typeof MessagesConversationScreen + >['route'], + ) => `conversation-${route.params.conversation}`, + )} /> MessagesSettingsScreen} options={{title: title(msg`Chat settings`), requireAuth: true}} + getId={web(() => 'chat-settings')} /> MessagesInboxScreen} options={{title: title(msg`Chat request inbox`), requireAuth: true}} + getId={web(() => 'chat-inbox')} /> NotificationsActivityListScreen} options={{title: title(msg`Notifications`), requireAuth: true}} + getId={web(() => 'notifications-activity-list')} /> LegacyNotificationSettingsScreen} options={{title: title(msg`Notification settings`), requireAuth: true}} + getId={web(() => 'legacy-notification-settings')} /> FeedsScreen} options={{title: title(msg`Feeds`)}} + getId={web(() => 'feeds')} /> StarterPackScreen} options={{title: title(msg`Starter Pack`)}} + // leave id blank /> StarterPackScreenShort} options={{title: title(msg`Starter Pack`)}} + // leave id blank /> Wizard} options={{title: title(msg`Create a starter pack`), requireAuth: true}} + // leave id blank /> Wizard} options={{title: title(msg`Edit your starter pack`), requireAuth: true}} + // leave id blank /> )