Closed Bug 1667943 Opened 4 years ago Closed 3 years ago

Remove inline tooltips from inspector codebase

Categories

(DevTools :: Inspector, task, P3)

task

Tracking

(firefox89 fixed)

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: jdescottes, Assigned: manuelalejandrosac, Mentored)

Details

(Keywords: good-first-bug)

Attachments

(1 file)

We had a project to redesign inspector tooltips as Inline Tooltips:
https://searchfox.org/mozilla-central/source/devtools/client/shared/widgets/tooltip/InlineTooltip.js

But this project has been stopped and will not be finished. We should remove everything related to those tooltips from the codebase.

1/ The InlineToolip.js file should be removed.
2/ The reference to this file in the corresponding moz.build file should also be removed: https://searchfox.org/mozilla-central/rev/f27594d62e7f1d57626889255ce6a3071d67209f/devtools/client/shared/widgets/tooltip/moz.build#13
3/ On top of the file itself, there is also the useInline property in SwatchBasedEditorTooltip.js: https://searchfox.org/mozilla-central/search?q=useInline&path=SwatchBasedEditorTooltip.js . We should remove this property.
4/ There are also 2 references in the codebase to an inline-tooltip-container class. One of those will go away as part of this cleanup, but since there are no styles/behaviors associated with it, we should also remove it from text-property-editor.js.

Setting as good first bug. The summary should have all the info & steps.

I am also linking the original bug here to help people understand the original code changes. https://bugzilla.mozilla.org/show_bug.cgi?id=1307481

Hey can i work on this? If yes, then can u guide me as to how can i access the code, and remove these files.

Hi!

Sure I'll assign the bug to you.
You should find all the information you need to get started on https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
There is also a documentation more focused around DevTools at https://firefox-source-docs.mozilla.org/devtools/getting-started/README.html, but in theory the first one should be enough.

If you have any issue setting up your dev environment, the best is to ask for help on https://chat.mozilla.org/#/room/#devtools:mozilla.org

If you have more general questions you wish to ask on the bug, make sure to use the "Request information from" checkbox below the comment box, so that we are notified.

Thanks!

Assignee: nobody → chelzee.rawat
Status: NEW → ASSIGNED

okay, i will get started!

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: chelzee.rawat → nobody
Status: ASSIGNED → NEW

Hey Julian,
What's the status of this bug?
Can I work on this if possible?

I would also like to work on this if its availaible

Hi, I am new to open source and want to start. If it is still open I am ready to contribute.

Hi Julian,would like to work on this issue,if its available.

Hello sir,
I succesfully build this mozilla. Can I work on this issue?
Thanks

Please response me.

Vishal, you are now assigned to three other bugs: https://mzl.la/2OurUYm
Please fix those and then ask for more.

Thank you for helping!

Honza

Hello jdescottes.
I just want to ask a simple question. In this issue. Do I only have to erase and remove files nothing else?
Request Information from :jdescottes.

Hi Vishal, to request information, please use the "Request information from" UI below the comment box.
Typing Request Information from will not create a notification, and we might miss your question :)

The summary is quite complete: https://bugzilla.mozilla.org/show_bug.cgi?id=1667943#c0 and details everything you have to do. Please read it carefully, removing the file is only part of the task.

Also as Honza mentioned, it would be good to try to resolve the bugs you are already assigned to before jumping on this.

Thanks!

Hello, I was wondering if I could work on this bug?

(In reply to Manuel Carretero from comment #15)

Hello, I was wondering if I could work on this bug?

Sure Manuel, assigning it to you.
Take a look at the summary https://bugzilla.mozilla.org/show_bug.cgi?id=1667943#c0 hopefully this should still be up to date.
If you need to setup your development environment, our docs are at https://firefox-source-docs.mozilla.org/setup/index.html

If you need help, either ask here (make sure to use the "Request information from" UI below the comment box, to make sure we get a clear notification), or you can use https://chat.mozilla.org/#/room/#devtools:mozilla.org

Thanks!

Assignee: nobody → manuelalejandrosac
Status: NEW → ASSIGNED

Thanks Julian!, will start working on it later this evening

I have a problem understanding something, On line 155 one of the arguments taken from the createChild() function is an object that has has a key called "class" with the value "ruleview-propertycontainer inline-tooltip-container", should I remove the object entirely? Wouldn't the createChild function stop working if I remove one of its parameters? From how the funtion createChild() is declared I don't understand what parameters it takes and how should I edit it

Flags: needinfo?(jdescottes)

Whoops forgot to mention I'm talking about the text-property-editor.js file

(In reply to Manuel Carretero from comment #18)

I have a problem understanding something, On line 155 one of the arguments taken from the createChild() function is an object that has has a key called "class" with the value "ruleview-propertycontainer inline-tooltip-container", should I remove the object entirely? Wouldn't the createChild function stop working if I remove one of its parameters? From how the funtion createChild() is declared I don't understand what parameters it takes and how should I edit it

Hi Manuel,

Short version: we will keep the argument, but remove the " inline-tooltip-container" in the string (ie{ class: "ruleview-propertycontainer" }).

Long version: createChild is defined at https://searchfox.org/mozilla-central/rev/3ae6f9e4444f3fbf61034317540d36f621117600/devtools/client/inspector/shared/utils.js#108

function createChild(parent, tagName, attributes = {}) {
  const elt = parent.ownerDocument.createElementNS(HTML_NS, tagName);
  for (const attr in attributes) {
    if (attributes.hasOwnProperty(attr)) {
      // ... simplified ...
      elt.setAttribute(attr, attributes[attr]);
    }
  }
  // ...
}

And it's called as:

    this.container = createChild(this.element, "div", {
      class: "ruleview-propertycontainer inline-tooltip-container",
    });

Our { class } object is the 3rd argument attributes. createChild loops on all the keys in attributes (via const attr in attributes) and will usually set them on the newly created element using elt.setAttribute(attr, attributes[attr]);. So for class, we will end up doing elt.setAttribute("class", "ruleview-propertycontainer inline-tooltip-container");, which will create 2 classNames on the element.

We still want to set the className ruleview-propertycontainer, but we don't need inline-tooltip-container anymore. Because it was only used from devtools/client/shared/widgets/tooltip/SwatchBasedEditorTooltip.js to find the container.

Flags: needinfo?(jdescottes)

Thanks for the detailed answer Julian, I'm looking to get my code reviewed when it's suitable for you

Flags: needinfo?(jdescottes)

Thanks Manuel, try to post your patch to phabricator I'll get a ping from the review tool automatically :)
I see from https://chat.mozilla.org you had a few issues submitting the patch, apparently because you have uncommitted changes in your repository. As suggested by others in chat, make sure to either:

  • fold the uncommitted changes in your current commit with hg commit --amend
  • or discard the uncommitted changes for now with hg shelve

You can review the uncommitted changes using hg diff.

Flags: needinfo?(jdescottes)
Pushed by jdescottes@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d9835f0eb743
Removed inline tooltips references. r=jdescottes
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.