Repository navigation
Keep the log drawn when hide paths changes with Inspect open - #183
Merged
Merged
Conversation
…t draws it after hide paths changes Signed-off-by: Aaron Cupp <mrcupp@mrcupp.com>
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.
With Inspect's strings open and the column scrolled down to the log, turning "Hide file paths in this window" on or off could leave the whole log box undrawn — border, background, text. The lines were there and already masked: one scroll inside the box and they painted.
What it takes
Both at once: every line in the log rewritten (masking does that) and the log moved by the Strings table collapsing or expanding above it. Each on its own drew fine:
It's the app's WebKit. The Chromium preview never did it.
The fix
The log follows its newest line in a
useLayoutEffectnow, not auseEffect, so the scroll is set before the browser paints and lands in the same frame as the change. That's the right hook for measuring and scrolling the DOM anyway.Not verified. I couldn't make the blank box happen anywhere I could drive end to end: not in the fake-engine build without this fix either, long paths and all. It only showed in a real build with the made-up dump opened through the file panel. So this is the likely fix, not a proven one.
To check it: open a dump in a build of this branch, Inspect it, scroll down to the log, and turn hide paths on and off a couple of times. If the box still goes blank, this PR is wrong and the next thing to try is CSS on
.log-lines.Frontend checks pass (664 tests, tsc, eslint). No test covers the paint itself: jsdom doesn't lay anything out.