-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Clean up draft message subscriptions #47866
Clean up draft message subscriptions #47866
Conversation
@hungvu193 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Please let me know when you complete your checklist then I can start a review. Ty |
@hungvu193 The PR is ready. On iOS, I notice that the main composer is hidden when editing the message above (this issue also occurs on the main branch) |
Cool. Reviewing shortly |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-08-22.at.23.08.20.movAndroid: mWeb ChromeScreen.Recording.2024-08-22.at.23.10.18.moviOS: NativeScreen.Recording.2024-08-22.at.22.58.50.moviOS: mWeb SafariScreen.Recording.2024-08-22.at.23.01.17.movMacOS: Chrome / SafariChrome.movMacOS: DesktopScreen.Recording.2024-08-22.at.22.43.17.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code change looks good, but I think we also need to clean up OnyxProvider
to remove the now-unused context. While we're at it, let's clean up that file a bit further to remove more unused stuff:
diff --git a/src/components/OnyxProvider.tsx b/src/components/OnyxProvider.tsx
index af16b7300e1..23ddf2b0c4d 100644
--- a/src/components/OnyxProvider.tsx
+++ b/src/components/OnyxProvider.tsx
@@ -6,17 +6,15 @@ import createOnyxContext from './createOnyxContext';
// Set up any providers for individual keys. This should only be used in cases where many components will subscribe to
// the same key (e.g. FlatList renderItem components)
const [withNetwork, NetworkProvider, NetworkContext] = createOnyxContext(ONYXKEYS.NETWORK);
-const [withPersonalDetails, PersonalDetailsProvider, , usePersonalDetails] = createOnyxContext(ONYXKEYS.PERSONAL_DETAILS_LIST);
+const [, PersonalDetailsProvider, , usePersonalDetails] = createOnyxContext(ONYXKEYS.PERSONAL_DETAILS_LIST);
const [withCurrentDate, CurrentDateProvider] = createOnyxContext(ONYXKEYS.CURRENT_DATE);
-const [withReportActionsDrafts, ReportActionsDraftsProvider, , useReportActionsDrafts] = createOnyxContext(ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS);
-const [withBlockedFromConcierge, BlockedFromConciergeProvider, , useBlockedFromConcierge] = createOnyxContext(ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE);
-const [withBetas, BetasProvider, BetasContext, useBetas] = createOnyxContext(ONYXKEYS.BETAS);
-const [withReportCommentDrafts, ReportCommentDraftsProvider] = createOnyxContext(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT);
-const [withPreferredTheme, PreferredThemeProvider, PreferredThemeContext] = createOnyxContext(ONYXKEYS.PREFERRED_THEME);
-const [withFrequentlyUsedEmojis, FrequentlyUsedEmojisProvider, , useFrequentlyUsedEmojis] = createOnyxContext(ONYXKEYS.FREQUENTLY_USED_EMOJIS);
-const [withPreferredEmojiSkinTone, PreferredEmojiSkinToneProvider, PreferredEmojiSkinToneContext] = createOnyxContext(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE);
+const [, BlockedFromConciergeProvider, , useBlockedFromConcierge] = createOnyxContext(ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE);
+const [, BetasProvider, BetasContext, useBetas] = createOnyxContext(ONYXKEYS.BETAS);
+const [, ReportCommentDraftsProvider] = createOnyxContext(ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT);
+const [, PreferredThemeProvider, PreferredThemeContext] = createOnyxContext(ONYXKEYS.PREFERRED_THEME);
+const [, FrequentlyUsedEmojisProvider, , useFrequentlyUsedEmojis] = createOnyxContext(ONYXKEYS.FREQUENTLY_USED_EMOJIS);
+const [, PreferredEmojiSkinToneProvider, PreferredEmojiSkinToneContext] = createOnyxContext(ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE);
const [, SessionProvider, , useSession] = createOnyxContext(ONYXKEYS.SESSION);
-const [, AccountProvider, , useAccount] = createOnyxContext(ONYXKEYS.ACCOUNT);
type OnyxProviderProps = {
/** Rendered child component */
@@ -29,7 +27,6 @@ function OnyxProvider(props: OnyxProviderProps) {
components={[
NetworkProvider,
PersonalDetailsProvider,
- ReportActionsDraftsProvider,
CurrentDateProvider,
BlockedFromConciergeProvider,
BetasProvider,
@@ -38,7 +35,6 @@ function OnyxProvider(props: OnyxProviderProps) {
FrequentlyUsedEmojisProvider,
PreferredEmojiSkinToneProvider,
SessionProvider,
- AccountProvider,
]}
>
{props.children}
@@ -52,24 +48,14 @@ export default OnyxProvider;
export {
withNetwork,
- withPersonalDetails,
usePersonalDetails,
- withReportActionsDrafts,
withCurrentDate,
- withBlockedFromConcierge,
- withBetas,
NetworkContext,
BetasContext,
- withReportCommentDrafts,
- withPreferredTheme,
PreferredThemeContext,
useBetas,
- withFrequentlyUsedEmojis,
useFrequentlyUsedEmojis,
- withPreferredEmojiSkinTone,
PreferredEmojiSkinToneContext,
useBlockedFromConcierge,
- useReportActionsDrafts,
useSession,
- useAccount,
};
@roryabraham I pushed a new commit to include your suggestion |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Performance Comparison Report 📊Significant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
|
@Expensify/mobile-deployers 📣 Please look into this performance regression as it's a deploy blocker. |
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.0.25-0 🚀
|
1 similar comment
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.0.25-0 🚀
|
Details
Fixed Issues
$ #47861
PROPOSAL: #47861 (comment)
Tests
QA Steps
Offline tests
QA Steps
This is a refactor with no changes to the UI. We’re just ensuring that the draft message displays correctly.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen97p.mp4
Android: mWeb Chrome
Screen96p.mp4
iOS: Native
Screen95p.mp4
iOS: mWeb Safari
Screen94.mov
MacOS: Chrome / Safari
Screen92.mov
MacOS: Desktop
Screen93.mp4