Closed Bug 1538108 Opened 5 years ago Closed 5 years ago

Hide the computed longhand expander in the new rule-view when the computed values are empty

Categories

(DevTools :: Inspector: Rules, enhancement, P2)

enhancement

Tracking

(firefox68 fixed)

RESOLVED FIXED
Firefox 68
Tracking Status
firefox68 --- fixed

People

(Reporter: pbro, Assigned: pong7219)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In bug 1535315 we made a change to the rule-view that hides the computed longhand expander icon when the computed properties don't have values.
This happens when a CSS variable is used in the shorthand's value, because that prevents devtools from successfully deriving the values for the longhands.

We want to do the same thing in the new rule-view.

Gabriel's suggestion for this:

We could potentially add the shouldShowComputedExpander property from TextPropertyEditor (something like hasComputed) into the TextProperty model and also fix this in the new rules view.

The relevant bits of the code are in
https://searchfox.org/mozilla-central/source/devtools/client/inspector/rules/components/Declaration.js#221.

Adding a new property in the model that we will want to access in the components will need to be added to the reducer and types
https://searchfox.org/mozilla-central/source/devtools/client/inspector/rules/reducers/rules.js#39
https://searchfox.org/mozilla-central/source/devtools/client/inspector/rules/types.js#23

Blocks: dt-rules

Hi Patrick,

May I work on this bug?

Thanks!

Sure! I see you've worked on DevTools bugs before, so I guess you are good getting started on your own?
If you need any more help, please let us know. I think Gabriel (:gl on bugzilla) is the best person to help you on this particular bug.

The goal is to put this logic (whether a declaration has any computed longhands that are worth showing) in common between the old and the new rule-view (the new one being written now in React).
And then implement the necessary changes in the new rule-view's redux and react components to hide/show the expander icon based on that.
Hopefully the links provided by Gabriel above are enough to get started.

I'm assigning the bug to you now.

Assignee: nobody → pong7219
Status: NEW → ASSIGNED

Hi Patrick,

Thank you! Yes, those links are very helpful :) I'll look at them and send a patch so we can start a conversation there.

Pushed by gabriel.luong@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3195ecf25c27
Hide the computed expander and shorthand overridden list in the new rules view when the computed values are empty r=gl
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
You need to log in before you can comment on or make changes to this bug.