Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Column breakpoints UI #7095

Merged
merged 8 commits into from
Oct 25, 2018
Merged

Conversation

audreyfang
Copy link
Contributor

Summary of Changes

Very rough start to the column breakpoint changes @darkwing and I discussed earlier. When alt/option is pressed column breakpoints are shown only for the function where the cursor is currently located.

This is still quite buggy but works in some cases and I will also be further looking into changing the >> to actual icons.

Screenshots/Videos

column-breakpoint

Copy link
Contributor

@AnshulMalik AnshulMalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking Awesome :)

let sites;
if (!callSites) {
return null;
}

const { line } = editor.codeMirror.getCursor();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think getCursor gives us the position of the blinking cursor, and not mouse position, I am not sure though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does give the position of the blinking cursor, which was my intention for this first iteration. Do you happen to know of any way to get the mouse hover position?

Copy link
Contributor

@AnshulMalik AnshulMalik Oct 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did read the docs but couldn't find the mouse position, I think we need to come up with our own way to capture mouse position.
Or may be I missed something, you should check their docs as well :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's table the mouse position experiment for now. Let's just focus on clicking the icon adding the column breakpoint, and then having different states like enabled, disabled, off, as well as dark mode 💯

@darkwing
Copy link
Contributor

darkwing commented Oct 9, 2018

Interesting that you've gone the CSS route instead of adding an element as a marker -- I look forward to seeing where this goes. The important test for it is ensuring that clicking in that area of the marker does in fact activate/deactivate the column breakpoint -- CSS can be weird like that sometimes.

width: 100%;
height: calc(100% - 2px);
border-bottom: 2px solid #aed3ef;
}

.call-site-bp {
position: relative;
border-bottom: 2px solid red;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this is for debugger?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not completely sure I understand the question, but the red border is the current way of indicating that a breakpoint is selected. I added it here so that both the icon and text continue to be underlined.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, I see. We probably want to find a different color, but that's a simple change so don't hang up on it.

@@ -25,8 +26,7 @@
}

.call-site-bp::before {
content: "";
position: absolute;
content: ">>";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use the same breakpoint svg image as the sidebar.

location.start.line <= closestFunc.location.end.line
);
} else {
callSitesFiltered = callSites;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the else; just initialize callSitesFiltered to callSites:

let callSitesFiltered = callSites;
if ( ....

@darkwing
Copy link
Contributor

Wow, this is awesome! 👍 A few ideas:

  1. Let's add cursor: pointer when the user hovers over a column breakpoint in the editor; the pointer tells the user that a click is actionable.

  2. I'm noticing that clicking on a function that was already clicked doesn't remove the the breakpoint; you probably know that but just an FYI that we need that changed.

@darkwing
Copy link
Contributor

I pushed a tiny commit to your branch @audreyfang ; please git pull so you have it :)

@darkwing
Copy link
Contributor

Update as to what's left here @audreyfang ?

@audreyfang
Copy link
Contributor Author

@darkwing I need to make a few minor fixes to the ui colours, look at your suggestions from last week and the failing tests. I should have another commit up later tonight.

@audreyfang
Copy link
Contributor Author

@darkwing Do you have a specific example for when clicking on a breakpoint doesn't remove it? It works for me in most cases, although I do seem to have some issues with one particular function in the file I'm using.

@@ -20574,7 +20574,8 @@
"../../parse5/lib/serializer/serializer_stream.js": 1752,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't belong in this PR, we'll remove it before merging.

@@ -50,7 +50,7 @@ pref("devtools.debugger.skip-pausing", false);
pref("devtools.debugger.features.wasm", true);
pref("devtools.debugger.features.shortcuts", true);
pref("devtools.debugger.features.root", true);
pref("devtools.debugger.features.column-breakpoints", false);
pref("devtools.debugger.features.column-breakpoints", true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, as things stand, we'll want to change this back to false before merging. I just pressed option in a minified file and my browser hung, so we'll need to measure performance implications here. Keep it true for now, if only for the sake of everyone testing and tests running.

@darkwing
Copy link
Contributor

OMG I love how this looks so far. Awesome awesome awesome!

I'm seeing a really weird issue and I'm wondering if @loganfsmyth or @AnshulMalik could help. I prettified the following URL during testing:

https://davidwalsh.name/wp-content/themes/punky/js/main.js

I press option and see a bunch of lovely column breakpoint locations (yay!). When I click one, however, the following issues occur:

  1. A breakpoint is added at the next line
  2. The column's arrow very briefly stays dark (yay!) but then goes back to inactive state (the root cause is probably the same as 1)
  3. I can't add multiple column breakpoints for the same line; instead the existing breakpoint's location is changed.

@loganfsmyth Can you look into the breakpoint location issue? It's acting a bit odd.

@audreyfang In the mean time, could you explore adding mochitest for this functionality? i.e. clicking a column breakpoint on and off does what's expected? I expect you'll probably have questions here which we can discuss in Slack or 1:1 video.

Great work so far!

@AnshulMalik
Copy link
Contributor

It's the issue with source-map, either the source map generated from prettifying is not right(I think this is the case). Or source-map package is producing wrong results for generatedLocation.

@darkwing
Copy link
Contributor

@audreyfang I think that this is far enough along that we can merge and iterate on; i.e. the styling is awesome. Are there any blockers to merging this UI change?

@audreyfang
Copy link
Contributor Author

@darkwing Will the column breakpoints remain enabled by default? If so, I need to update the jest tests to reflect that. If not, then this should be fine to merge.

@darkwing darkwing changed the title WIP: Column breakpoints Column breakpoints UI Oct 24, 2018
@darkwing
Copy link
Contributor

@audreyfang I think you'll only need to change the pref in assets/panel/prefs.js; I think the other prefs file only controls the development environment (launchpad) preference value. Also, please reset the assets/module-manifest.json file. I think we can merge after that 👍

@darkwing darkwing merged commit 363f48c into firefox-devtools:master Oct 25, 2018
darkwing pushed a commit that referenced this pull request Oct 26, 2018
darkwing pushed a commit that referenced this pull request Oct 26, 2018
darkwing pushed a commit to darkwing/debugger.html that referenced this pull request Oct 26, 2018
darkwing pushed a commit that referenced this pull request Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants