Closed
Bug 1249555
Opened 9 years ago
Closed 8 years ago
Display edge of explicit grid and implicit grid differently in the css grid inspector
Categories
(DevTools :: Inspector, enhancement, P3)
DevTools
Inspector
Tracking
(firefox51 fixed)
RESOLVED
FIXED
Firefox 51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: pbro, Assigned: gl)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
pbro
:
review+
|
Details | Diff | Splinter Review |
The concept of implicit grid is key in css grids. Depending on how you position elements in the grid, implicit lines may be created automatically to fit them on.
I imagine this concept can be pretty hard to understand at the start and may surprise people.
If the css grid overlay we intend to build in bug 1181227 would colorize implicit lines differently, this would help a lot.
Reporter | ||
Updated•9 years ago
|
Priority: -- → P3
Reporter | ||
Updated•8 years ago
|
Severity: normal → enhancement
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/08cbf5bdf4f4
Changes to the ARM simulator; r=sunfish
Updated•8 years ago
|
Keywords: leave-open
Comment 2•8 years ago
|
||
(In reply to Pulsebot from comment #1)
> Pushed by bbouvier@mozilla.com:
> https://hg.mozilla.org/integration/mozilla-inbound/rev/08cbf5bdf4f4
> Changes to the ARM simulator; r=sunfish
Sorry this was backed out (wrong bug number) in:
o changeset: 307854:2dda5f625bc0
| summary: Backed out changeset 3e7e914abf3d for landing with the wrong bug number;
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Updated•8 years ago
|
Summary: Display implicit lines differently in the css grid inspector → Display edge of explicit grid and implicit grid differently in the css grid inspector
Assignee | ||
Comment 3•8 years ago
|
||
Assignee | ||
Comment 4•8 years ago
|
||
Attachment #8780421 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Attachment #8780631 -
Flags: review?(pbrosset)
Assignee | ||
Comment 5•8 years ago
|
||
Bug 1289200 actually adds the grid line types which will help identify implicit and explicit grid lines. I would expect the approach to figuring out explicit/implicit grid to be different when that lands. For the time being, I have used GridTracks to figure out the grid line type.
Reporter | ||
Comment 6•8 years ago
|
||
Comment on attachment 8780631 [details] [diff] [review]
1249555.patch [2.0]
Review of attachment 8780631 [details] [diff] [review]:
-----------------------------------------------------------------
Code looks good, I only have a few comments to make it a bit shorter and easier to understand.
Other than this, the only blockers I see here are:
- Can you explain the reasoning behind showing the edges of the explicit grid differently than other lines?
We already have a distinction between implicit and explicit lines, isn't that enough for users? I haven't had enough experience with grids so far to judge if this would be a useful information to display.
- See my question below about colors and styles.
Once these are cleared, I can R+.
::: devtools/server/actors/highlighters/css-grid.js
@@ +13,5 @@
> const LINE_PADDING = 10;
> +const GRID_LINES_PROPERTIES = {
> + "edge": {
> + lineDash: [0, 0],
> + strokeStyle: "#4B0082"
Do these dash styles and colors come from Helen's mockups? Just want to make sure we're not coming up with these ourselves and have some design guidance here.
The colors do seem very very close and when they're applied to 1px-wide lines, it's hard to see the color difference. The different dash styles do help though.
@@ +168,5 @@
> return fragment.cols.lines[fragment.cols.lines.length - 1].start;
> },
>
> + getLastEdgeLineIndex(tracks) {
> + let lineIndex = tracks.length - 1;
The logic in this function through me off for a while because of the name of this variable.
This variable really is a trackIndex, not a lineIndex.
With this name, the logic becomes easier to follow. You're just going through tracks, from the last one, in reverse direction, until you find one that is implicit, and then you return the index of the line after this track.
@@ +206,5 @@
> }
> }
> },
>
> renderRowLines(rows, {bounds}, startColPos, endColPos) {
renderRowLines and renderColLines are starting to get big, and they share essentially all of the same code, except that one is for vertical lines and the other for horizontal lines.
So I think we should have a meta renderLines function that takes a few more arguments like mainSide ("top" for rows and "left" for cols), crossSide ("left" for rows and "top" for cols), mainSize ("width" for rows and "height" for cols), crossSize ...
This way we can have just one renderLines function that has all of this code in common.
I've used the main/cross vocabulary from flexbox.
@@ +235,5 @@
> }
> }
> },
>
> + renderLine(x1, y1, x2, y2, gridType) {
The variable gridType might be better named as lineType.
Attachment #8780631 -
Flags: review?(pbrosset)
Assignee | ||
Comment 7•8 years ago
|
||
Attachment #8780631 -
Attachment is obsolete: true
Attachment #8783832 -
Flags: review?(pbrosset)
Assignee | ||
Comment 8•8 years ago
|
||
(In reply to Patrick Brosset <:pbro> from comment #6)
> Comment on attachment 8780631 [details] [diff] [review]
> 1249555.patch [2.0]
>
> Review of attachment 8780631 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> Code looks good, I only have a few comments to make it a bit shorter and
> easier to understand.
> Other than this, the only blockers I see here are:
> - Can you explain the reasoning behind showing the edges of the explicit
> grid differently than other lines?
> We already have a distinction between implicit and explicit lines, isn't
> that enough for users? I haven't had enough experience with grids so far to
> judge if this would be a useful information to display.
> - See my question below about colors and styles.
>
> Once these are cleared, I can R+.
We already talked about this, but this is based on Helen's design. Colors were provided by Helen. The line dash numbers were something I came up with based on Helen's design, but it should probably be verify by Helen. Let's do this in a follow up in a week after Helen is done with her UX analysis.
>
> ::: devtools/server/actors/highlighters/css-grid.js
> @@ +13,5 @@
> > const LINE_PADDING = 10;
> > +const GRID_LINES_PROPERTIES = {
> > + "edge": {
> > + lineDash: [0, 0],
> > + strokeStyle: "#4B0082"
>
> Do these dash styles and colors come from Helen's mockups? Just want to make
> sure we're not coming up with these ourselves and have some design guidance
> here.
> The colors do seem very very close and when they're applied to 1px-wide
> lines, it's hard to see the color difference. The different dash styles do
> help though.
>
See above.
> @@ +168,5 @@
> > return fragment.cols.lines[fragment.cols.lines.length - 1].start;
> > },
> >
> > + getLastEdgeLineIndex(tracks) {
> > + let lineIndex = tracks.length - 1;
>
> The logic in this function through me off for a while because of the name of
> this variable.
> This variable really is a trackIndex, not a lineIndex.
> With this name, the logic becomes easier to follow. You're just going
> through tracks, from the last one, in reverse direction, until you find one
> that is implicit, and then you return the index of the line after this track.
>
Fixed.
> @@ +206,5 @@
> > }
> > }
> > },
> >
> > renderRowLines(rows, {bounds}, startColPos, endColPos) {
>
> renderRowLines and renderColLines are starting to get big, and they share
> essentially all of the same code, except that one is for vertical lines and
> the other for horizontal lines.
> So I think we should have a meta renderLines function that takes a few more
> arguments like mainSide ("top" for rows and "left" for cols), crossSide
> ("left" for rows and "top" for cols), mainSize ("width" for rows and
> "height" for cols), crossSize ...
> This way we can have just one renderLines function that has all of this code
> in common.
> I've used the main/cross vocabulary from flexbox.
>
Fixed.
> @@ +235,5 @@
> > }
> > }
> > },
> >
> > + renderLine(x1, y1, x2, y2, gridType) {
>
> The variable gridType might be better named as lineType.
Fixed.
Assignee | ||
Comment 9•8 years ago
|
||
Current patch doesn't rely on Bug 1289200.
Reporter | ||
Updated•8 years ago
|
Attachment #8783832 -
Flags: review?(pbrosset) → review+
Assignee | ||
Comment 10•8 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/8173084bb8ebc4695a130e47575c8ff024d3f896
Bug 1249555 - Display edge of explicit grid and implicit grid differently in the css grid inspector r=pbro
Comment 11•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•