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

Remove column breakpoint#3120

Merged
jasonLaster merged 2 commits into
firefox-devtools:masterfrom
anbarasiu:remove-column-breakpoint
Jun 8, 2017
Merged

Remove column breakpoint#3120
jasonLaster merged 2 commits into
firefox-devtools:masterfrom
anbarasiu:remove-column-breakpoint

Conversation

@anbarasiu

Copy link
Copy Markdown
Contributor

Associated Issue: #3042

Summary of Changes

  • Removing the column breakpoints

Test Plan

  • Set a bp on an empty line/comment that slides to the next line.
  • Clicking on the bp on the gutter removes it

@jasonLaster

Copy link
Copy Markdown
Contributor

Here's another URL for testing:

http://localhost:8000/integration/examples/doc-sourcemaps2.html

@jasonLaster jasonLaster force-pushed the remove-column-breakpoint branch from b6196ec to e821a7a Compare June 7, 2017 21:56
@codecov

codecov Bot commented Jun 7, 2017

Copy link
Copy Markdown

Codecov Report

Merging #3120 into master will decrease coverage by 0.07%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3120      +/-   ##
==========================================
- Coverage   47.51%   47.44%   -0.08%     
==========================================
  Files          95       95              
  Lines        4003     4009       +6     
  Branches      821      823       +2     
==========================================
  Hits         1902     1902              
- Misses       2101     2107       +6
Impacted Files Coverage Δ
src/utils/frame.js 85.57% <ø> (ø) ⬆️
src/components/Editor/index.js 20.27% <0%> (-0.06%) ⬇️
src/utils/editor/index.js 12.76% <0%> (-1.52%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 439ab3f...9193907. Read the comment docs.

@jasonLaster

Copy link
Copy Markdown
Contributor

Hey @anbarasiu! thanks so much for the help, this PR actually scared me for much of the day because sliding and bps are hard!

I made some small tweaks because i found the ternary boolean hard to read. I tried to expand it out a bit for my future self and others.

I genuinely cannot wait for column breakpoints to land. They'll be so great!

@jasonLaster jasonLaster force-pushed the remove-column-breakpoint branch 2 times, most recently from fbc73b5 to f9880d0 Compare June 7, 2017 22:41
@anbarasiu

anbarasiu commented Jun 8, 2017

Copy link
Copy Markdown
Contributor Author

Thanks for your help :) Looked at the changes and I'll keep the readability in mind for the next PR.

I've made a small change, so that clicked bp is returned.

if (!isEnabled("columnBreakpoints") || !column) {
return true;
}

remove-column-breakpoint

Was wondering if it would be better to remove the bp, not just when clicking on the gutter, but also the bp itself, when column > 0, like in the gif.


if (bp) {
// NOTE: it's possible the breakpoint has slid to a column
column = column || bp.location.column;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am wondering which one should take precedence here. If both column and bp.location.column are defined, which one would be more important? From the comment it sounds like bp.location.column -- because it should be overwriting to account for sliding? But I'm not too sure, sliding bps are hard!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm.. I think column should take precedence, so that only when column info's not available we pick it up from bp. When initiated on the gutter, the column is undefined(from what I observed). Perhaps, when we directly click on the bp it could be passed(from codemirror?)?
Please correct me if I'm wrong here :)

@codehag codehag Jun 8, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah ok i see what is going on here. I think the comment should be more specific, maybe something like:

// falling back on the bp.location.column allows toggling the breakpoint a from the gutter, even if it is a column breakpoint

thats... probably a bit verbose. might be a better way to word what is going on here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ugh, this is an evil case. if we're clicking on a column breakpoint then we want to remove the breakpoint on that column. but we can cross that bridge when we get there

Comment thread src/utils/editor/index.js Outdated

// NOTE: when column breakpoints are disabled we want to find
// the first breakpoint
if (!isEnabled("columnBreakpoints") || !column) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

@jasonLaster jasonLaster force-pushed the remove-column-breakpoint branch from efb97e0 to 9193907 Compare June 8, 2017 13:40
@jasonLaster jasonLaster merged commit aaca1d3 into firefox-devtools:master Jun 8, 2017
@anbarasiu anbarasiu deleted the remove-column-breakpoint branch June 8, 2017 14:02
@anbarasiu anbarasiu restored the remove-column-breakpoint branch June 12, 2017 05:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants