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

There's no notification of newly received message(s) if you are reading historical messages in the back scroll #4475

Closed
parasharrajat opened this issue Aug 6, 2021 · 31 comments · Fixed by #4603
Assignees
Labels
Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@parasharrajat
Copy link
Member

parasharrajat commented Aug 6, 2021

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Action Performed:

Break down in numbered steps

  1. Open any chat between user A and user B on device A(User A).
  2. Scroll into the chat history on the web on device A.
  3. Send a message from User B to User A.

Expected Result:

Describe what you think should've happened

When reading scrollback in a given chat, show a X new message(s) indicator if new messages are received in that DM. This should serve as a method of notifying a user that they have unread chats. See mockup below:

image

  • Button sizing is 28px tall, 11px font size and should be consistent with our split button pattern that we have on the IOU payment page.
  • This notification button should persist until you either close it with the "X" or you scroll down to view the new messages.

Actual Result:

Describe what actually happened

Nothing happens which tells the user about the new message.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Just remain at bottom of the chat.

Platform:

Where is this issue occurring? All

  • Web
  • iOS
  • Android
  • Desktop App
  • Mobile Web

Version Number: 1..0.82.3
Logs: https://stackoverflow.com/c/expensify/questions/4856

no-indicator.mp4

Upwork job link: https://www.upwork.com/jobs/~01d1ea31874a29c2d1

View all open jobs on Upwork

Suggestion

Overall Idea is to show a different new marker from the new line indicator. This could be placed on the Center top of the Chat body Area(where you see a list of chat messages) or the right-top of the composer which is minimized to icon form on Mobile.

I vouch for the Top-center Position of the report Page. a marker as simple as new messages in green which when clicked scroll the chat list to the most recent(bottom).

Example
Screenshot 2021-08-11 06:53:47

@parasharrajat parasharrajat added AutoAssignerTriage Auto assign issues for triage to an available triage team member Daily KSv2 labels Aug 6, 2021
@MelvinBot
Copy link

