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

[$250] mWeb/Chrome - Chat - Edition composer is cutted when editing multiline message near the top of screen #52138

Open
1 of 8 tasks
lanitochka17 opened this issue Nov 6, 2024 · 47 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@lanitochka17
Copy link

lanitochka17 commented Nov 6, 2024

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


Version Number: 9.0.58-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5184687&group_by=cases:section_id&group_order=asc&group_id=292106
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the staging.new.expensify.com website
  2. Open any chat with long history
  3. Long tap on a multiline message displayed near the top of the screen
  4. Select "Edit Message"
  5. Verify that the chat is scrolled up and edition composer is fully visible

Expected Result:

When trying to edit a multiline message displayed near the top of the screen, the chat should be scrolled up to make the composer fully visible

Actual Result:

When trying to edit a multiline message displayed near the top of the screen, the chat is not scrolled up when the keyboard is opened and the edition composer gets cutted off by the chat header

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence
Bug6656756_1730911459509.Edition_Box.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021857151760601711832
  • Upwork Job ID: 1857151760601711832
  • Last Price Increase: 2024-12-28
  • Automatic offers:
    • ZhenjaHorbach | Contributor | 105195249
Issue OwnerCurrent Issue Owner: @thesahindia
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 6, 2024
Copy link

melvin-bot bot commented Nov 6, 2024

