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

Get external link and scroll to element #3506

Merged
merged 34 commits into from
Oct 22, 2024
Merged

Conversation

5e-Cleric
Copy link
Member

@5e-Cleric 5e-Cleric commented May 31, 2024

This does work, not sure it is perfect.

Instead of having to catch the exact time of load finish of the pages, the function waits 100ms before scrolling.
for this instance, i think this is appropiate, and easier to deal with.

Tested this with 90+ page doc, works fine. Unsetting smooth scroll as it triggers lots of page loads.

Closes #2820 and duplicate #3505

to test, try any brew url + #id

@5e-Cleric 5e-Cleric added feature UI/UX User Interface, user experience ❌ Missing from V3 Was planned for V3 but still missing 🔍 R0 - Needs first review 👀 PR ready but has not been reviewed labels May 31, 2024
@5e-Cleric 5e-Cleric self-assigned this May 31, 2024
@5e-Cleric 5e-Cleric linked an issue May 31, 2024 that may be closed by this pull request
…existence checks, and update scrollIntoView behavior"
@5e-Cleric 5e-Cleric temporarily deployed to homebrewery-pr-3506 May 31, 2024 14:47 Inactive
…ed useEffect hooks, and simplified getPageContainingElement function."
@5e-Cleric
Copy link
Member Author

5e-Cleric commented May 31, 2024

Now also works with page ids

Could use a deployment.

@5e-Cleric 5e-Cleric temporarily deployed to homebrewery-pr-3506 May 31, 2024 15:00 Inactive
@5e-Cleric 5e-Cleric temporarily deployed to homebrewery-pr-3506 May 31, 2024 15:07 Inactive
@5e-Cleric 5e-Cleric mentioned this pull request May 31, 2024
…ent functions, instead getting iframe element by id 'BrewRenderer' inside the functions."
@5e-Cleric 5e-Cleric temporarily deployed to homebrewery-pr-3506 May 31, 2024 15:13 Inactive
@5e-Cleric 5e-Cleric temporarily deployed to homebrewery-pr-3506 May 31, 2024 18:22 Inactive
@dbolack-ab
Copy link
Collaborator

How should this be tested?

@5e-Cleric
Copy link
Member Author

How should this be tested?

Go ahead and open any brew and append the bookmark: https://homebrewery-pr-3506.herokuapp.com/share/a6RCXwaDS58i#p4

You should be able to do it with any brew, with any element or page with id, as they are previously generated.
The function uses its own scrolling methods to go to the page of the element.

@5e-Cleric 5e-Cleric temporarily deployed to homebrewery-pr-3506 June 12, 2024 16:08 Inactive
@5e-Cleric 5e-Cleric temporarily deployed to homebrewery-pr-3506 July 22, 2024 20:44 Inactive
@5e-Cleric
Copy link
Member Author

I'm guessing you will have a lot to say about the scrolling methods, cannot remember why i did it this way.

@5e-Cleric 5e-Cleric added 🔍 R4 - Reviewed - Fixed! Awaiting final review⭐ PR review comments addressed and removed 🔍 R3 - Reviewed - Awaiting Fixes 🔧 PR is okayed but needs fixes before merging labels Oct 17, 2024
@5e-Cleric
Copy link
Member Author

This should be ready for merge

Copy link
Collaborator

@dbolack-ab dbolack-ab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I select an out of bounds page, this sends me to Vault instead of the Brew.

I think this should instead go to the first or last page and provide an error message.

Copy link
Collaborator

@dbolack-ab dbolack-ab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously reported error was in the testing, not the results.

`frameDidMount` is equivalent to using iframe.addEventListener('load');

Let's not add a new listener and just use the existing event we already have. Functionality still works.
@calculuschild calculuschild removed the ❌ Missing from V3 Was planned for V3 but still missing label Oct 22, 2024
@calculuschild
Copy link
Member

Ok, just cleaned up a bit. Merging now!

Thanks @5e-Cleric ! 💯 ⭐ 🎉

@calculuschild calculuschild temporarily deployed to homebrewery-pr-3506 October 22, 2024 18:10 Inactive
@calculuschild calculuschild merged commit ef5e3dd into master Oct 22, 2024
1 check was pending
@calculuschild calculuschild deleted the scroll-to-element branch October 22, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Provide a Linkable URL to ID Heading External Direct link
5 participants