-
Notifications
You must be signed in to change notification settings - Fork 45
chore(CLNP-2919): fixed issues from message threading QA #182
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
Merged
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
1727b18
Implement GroupChannel thread.
OnestarLee 0620e93
Clean up code
OnestarLee 48c6727
Fixed lint
OnestarLee 636a0b9
Update uikit-tools version
OnestarLee 4f06819
Apply review
OnestarLee 252b977
Fixed lint
OnestarLee a4861ac
Apply review
OnestarLee 169b40e
Apply review
OnestarLee f2de01a
Apply review
OnestarLee 528c209
Apply review
OnestarLee 1af97bf
Changed threadReplySelectType to thread
OnestarLee c793d25
Apply review
OnestarLee a915920
chore: update parent message reactions UI
bang9 6a9b220
chore: add applyReactionEvent to reaction addon
bang9 0e40c3d
chore: resolve message gap issue in thread fragment
bang9 08d4a54
Apply review
OnestarLee 514efc1
chore: disable message grouping if reply or thread message
bang9 9ae9a63
chore: update message grouping logic
bang9 431454b
chore: add color to more button.
OnestarLee d6732fd
chore: fixed lint.
OnestarLee e494858
chore: update parent message properly
bang9 c519bbb
chore: improve thread message list.
OnestarLee db2c418
Merge remote-tracking branch 'origin/feat/message-threading' into fea…
OnestarLee 03ae8a1
chore: improve thread message list.
OnestarLee fba519d
chore: change version for sample test.
OnestarLee f4753cd
chore: fixed not going to channel when clicking title.
OnestarLee 8bd34b7
chore: fixed to show 'Reply to thread' in the placeholder when there…
OnestarLee 7f2b70a
chore: removed NewMessageButton, ScrollToBottomButton in thread.
OnestarLee b61954b
chore: fixed usernames are not displaying in thread.
OnestarLee 1e8b68e
chore: fixed an issue where it is possible to enter an invalid thread.
OnestarLee 54e37b6
chore: fixed an issue where incorrect sentences are displayed when re…
OnestarLee 805c80f
chore: removed NewMessageButton, ScrollToBottomButton in thread.
OnestarLee 9d55ef1
Merge remote-tracking branch 'refs/remotes/origin/feat/message-thread…
OnestarLee 742180b
chore: fixed inverted no message.
OnestarLee c2bd6c9
chore: update reply count format to display 99+ replies for counts of…
OnestarLee 5147852
chore: fixed issue with mention suggestion list sorting
OnestarLee f7a4334
chore: fixed issue with file upload size limit exceeded
OnestarLee 9fe3a0f
chore: fixed issue with file upload size limit exceeded
OnestarLee 5390017
chore: add voice message status manager
OnestarLee 226fdb6
chore: add voice message status manager
OnestarLee ceae6b8
chore: change scroll timeout
OnestarLee 4e797aa
chore: organize code
OnestarLee 7b9072c
chore: fixed scroll issue
OnestarLee 1b59c86
chore: apply review.
OnestarLee f906482
chore: update note
bang9 6a07692
chore: apply review.
OnestarLee 59c1b2d
Merge remote-tracking branch 'origin/feat/message-threading-qa' into …
OnestarLee 484199d
chore: apply review when clicking the subtitle
OnestarLee a7d75a7
chore: apply review when clicking the subtitle
OnestarLee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { ApplicationAttributes, PremiumFeatures, SendbirdChatSDK } from '@sendbird/uikit-utils'; | ||
|
||
export const useAppFeatures = (sdk: SendbirdChatSDK) => { | ||
const { premiumFeatureList = [], applicationAttributes = [] } = sdk.appInfo ?? {}; | ||
const { premiumFeatureList = [], applicationAttributes = [], uploadSizeLimit } = sdk.appInfo ?? {}; | ||
return { | ||
deliveryReceiptEnabled: premiumFeatureList.includes(PremiumFeatures.delivery_receipt), | ||
broadcastChannelEnabled: applicationAttributes.includes(ApplicationAttributes.allow_broadcast_channel), | ||
superGroupChannelEnabled: applicationAttributes.includes(ApplicationAttributes.allow_super_group_channel), | ||
reactionEnabled: applicationAttributes.includes(ApplicationAttributes.reactions), | ||
uploadSizeLimit: uploadSizeLimit, | ||
}; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
packages/uikit-react-native/src/components/ThreadChatFlatList/index.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React, { forwardRef, useRef } from 'react'; | ||
import { FlatListProps, FlatList as RNFlatList, StyleSheet } from 'react-native'; | ||
|
||
import { useUIKitTheme } from '@sendbird/uikit-react-native-foundation'; | ||
import { NOOP, SendbirdMessage, getMessageUniqId, useFreshCallback } from '@sendbird/uikit-utils'; | ||
|
||
import FlatListInternal from '../ChatFlatList/FlatListInternal'; | ||
|
||
const BOTTOM_DETECT_THRESHOLD = 50; | ||
const UNREACHABLE_THRESHOLD = Number.MIN_SAFE_INTEGER; | ||
|
||
type Props = Omit<FlatListProps<SendbirdMessage>, 'onEndReached'> & { | ||
onBottomReached: () => void; | ||
onTopReached: () => void; | ||
onScrolledAwayFromBottom: (value: boolean) => void; | ||
}; | ||
const ThreadChatFlatList = forwardRef<RNFlatList, Props>(function ThreadChatFlatList( | ||
{ onTopReached, onBottomReached, onScrolledAwayFromBottom, onScroll, ...props }, | ||
ref, | ||
) { | ||
const { select } = useUIKitTheme(); | ||
const contentOffsetY = useRef(0); | ||
|
||
const _onScroll = useFreshCallback<NonNullable<Props['onScroll']>>((event) => { | ||
onScroll?.(event); | ||
|
||
const { contentOffset, contentSize, layoutMeasurement } = event.nativeEvent; | ||
|
||
const prevOffsetY = contentOffsetY.current; | ||
const currOffsetY = contentOffset.y; | ||
|
||
const bottomDetectThreshold = contentSize.height - layoutMeasurement.height - BOTTOM_DETECT_THRESHOLD; | ||
if (bottomDetectThreshold < prevOffsetY && currOffsetY <= bottomDetectThreshold) { | ||
onScrolledAwayFromBottom(true); | ||
} else if (bottomDetectThreshold < currOffsetY && prevOffsetY <= bottomDetectThreshold) { | ||
onScrolledAwayFromBottom(false); | ||
} | ||
|
||
contentOffsetY.current = contentOffset.y; | ||
}); | ||
|
||
return ( | ||
<FlatListInternal | ||
bounces={false} | ||
removeClippedSubviews | ||
keyboardDismissMode={'on-drag'} | ||
keyboardShouldPersistTaps={'handled'} | ||
indicatorStyle={select({ light: 'black', dark: 'white' })} | ||
{...props} | ||
ref={ref} | ||
onEndReached={onBottomReached} | ||
onScrollToIndexFailed={NOOP} | ||
onStartReached={onTopReached} | ||
scrollEventThrottle={16} | ||
onScroll={_onScroll} | ||
keyExtractor={getMessageUniqId} | ||
style={{ flex: 1, ...StyleSheet.flatten(props.style) }} | ||
maintainVisibleContentPosition={{ minIndexForVisible: 0, autoscrollToTopThreshold: UNREACHABLE_THRESHOLD }} | ||
/> | ||
); | ||
}); | ||
|
||
export default ThreadChatFlatList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
이거 하나 고려를 해봐야 할 게 있는데요, 아래처럼 searchItem 이 inline object 로 전달될 경우
렌더링마다 새로운 오브젝트가 생성 되어 전달됩니다.
이렇게 전달된 케이스에서는 렌더링마다 새로운 오브젝트가 생성되면서 (주소)값이 변했다고 인식되기 때문에
매 렌더링마다 side effect(useEffect 의 로직) 가 트리거 됩니다. (isFirstMount 를 추가해놓은 이유이기도 합니다.)
Uh oh!
There was an error while loading. Please reload this page.
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.
그럼 searchItem 말고 searchItem.startingPoint 기준으로 처리하는건 어떨까요?
기능상 searchItem에 변화가 되었을때 스크롤이 되어야 하는데 현재는 startingPoint만 가지고 있어서 searchItem.startingPoint 이걸로 처리하고 추후에 종류가 늘어나면 다시 고려해보는것도...
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.
옙 기존 로직에서 deps 에
[isFirstMount, props.searchItem?.startingPoint]
로만 업데이트 해서 적용 되는지 체크한번 해봐주실 수 있을까요?Uh oh!
There was an error while loading. Please reload this page.
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.
기존 로직에서 if 조건에 isFirstMount 가있어서 GroupChannel -> Thread -> GroupChannel 로 넘어갈경우 isFirstMount 가 false라서 실행이 안되는데요
현재 Thread -> GroupChannel 가는 상황에서 isFirstMount 가 false 인게 문제라 어떻게 수정하든 isFirstMount 관련 처리는 빠져야 할것 같아요
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.
아 그러네유! 넵 일단 빼시죠