Triggered auto assignment to @abekkala (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added the Overdue label Nov 11, 2024
Copy link

melvin-bot bot commented Nov 12, 2024

@abekkala Huh... This is 4 days overdue. Who can take care of this?

Copy link

melvin-bot bot commented Nov 14, 2024

@abekkala 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@abekkala abekkala added the External Added to denote the issue can be worked on by a contributor label Nov 14, 2024
@melvin-bot melvin-bot bot changed the title mWeb/Chrome - Chat - Edition composer is cutted when editing multiline message near the top of screen [$250] mWeb/Chrome - Chat - Edition composer is cutted when editing multiline message near the top of screen Nov 14, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021857151760601711832

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 14, 2024
Copy link

melvin-bot bot commented Nov 14, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia (External)

@melvin-bot melvin-bot bot removed the Overdue label Nov 14, 2024
@abekkala
Copy link
Contributor

confirmed the composer should not be partially hidden by the header

Copy link

melvin-bot bot commented Nov 18, 2024

@abekkala, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Nov 18, 2024
@abekkala
Copy link
Contributor

Waiting for proposal

Copy link

melvin-bot bot commented Nov 20, 2024

@abekkala @thesahindia this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Nov 20, 2024

@abekkala, @thesahindia Eep! 4 days overdue now. Issues have feelings too...

Copy link

melvin-bot bot commented Nov 21, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Copy link

melvin-bot bot commented Nov 22, 2024

@abekkala, @thesahindia Still overdue 6 days?! Let's take care of this!

@wildan-m
Copy link
Contributor

wildan-m commented Nov 25, 2024

Edited by proposal-police: This proposal was edited at 2024-11-28 16:03:30 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

The mWeb/Chrome Chat Edition composer is cut off when editing a multiline message near the top of the screen.

What is the root cause of that problem?

The scroll pushed by soft input keyboard and in some cases it will cut the editor.

What changes do you think we should make in order to solve the problem?

I think we need to scroll to the edited report action before we perform editing. This way we can ensure that the edited message is near the top of the soft input keyboard

In src/pages/home/report/ReportActionItem.tsx modify this use effect to add scrollToIndex

    useEffect(() => {
        if (prevDraftMessage !== undefined || draftMessage === undefined) {
            return;
        }

        InteractionManager.runAfterInteractions(() => {
            requestAnimationFrame(() => {
                reportScrollManager.scrollToIndex(index);
            });
        })

        focusComposerWithDelay(textInputRef.current)(true);
    }, [prevDraftMessage, draftMessage]);

Optional:
Limit to Browser.isMobileChrome or Browser.isMobile or canUseTouchScreen if we don't want this behavior on other platforms

  • We might need to disable animate for more responsive result

in useReportScrollManager make animated as param with default to true

    /**
     * Scroll to the provided index. On non-native implementations we do not want to scroll when we are scrolling because
     */
    const scrollToIndex = useCallback(
        (index: number, isEditing?: boolean, animated: boolean = true) => {
            if (!flatListRef?.current || isEditing) {
                return;
            }
    
            flatListRef.current.scrollToIndex({index, animated});
        },
        [flatListRef],
    );

And use false value in the use effect

    useEffect(() => {
        if (prevDraftMessage !== undefined || draftMessage === undefined) {
            return;
        }

        InteractionManager.runAfterInteractions(() => {
            requestAnimationFrame(() => {
                reportScrollManager.scrollToIndex(index, false, false);
            });
        })

        focusComposerWithDelay(textInputRef.current)(true);
    }, [prevDraftMessage, draftMessage]);

Branch for this solution

What alternative solutions did you explore? (Optional)

We can modify ReportActionItemMessageEdit to also scroll the reportActionItem for mWeb

src/pages/home/report/ReportActionItemMessageEdit.tsx

                            onFocus={() => {
                                setIsFocused(true);
                                if (textInputRef.current) {
                                    ReportActionComposeFocusManager.editComposerRef.current = textInputRef.current;
                                }
                               const shouldScrollOnEdit = canUseTouchScreen() ? isFocused && prevIsFocused === isFocused : true;
                                InteractionManager.runAfterInteractions(() => {
                                    requestAnimationFrame(() => {
                                        reportScrollManager.scrollToIndex(index, shouldScrollOnEdit );
                                    });
                                });

The shouldScrollOnEdit can be one of these:

Logic Behavior
canUseTouchScreen() ? isFocused && prevIsFocused === isFocused : true; it scroll when it first time receiving focus, it will not only work when pressing edit but also tapping to other opened ReportActionItemMessageEdit
!canUseTouchScreen() will be enabled for mweb

canUseTouchScreen can be altered with isSmallScreen / Browser.isMobile / Browser.isMobileChrome

@wildan-m
Copy link
Contributor

Proposal Updated

  • Add branch link

Copy link

melvin-bot bot commented Nov 26, 2024

@abekkala, @thesahindia 10 days overdue. Is anyone even seeing these? Hello?

@abekkala
Copy link
Contributor

@thesahindia can you take a look at the updated proposal from @wildan-m

@thesahindia
Copy link
Member

I couldn’t get to it today. I’ll review it first thing when I get to work.

@melvin-bot melvin-bot bot removed the Overdue label Nov 27, 2024
@thesahindia
Copy link
Member

@wildan-m, it doesn't look good.

Screen.Recording.2024-11-28.at.9.15.16.PM.mov

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

📣 @ZhenjaHorbach 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@ZhenjaHorbach
Copy link
Contributor

@abekkala
Could you please go back Help Wanted label ?😅

@abekkala abekkala added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 6, 2024
Copy link

melvin-bot bot commented Dec 7, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Dec 7, 2024
@ZhenjaHorbach
Copy link
Contributor

Not overdue
Waiting for proposals

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 9, 2024
Copy link

melvin-bot bot commented Dec 13, 2024

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

@abekkala
Copy link
Contributor

waiting for proposals

@melvin-bot melvin-bot bot removed the Overdue label Dec 13, 2024
Copy link

melvin-bot bot commented Dec 14, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Dec 16, 2024
@ZhenjaHorbach
Copy link
Contributor

Not overdue
Waiting for proposals

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 16, 2024
@ZhenjaHorbach
Copy link
Contributor

Not overdue
Still waiting for proposals

@melvin-bot melvin-bot bot removed the Overdue label Dec 20, 2024
Copy link

melvin-bot bot commented Dec 21, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Dec 23, 2024
Copy link

melvin-bot bot commented Dec 23, 2024

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Dec 23, 2024

Not overdue
Waiting for proposals

@abekkala
Maybe we should adjust the bounty to motivate more people ? 😃

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 23, 2024
Copy link

melvin-bot bot commented Dec 27, 2024

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

@ZhenjaHorbach
Copy link
Contributor

Not overdue

@melvin-bot melvin-bot bot removed the Overdue label Dec 27, 2024
@abekkala
Copy link
Contributor

I'll check with CS and SWM after the new year

Copy link

melvin-bot bot commented Dec 28, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
Status: Bugs and Follow Up Issues
Development

No branches or pull requests

5 participants