Closed Bug 1695896 Opened 2 years ago Closed 5 months ago

Add log and Edit log on breakpoint in sidebar should scroll line into view

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(firefox102 fixed)

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: Honza, Assigned: luke.swiderski, Mentored)

References

(Blocks 2 open bugs)

Details

(Keywords: good-first-bug, Whiteboard: dt-outreachy-2021)

Attachments

(2 files)

This has been originally reported here: https://github.com/firefox-devtools/debugger/issues/8198

STR:

  1. Load http://janodvarko.cz/firebug/tests/601/Issue601.htm
  2. Open DevTools and select the Debugger panel
  3. Open file Issue601.htm and create regular BP on line 64
  4. Scroll the source so the BP is not visible
  5. In the Breakpoints side panel right click on the BP and pick "Add Log" (or "Edit Log")

AR: the BP and log editor are not visible
ER: the source scrolls so the BP and log editor are visible.

Honza

A patch attached to the original issue. It seems to be working, but might need to be revisit.

diff --git a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js b/devtools/client/debu--- a/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js
+++ b/devtools/client/debugger/src/components/SecondaryPanes/Breakpoints/BreakpointsContextMenu.js
@@ -233,26 +233,32 @@ export default function showContextMenu(
     ),
   };

   const addLogPointItem = {
     id: "node-menu-add-log-point",
     label: L10N.getStr("editor.addLogPoint"),
     accesskey: L10N.getStr("editor.addLogPoint.accesskey"),
     disabled: false,
-    click: () => openConditionalPanel(selectedLocation, true),
+    click: () => {
+      selectSpecificLocation(cx, selectedLocation);
+      openConditionalPanel(selectedLocation, true);
+    },
     accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
   };

   const editLogPointItem = {
     id: "node-menu-edit-log-point",
     label: L10N.getStr("editor.editLogPoint"),
     accesskey: L10N.getStr("editor.editLogPoint.accesskey"),
     disabled: false,
-    click: () => openConditionalPanel(selectedLocation, true),
+    click: () => {
+      selectSpecificLocation(cx, selectedLocation);
+      openConditionalPanel(selectedLocation, true);
+    },
     accelerator: formatKeyShortcut(L10N.getStr("toggleCondPanel.logPoint.key")),
   };

   const removeLogPointItem = {
     id: "node-menu-remove-log",
     label: L10N.getStr("editor.removeLogPoint.label"),
     accesskey: L10N.getStr("editor.removeLogPoint.accesskey"),
     disabled: false,

This might be a good first or mentored bug

Mentor: hmanilla
Keywords: good-first-bug

Hi, I'd like to work on this. Can it be assigned to me?

Assigned to you, thank you for helping.

Honza

Assignee: nobody → surya.bdev
Status: NEW → ASSIGNED

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: surya.bdev → nobody
Status: ASSIGNED → NEW

Hi there, I'd like to work on this bug. Can it be assigned to me?

Flags: needinfo?(hmanilla)

Hi Leslie,
Sure I've assigned it to you.

Feel free to ask any questions.

Assignee: nobody → lesore0789
Flags: needinfo?(hmanilla)
Whiteboard: dt-outreachy-2021

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit auto_nag documentation.

Assignee: lesore0789 → nobody

The patch looks good, just an automated test (mochitest) is missing
Still feels like a good first bug

This patch scrolls the editor to the log input when adding or editing a log
from the breakpoint context menu.

Assignee: nobody → luke.swiderski
Status: NEW → ASSIGNED
Pushed by hmanilla@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a57484614314
Add/edit log on breakpoint in sidebar scroll line into view. r=bomsy
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.