-
Notifications
You must be signed in to change notification settings - Fork 761
Column breakpoints UI #7095
Column breakpoints UI #7095
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking Awesome :)
src/components/Editor/CallSites.js
Outdated
let sites; | ||
if (!callSites) { | ||
return null; | ||
} | ||
|
||
const { line } = editor.codeMirror.getCursor(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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 💯
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. |
src/components/Editor/CallSite.css
Outdated
width: 100%; | ||
height: calc(100% - 2px); | ||
border-bottom: 2px solid #aed3ef; | ||
} | ||
|
||
.call-site-bp { | ||
position: relative; | ||
border-bottom: 2px solid red; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
src/components/Editor/CallSite.css
Outdated
@@ -25,8 +26,7 @@ | |||
} | |||
|
|||
.call-site-bp::before { | |||
content: ""; | |||
position: absolute; | |||
content: ">>"; |
There was a problem hiding this comment.
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.
src/components/Editor/CallSites.js
Outdated
location.start.line <= closestFunc.location.end.line | ||
); | ||
} else { | ||
callSitesFiltered = callSites; |
There was a problem hiding this comment.
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 ( ....
Wow, this is awesome! 👍 A few ideas:
|
I pushed a tiny commit to your branch @audreyfang ; please |
Update as to what's left here @audreyfang ? |
@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. |
@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. |
assets/module-manifest.json
Outdated
@@ -20574,7 +20574,8 @@ | |||
"../../parse5/lib/serializer/serializer_stream.js": 1752, |
There was a problem hiding this comment.
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.
assets/panel/prefs.js
Outdated
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
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.
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:
@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! |
It's the issue with source-map, either the source map generated from prettifying is not right(I think this is the case). Or |
@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? |
@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. |
@audreyfang I think you'll only need to change the pref in |
a731493
to
3c7489f
Compare
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