Closed Bug 1779972 Opened 4 years ago Closed 4 years ago

Edit and resend panel has many scrollbars when viewport is narrow

Categories

(DevTools :: Netmonitor, enhancement)

enhancement

Tracking

(firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 3 external files)

Small UX issue, resizing the panel creates too many scrollbars

Attached image image.png —

I quickly looked into this last week but couldn't find a fix.
The scrollable elements are <textarea>s that we automatically grow with a CSS trick: the ::after pseudo-element renders the same text as the textarea (see https://searchfox.org/mozilla-central/rev/3cb31675aeffd10f1f6ae7c40e24b254da7798e5/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css#26-54)

But it looks like the text in the pseudo element doesn't break at the same position as the text in the textarea (see attached screenshot)

I tried to make both the textarea and the pseudo element to share the exact same dimension (e.g. margins are not the same at the moment), and have the exact same break-* values, without success so far

Each line of the edit and resend panel should no longer grow when resizing the panel
But when editing, we fallback to multiline

In the end I had something working decently (I think)

# HG changeset patch
# User Nicolas Chevobbe <nchevobbe@mozilla.com>
# Date 1658137719 -7200
#      Mon Jul 18 11:48:39 2022 +0200
# Node ID 0439a40a1d90017a0ca7cf22b328f320dcd367e5
# Parent  a3abb49ac2b19777b4e2ec8ff4411fa32213ecfe
Bug 1779972 - [devtools] Fix scrollbar issue

diff --git a/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css b/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css
--- a/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css
+++ b/devtools/client/netmonitor/src/assets/styles/HTTPCustomRequestPanel.css
@@ -26,13 +26,15 @@
 .auto-growing-textarea {
   display: grid;
   width: 100%;
+  /* Adding this to have maximo 5 lines */
+  max-height: 70px;
+  overflow-x: hidden;
+  overflow-y: auto;
 }
 
 .auto-growing-textarea::after {
   content: attr(data-replicated-value) " ";
-  white-space: pre-wrap;
   visibility: hidden;
-  word-wrap: break-word;
 }
 
 .auto-growing-textarea > textarea {
@@ -48,11 +50,14 @@
   min-width: 9ch;
   padding: 4px;
   padding-inline-start: 7px;
-  /* Adding this to have maximo 5 lines */
-  max-height: 70px;
-  overflow-y: auto;
+  margin: 0;
+  box-sizing: border-box;
+  line-height: 13px;
+  white-space: pre-wrap;
+  word-wrap: break-word;
 }

but I'm fine with Julian's approach

Depends on D152006

Forcing name and values to one line, we should add a tooltip to show the whole content

Depends on D152008

Spotted a few HTML ids which were used in loops or shared components, and ended up duplicated

Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8e28cece988b [devtools] Force edit and resend panel lines on a single line when not editing r=bomsy,nchevobbe https://hg.mozilla.org/integration/autoland/rev/fd01fd54b861 [devtools] Add a tooltip for Edit and Resend names and values r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/39969dab34cb [devtools] Remove duplicated and unused ids in the Edit and Resend panel r=nchevobbe
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Regressions: 1782077
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: