Closed Bug 947143 Opened 11 years ago Closed 10 years ago

The debugger resumption order panel looks really bad

Categories

(DevTools :: Debugger, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 29

People

(Reporter: vporof, Assigned: alexey.novak.mail)

References

Details

Attachments

(2 files, 1 obsolete file)

We should use Tooltip.js instead.
It also used to wrap the text, but that got broken somehow.
Whiteboard: [good first bug][mentor=vporof@mozilla.com][lang=js]
I'd like to take this, can you guys point me in the right direction ?
Hi Tim! Let me know if you need help with building Firefox from source [0] and running browser chrome mochitests [1].

The source code for the debugger lives here: [2]. Basically, the current panel is implemented from scratch in XUL [3], and it's referenced and used in the "toolbar view", here: [4]. It's styled in our css theme files, for linux, windows and os x, for example: [5].

We have a robust implementation called Tooltip.js [6] that has the ability of showing simple text content (amongst other things). Using Tooltip.js instead of manually creating our own panel would fix this bug and keep the code easier to maintain in the future.

For this bug, you'd have to remove all references of the current panel from js, xul and css, and use Tooltip.js instead. Read the documentation on how to use that library [7] and use it in the debugger. It'd be nice if you also improved the `setTextContent` function [8] with the ability to show the warning icon.

Let me know if you need any help! Thank you.

[0] https://developer.mozilla.org/en-US/docs/Simple_Firefox_build
[1] https://developer.mozilla.org/en/docs/Browser_chrome_tests
[2] http://dxr.mozilla.org/mozilla-central/source/browser/devtools/debugger
[3] http://dxr.mozilla.org/mozilla-central/source/browser/devtools/debugger/debugger.xul#465
[4] http://dxr.mozilla.org/mozilla-central/source/browser/devtools/debugger/debugger-toolbar.js#16
[5] http://dxr.mozilla.org/mozilla-central/source/browser/themes/linux/devtools/debugger.css#437
[6] http://dxr.mozilla.org/mozilla-central/source/browser/devtools/shared/widgets/Tooltip.js
[7] http://dxr.mozilla.org/mozilla-central/source/browser/devtools/shared/widgets/Tooltip.js#119
[8] http://dxr.mozilla.org/mozilla-central/source/browser/devtools/shared/widgets/Tooltip.js#405
Assignee: nobody → ntim007
Status: NEW → ASSIGNED
How do I make the panel appear actually (in the UI, not the code) ?
(In reply to Tim Nguyen [:ntim] from comment #4)
> How do I make the panel appear actually (in the UI, not the code) ?

As a web developer I actually have no idea how to use the debugger, that's why I'm asking you that actually. I use all developer tools except that one :p
Flags: needinfo?(vporof)
1. Open http://htmlpad.org/resumption1 in a tab and start the debugger
2. Click the "First button"
3. Open http://htmlpad.org/resumption2 in a second tab and start another debugger there
4. Click the "Second button"
5. Go back to the first tab and resume execution (press the |> button in the debugger's toolbar)
Flags: needinfo?(vporof)
Hey Tim, any progress here? Anything we can do to help?
(In reply to Rob Campbell [:rc] (:robcee) from comment #8)
> Hey Tim, any progress here? Anything we can do to help?

Sorry, I've been so busy with homework lately (even during the holidays). I tried some stuff, but I can't seem to compile the Firefox build properly. It just doesn't update the code I changed.
(In reply to Tim Nguyen [:ntim] from comment #9)
> (In reply to Rob Campbell [:rc] (:robcee) from comment #8)
> > Hey Tim, any progress here? Anything we can do to help?
> 
> Sorry, I've been so busy with homework lately (even during the holidays). I
> tried some stuff, but I can't seem to compile the Firefox build properly. It
> just doesn't update the code I changed.

What are you running to do an incremental build? The following should update your build with any devtools changes:

  ./mach build toolkit/devtools browser
Hi there,

Just wondering how far is Tim working on this bug. Do not want to be rude, but if Tim is still trying to figure out the build process I would love to take care of this issue since it does look like a good first bug. After poking in the code I already have a patch for it.
You guys could race each other :)

Tim, let us know how you're doing with creating a patch for this bug. Did you manage to build Firefox?
Flags: needinfo?(ntim007)
I haven't done a patch yet so, if Alexey wants to take this, I'm ok with it. I don't seem to have any problem building firefox now.
Flags: needinfo?(ntim007)
Attached patch 947143.1.patch (obsolete) — Splinter Review
Thanks Tim. If you are OK with it I would love to give it a shot.

Few notes about it:
- I used fx-team instead of mozilla-central to create my patch, assuming that this work is related to DevTools. If I need to do same changes in mozilla-central then I can do that.
- By default ToolTip attaches itself to the top left corner of the play button which would always make it go out of the FF window boundaries. I decided to shift it right 20px so it appears within the window.
- I have a question about ToolTip styling. I did not do any modifications to it... yet. So it is showed half-transparent. If I need to make any style modifications to it what would they be, any suggestions? Do we want to make it look exactly as resumption-order-panel or maybe we want to keep it as it is?
- I did not do any modifications for `setTextContent` yet. Before start coding on it I wanted to check if you have any specific suggestions on how I supposed to modify the function. I was thinking to add an extra argument isAlert which is defaulted to false. In case when it is passed as `true` tooltip will insert an alert icon into its content body.

Thanks.
Attachment #8357135 - Flags: review+
Attachment #8357135 - Flags: feedback+
Attachment #8357135 - Flags: review?(vporof)
Attachment #8357135 - Flags: review+
Attachment #8357135 - Flags: feedback+
Comment on attachment 8357135 [details] [diff] [review]
947143.1.patch

Review of attachment 8357135 [details] [diff] [review]:
-----------------------------------------------------------------

This looks really good! Thank you! Just a nit below, and please rebase on fx-team tip (bug 943883 landed, which unifies all the debugger.css files into debugger.inc.css). Once you attach the updated patch I'll land it.

::: browser/devtools/debugger/debugger-view.js
@@ +29,5 @@
>  const EDITOR_VARIABLE_HOVER_DELAY = 350; // ms
>  const EDITOR_VARIABLE_POPUP_OFFSET_X = 5; // px
>  const EDITOR_VARIABLE_POPUP_OFFSET_Y = 0; // px
>  const EDITOR_VARIABLE_POPUP_POSITION = "before_start";
> +const TOOLBAR_ORDER_POPUP_OFFSET_X = 20; // px

Instead of an offset, try using "topcenter bottomleft" popup positioning.

You'll have to declare a const here, TOOLBAR_ORDER_POPUP_POSITION = "..." and set it as the value for the defaultPosition property on the tooltip instance.

::: browser/themes/linux/devtools/debugger.css
@@ +509,5 @@
>    min-height: 25px !important;
>    padding: 0 !important;
>  }
>  
>  #resumption-panel-desc {

Do we still need this selector?
Attachment #8357135 - Flags: review?(vporof) → review+
(In reply to Alexey Novak from comment #15)

> - I have a question about ToolTip styling. I did not do any modifications to
> it... yet. So it is showed half-transparent. If I need to make any style
> modifications to it what would they be, any suggestions? Do we want to make
> it look exactly as resumption-order-panel or maybe we want to keep it as it
> is?

That's the default styling. I don't think it's necessary to modify this for now, but please feel free to file a bug about the transparency if it bothers you. We'll take a look at it and decide whether or not removing transparency would be better.

> - I did not do any modifications for `setTextContent` yet. Before start
> coding on it I wanted to check if you have any specific suggestions on how I
> supposed to modify the function. I was thinking to add an extra argument
> isAlert which is defaulted to false. In case when it is passed as `true`
> tooltip will insert an alert icon into its content body.
> 

Yeah, that can be safely done in a followup. Filed bug 957634. If you want to also work on that and have the time, it'd be swell, but don't feel obliged :)
Hi Victor,

Thanks a lot for a quick reply and for your detailed response, it helps A LOT.
I definitely want to take care of 957634 once I'm finished with the current bug.

Also will address your comments ^
Excellent, thank you!
Assignee: ntim007 → alexey.novak.mail
I made the changes as you suggested. It looks good when a tooltip centered on the button.

Also I applied CSS changes to debugger.inc.css instead of 3 different CSS files according to introduced changes in Dev Tools. Looks like all CSS is getting consolidated into 1 file which easier to manage, I assume.

Please let me know if there is anything I need to change. Thanks.
Attachment #8357135 - Attachment is obsolete: true
Attachment #8357380 - Flags: review?(vporof)
Attachment #8357380 - Flags: review?(vporof) → review+
Landed! https://hg.mozilla.org/integration/fx-team/rev/3feaef0837d6
Whiteboard: [good first bug][mentor=vporof@mozilla.com][lang=js] → [fixed-in-fx-team]
Priority: -- → P3
https://hg.mozilla.org/mozilla-central/rev/3feaef0837d6
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 29
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: