fix(ui): Scroll the bench log dialog after the body mounts (backport #7259) - #7260
Closed
mergify[bot] wants to merge 2 commits into
Closed
mergify[bot] wants to merge 2 commits into
mergify[bot] wants to merge 2 commits into
Conversation
Click-testing the deep link (/dashboard/benches/<bench>/logs/web.error.log) showed the log opening at the top, not the bottom. onSuccess runs before frappe-ui sets loading back to false, and on this path the response can beat the dialog body into the DOM, so the ref is still null. A post-flush watcher on both the element and the data fires whichever lands last. Added an e2e test that asserts the redirect, the open dialog and scrollTop at the end. (cherry picked from commit 48d5c20) # Conflicts: # dashboard/src/components/group/BenchLogsDialog.vue
The test used a bench and a group from my local database, so it failed on CI, where the site has only a press admin team. The redirect still happened, but the sites page had no group to show and the dialog never rendered. The test now mocks the Release Group document and the Bench, New Bench Queue and Site lists, like the other dashboard tests do. This also reproduced the CI failure locally. (cherry picked from commit cede0a6)
Contributor
Author
|
Cherry-pick of 48d5c20 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
Contributor
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #7257. Click-testing the deep link in a browser showed that the log opens at the top, not at the bottom.
Problem
/dashboard/benches/<bench>/logs/web.error.logredirects correctly and the dialog opens on the correct log, butscrollTopstays 0 while 6953px of scroll is available.Two causes, both on the deep-link path:
onSuccessruns before frappe-ui setsloadingback to false (resources.js:121), so at that moment the body still showsLoading...and has almost no scroll height.setup, so the response can arrive before the dialog body is in the DOM. The template ref is then still null.Change
A post-flush watcher on both the element and the data. The scroll happens when the last of the two arrives, so the order does not matter.
Testing
New Playwright test
dashboard/tests-e2e/tests/dashboard/bench-log-deep-link.test.ts. It asserts the redirect, the open dialog, the log content, andscrollTopat the end. It fails ondevelopand passes with this change.Run:
Tested against a local bench with the dashboard dev server. The View Logs row action is not click-tested; it uses the same dialog.
🤖 Generated with Claude Code
This is an automatic backport of pull request #7259 done by Mergify.