Netmonitor blocking - Keep Block resource when URL contains box in focus all the time when reaching bottom side of section
Categories
(DevTools :: Netmonitor, enhancement, P3)
Tracking
(firefox70 unaffected, firefox71 wontfix, firefox75 verified)
Tracking | Status | |
---|---|---|
firefox70 | --- | unaffected |
firefox71 | --- | wontfix |
firefox75 | --- | verified |
People
(Reporter: cfogel, Assigned: fvsch)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug)
Attachments
(2 files)
Affected versions
- 71.0a1 (2019-10-21)
Affected platforms
- all
Steps to reproduce
- Launch Firefox, access any webpage, open Netmonitor - blocking tab;
- Block any request;
- Repeat the previous step until the input box reaches the bottom of the area;
- Block 1more request;
Actual result
- the input area for "Block resource when URL contains" is pushed down, out of view when more requests are added or the section is resized;
Enhancement suggestion
- the input area for "Block resource when URL contains" should become clamped to bottom and always remain visible;
Additional notes
- reviewing 1585621, 1589961 as linked to the suggestion would seem beneficial as it would be displayed, but that would mean that there would be -1 blocking pattern displayed in the list;
Comment 2•5 years ago
|
||
Some information for anyone interested in fixing this bug:
-
The input box is rendered here:
https://searchfox.org/mozilla-central/rev/11d9c7b7fa82fdfb8ac2a8f0864e9d8d5fe2b926/devtools/client/netmonitor/src/components/request-blocking/RequestBlockingPanel.js#194 -
Related CSS is here:
https://searchfox.org/mozilla-central/rev/11d9c7b7fa82fdfb8ac2a8f0864e9d8d5fe2b926/devtools/client/netmonitor/src/assets/styles/RequestBlockingPanel.css#147,152,156
Honza
Comment 3•5 years ago
|
||
@Nicolas, I know the Console panel is doing the same with the command line input box.
Can you please provide some info how it's done and/or point to the code base where it's done, thanks!
Honza
Assignee | ||
Comment 4•5 years ago
|
||
If we make the input sticky, we're going to run into this use case:
- There are more items in the list than available space, the list is scrolled to the top and the text input is fixed at the bottom.
- User types a new pattern in the text input and hits Enter.
The new pattern would be added at the end of the list, out of view, providing no visual feedback to the user. Users may think that it's not working, try a few times, etc.
A workaround would need to automatically scroll to the bottom when adding a new pattern from the text input.
Assignee | ||
Comment 5•5 years ago
|
||
Another possibility is to reverse the list (latest pattern first), and to make the text input fixed at the top. But I don't think we're using that style anywhere.
Comment 6•5 years ago
|
||
We can try to use overflow-anchor
, but it needs to be "activated" by scrolling at least once.
Could we have the input always at the very bottom of the list (not using sticky) ?
┌──────────────────────────────────┐
│ Search Blocking │
├──────────────────────────────────┤
│ ✔️ Enable Request Blocking + │
├──────────────────────────────────┤
│ blah │
├──────────────────────────────────┤
│ bleh │
├──────────────────────────────────┤
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
├──────────────────────────────────┤
│ Block resource when URL contains │
└──────────────────────────────────┘
or at the very top?
┌──────────────────────────────────┐
│ Search Blocking │
├──────────────────────────────────┤
│ ✔️ Enable Request Blocking + │
├──────────────────────────────────┤
│ Block resource when URL contains │
├──────────────────────────────────┤
│ blah │
├──────────────────────────────────┤
│ bleh │
├──────────────────────────────────┤
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
└──────────────────────────────────┘
IMO this would be much easier that trying to have pin to bottom feature.
Comment 7•5 years ago
|
||
(In reply to Florens Verschelde :fvsch from comment #4)
A workaround would need to automatically scroll to the bottom when adding a new pattern from the text input.
I like this and it would be consistent with how the Console panel works.
Honza
Assignee | ||
Comment 8•5 years ago
|
||
Could we have the input always at the very bottom of the list (not using sticky) ?
Personally I'm against it because it's easy to just not see the input when it appears 200-400px away from the blocking panel's content.
Assignee | ||
Comment 9•5 years ago
|
||
I think I have a pure CSS solution using Flexbox.
We don't use it in the Console because the jsterm has a dynamic height, but here the text input has a fixed height so we can use that.
/* RequestBlockingPanel.css | chrome://devtools/content/netmonitor/src/assets/styles/RequestBlockingPanel.css */
.request-blocking-contents {
/* overflow-y: auto; */
overflow: hidden;
display: flex;
flex-direction: column;
}
.network-monitor .request-blocking-list {
max-height: calc(100% - 25px);
overflow-y: auto;
}
We may need to test it more, but it seemed to work well in my quick test.
This also lets us hide the bottom border when the input touches the bottom edge, which is a nice pixel-perfect tweak. :D
Assignee | ||
Comment 10•5 years ago
|
||
Tentatively taking this. Will unassign myself is the CSS solution doesn't pan out.
Assignee | ||
Comment 11•5 years ago
|
||
Assignee | ||
Comment 12•5 years ago
|
||
So this is working nicely with just CSS, yay \o/
My patch doesn't address this:
automatically scroll to the bottom when adding a new pattern from the text input
That seems doable with document.querySelector('.request-blocking-contents li:last-child').scrollIntoView()
but we can't do it when submitting the form because we need the component to receive new props and finish rendering first, and I'm not sure how to do that.
We could delay the scrolling for a little while, e.g. 100ms, but that could be error prone?
Unless we have a good solution in mind, I'd split that autoscrolling question to a follow-up bug and not block the layout improvement on that.
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 13•5 years ago
|
||
We could delay the scrolling for a little while, e.g. 100ms, but that could be error prone?
Tried with a 40ms delay and it seems to work fine. See the patch.
Comment 14•5 years ago
|
||
(In reply to Florens Verschelde :fvsch from comment #12)
My patch doesn't address this:
automatically scroll to the bottom when adding a new pattern from the text input
That seems doable with
document.querySelector('.request-blocking-contents li:last-child').scrollIntoView()
but we can't do it when submitting the form because we need the component to receive new props and finish rendering first, and I'm not sure how to do that.We could delay the scrolling for a little while, e.g. 100ms, but that could be error prone?
Unless we have a good solution in mind, I'd split that autoscrolling question to a follow-up bug and not block the layout improvement on that.
David, do you have any tips about how to solve this?
Honza
Assignee | ||
Comment 15•5 years ago
|
||
I ended up finding a solution, see scrollToBottom
here:
https://phabricator.services.mozilla.com/D51135#change-zFpEJ8FYrXss
Updated•5 years ago
|
Updated•5 years ago
|
Comment 16•5 years ago
|
||
Comment 17•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Reporter | ||
Comment 18•5 years ago
|
||
Verified with 75.0a1 (2020-02-24) on Windows 10, macOS 10.15, Ubuntu 19.04.
Awesome work with making this happen!
Description
•