Triggered auto assignment to @michaelhaxhiu (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

@MelvinBot MelvinBot removed the AutoAssignerTriage Auto assign issues for triage to an available triage team member label Aug 6, 2021
@aman-atg

This comment has been minimized.

@parasharrajat

This comment has been minimized.

@aman-atg

This comment has been minimized.

@mananjadhav
Copy link
Collaborator

I agree with @parasharrajat. Ideally, I would want a separate nudge similar to Linkedin or slack which says "New Messages Received", which when clicked would probably scroll/take me to the start of the new chats.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Aug 6, 2021

@parasharrajat What do you propose here makes all the difference. If it's a different indicator like in slack I assume. Then it's a completely different issue & usecase.

What my solution does when you scroll back down after viewing history, it will show a new marker indicator above the oldest new message received.

@aman-atg
Copy link
Contributor

aman-atg commented Aug 6, 2021

I agree with @parasharrajat. Ideally, I would want a separate nudge similar to Linkedin or slack which says "New Messages Received", which when clicked would probably scroll/take me to the start of the new chats.

Yes, that would be a great solution for this issue. And I was just wondering if both the issues can be solved by a single solution.

@parasharrajat

This comment has been minimized.

@MelvinBot
Copy link

@michaelhaxhiu Whoops! This issue is 2 days overdue. Let's get this updated quick!

@michaelhaxhiu

This comment has been minimized.

@MelvinBot
Copy link

Triggered auto assignment to @Beamanator (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@michaelhaxhiu michaelhaxhiu changed the title No way to know if there is a new message when user is viewing old messages. There's no notification of newly received message(s) if you are reading historical messages in the back scroll Aug 11, 2021
@parasharrajat

This comment has been minimized.

@michaelhaxhiu
Copy link
Contributor

@Beamanator Rather than self-assessing this GH and posting this to Upwork on my own accord, I'm using the Engineering label to get some input before I proceed. I'd love your 2 cents.

Do you agree that this GH and #4472 should remain separate? Or should these be combined into 1?

@parasharrajat can you or someone else define what a marker is? I'm trying to deduce it but not sure I understand it perfectly yet 😓 (that's probably my fault - new terminology).

@parasharrajat
Copy link
Member Author

parasharrajat commented Aug 11, 2021

@michaelhaxhiu I added the Suggestion section in the issue's body. Feel free to generalize it. It's better if you pull in someone from the Design team as we would be needing their help as well. A design label is also good.

Also, not yet need to be external, first, a discussion is needed to be taken place, if we want to move forward with this. Opening a slack thread.

@michaelhaxhiu
Copy link
Contributor

michaelhaxhiu commented Aug 11, 2021

Are we saying marker to mean a "notification" of some kind? I see that there is no notification delivered when:

  • User1 is reading the scrollback history from User2
  • Meanwhile, User2 sends a new message to User1

Am I understanding what marker means here?

Also, not yet need to be external, first, a discussion is needed to be taken place, if we want to move forward with this. Opening a slack thread.

Yep agreed - this isn't ready for External until we hammer out the details together :)

@MelvinBot
Copy link

Triggered auto assignment to @sylveawong (Design), see these Stack Overflow questions for more details.

@michaelhaxhiu
Copy link
Contributor

Spoke to @parasharrajat 1:1 and he clarified that by "marker", he means this sort of unread notification. He added this to the GH Body too ⭐ :

image.

@Beamanator
Copy link
Contributor

Beamanator commented Aug 11, 2021

@Beamanator Rather than self-assessing this GH and posting this to Upwork on my own accord, I'm using the Engineering label to get some input before I proceed. I'd love your 2 cents.

That sounds great, thanks!

Do you agree that this GH and #4472 should remain separate? Or should these be combined into 1?

I agree these should remain separate and here's why: In slack, both indicators / markers are present (see this video - the one @parasharrajat mentioned in this issue and the one @Santhosh-Sellavel mentioned in his issue - #4472) and I think it would be amazing if we could add both to NewDot:

Screen.Recording.2021-08-11.at.9.35.08.AM.mov

However, before marking External myself, I'd also love the @Expensify/design team's input on what the new indicator / marker suggested here would look like 👍

@shawnborton
Copy link
Contributor

I like this idea. In terms of the design, I am thinking something like this which is consistent with our small button sizes (28px tall, 11px font size) and also consistent with our split button pattern that we have on the IOU payment page:

image

@michaelhaxhiu
Copy link
Contributor

Roger that, sounds good 👌

I think it'll work well since the marker is visually small, so even when it persists it's not obtrusive to reading scrollback

@MelvinBot MelvinBot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 11, 2021
@michaelhaxhiu michaelhaxhiu removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 11, 2021
@michaelhaxhiu
Copy link
Contributor

  • Updated the Github body to include the Design mock + button behavior guidance.
  • Posted job to Upwork, can you make the job proposal next @parasharrajat so I can hire you?
  • Once that's done, I'll assign @parasharrajat to this GH and @Beamanator will be the eng to review the PR

🚀

@parasharrajat
Copy link
Member Author

parasharrajat commented Aug 11, 2021

Here is the proposal @Beamanator

  1. I will create a new component that shows the marker on the ReportBody.
  2. We have to track the scroll position of the flat list using onScroll in ReportActionView.js
    onScroll={e => this.currentScrollOffset = -e.nativeEvent.contentOffset.y}
  1. Now we add the Marker as a sibling component which takes the count from this.props.report.unreadActionCount
					<MarkerBadge
                    active={this.state.markerActive}
                    count={this.props.report.unreadActionCount}
                    onClick={scrollToBottom}
                    onClose={hide}
                />
  1. As ReportActionView does not render when we scroll down we have to put a check in the onScroll so that whenever a fixed threshold is reached trigger hide action the Markerbadge by setting active false.
  2. Markerbadge is set to active when this.currentScrollOffset < -200(threshold). It deactivate when this.currentScrollOffset >-200(threshold).

MarkerBadge will look like Obviously, I will the App Style Guide this is just to show how will it behave.

const MARKER_NOT_ACTIVE_TRANSLATE_Y = -30;
const MARKER_ACTIVE_TRANSLATE_Y = 10;

const Markerbadge = ({
    count,
    onClick,
    onClose,
    active,
}) => {
    const [translateY] = useState(new Animated.Value(MARKER_NOT_ACTIVE_TRANSLATE_Y));
    const show = () => {
        Animated.spring(translateY, {
            toValue: MARKER_ACTIVE_TRANSLATE_Y,
            duration: 80,
            useNativeDriver: true,
        }).start();
    };
    const hide = () => {
        Animated.spring(translateY, {
            toValue: MARKER_NOT_ACTIVE_TRANSLATE_Y,
            duration: 80,
            useNativeDriver: true,
        }).start();
    };

    useEffect(() => {
        if (active && count > 0) {
            show();
        } else {
            hide();
        }
    }, [count, active]);

    return (
        <View
            style={[
                {
                    position: 'absolute',
                    left: '50%',
                    top: 0,
                    zIndex: 100,
                    backfaceVisibility: 'hidden',
                    visibility: 'hidden',
                },
            ]}
        >
            <Animated.View style={[
                styles.flexRow,
                styles.justifyContentBetween,
                styles.alignItemsCenter,
                {
                    backfaceVisibility: 'visible',
                    visibility: 'visible',
                    left: '-50%',
                    transform: [
                        {translateY},
                    ],
                },
            ]}
            >
                <Button
                    success
                    small
                    onPress={onClick}
                    ContentComponent={() => (
                        <View style={[styles.flexRow]}>
                            <Icon small src={DownArrow} fill={themeColors.textReversed} />
                            <Text
                                selectable={false}
                                style={[
                                    styles.ml2,
                                    styles.buttonSmallText,
                                    styles.textWhite,
                                ]}
                            >
                                {count}
                                {' '}
                                new messages
                            </Text>
                        </View>
                    )}
                    shouldRemoveRightBorderRadius
                    style={[styles.flex1]}
                />
                <Button
                    success
                    small
                    style={[styles.buttonDropdown]}
                    onPress={onClose}
                    shouldRemoveLeftBorderRadius
                    ContentComponent={() => (
                        <Icon small src={Close} fill={themeColors.textReversed} />
                    )}
                />
            </Animated.View>
        </View>
    );
};

Glimpse

image

@Beamanator
Copy link
Contributor

Thanks so much @parasharrajat for your proposal, that looks fantastic - I can't wait to see it live 💪 please submit a PR when you have a chance! And @michaelhaxhiu please hire Rajat when you have a chance too 👍

@michaelhaxhiu
Copy link
Contributor

Hired, let's start this party.

@Beamanator
Copy link
Contributor

Reopening, waiting 7 days for regressions 👍

@Beamanator Beamanator added the Weekly KSv2 label Aug 16, 2021
@MelvinBot MelvinBot removed the Overdue label Aug 16, 2021
@Beamanator Beamanator added Overdue and removed Daily KSv2 labels Aug 16, 2021
@Beamanator
Copy link
Contributor

Making weekly since PR was merged last week

@parasharrajat
Copy link
Member Author

Any news for me on Upwork?

@MelvinBot MelvinBot removed the Overdue label Aug 24, 2021
@michaelhaxhiu
Copy link
Contributor

@parasharrajat just paid it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants