Closed
Bug 1284855
Opened 9 years ago
Closed 9 years ago
Reps: match spacing and brace placement in nested objects/arrays
Categories
(DevTools :: Shared Components, enhancement, P1)
DevTools
Shared Components
Tracking
(firefox50 affected)
RESOLVED
FIXED
Iteration:
51.3 - Sep 19
| Tracking | Status | |
|---|---|---|
| firefox50 | --- | affected |
People
(Reporter: linclark, Assigned: steveck)
References
Details
(Whiteboard: [reserve-html])
Attachments
(2 files)
|
19.95 KB,
patch
|
Details | Diff | Splinter Review | |
|
58 bytes,
text/x-review-board-request
|
Honza
:
review+
|
Details |
For example, the console currently outputs this:
> Object { foo: Object }
Reps would output this:
> Object{foo: Object{}}
Updated•9 years ago
|
Blocks: devtools-html-2
Updated•9 years ago
|
Flags: qe-verify-
Priority: -- → P2
Whiteboard: [devtools-html] [triage] → [devtools-html]
| Assignee | ||
Comment 1•9 years ago
|
||
Sorry I didn't get this part:
(In reply to Lin Clark [:linclark] from comment #0)
> For example, the console currently outputs this:
>
> > Object { foo: Object }
>
> Reps would output this:
>
> > Object{foo: Object{}}
So it means that all the nested object reps should be displayed like Object{foo: Object{}} instead of Object { foo: Object }, and the test[1] should be revised to:
> const defaultOutput = `Object{objProp: Object{}, strProp: "test string"}`;
And we should start from object.js. Hope that I didn't misunderstand the requirement.
[1] https://dxr.mozilla.org/mozilla-central/source/devtools/client/shared/components/test/mochitest/test_reps_grip.html#150
Flags: needinfo?(lclark)
| Reporter | ||
Comment 2•9 years ago
|
||
Sorry, my wording was not clear.
We want the reps to output as the current console does. If you did a console.log({foo: "bar"}) in the current console, it would show up as:
> Object { foo: "bar" }
That's what we want.
There is a separate issue for making sure that the space between "Object" and "{" is there. This issue is just about the spacing inside the nested object/array/etc.
Flags: needinfo?(lclark)
| Assignee | ||
Comment 3•9 years ago
|
||
Ok, does it only happen in object/array reps, not in grip reps with object/array type? I'm still confused about where to find the nested object/array case in the panel, because it seems that the general case of nested object display would be "Object { foo: Object }".
Flags: needinfo?(lclark)
| Reporter | ||
Comment 4•9 years ago
|
||
It also happens in grips and grip-arrays.
Sorry, my wording was confusing. I meant the properties nested inside the object. So the spacing around the properties.
Flags: needinfo?(lclark)
| Assignee | ||
Comment 5•9 years ago
|
||
Thanks for the explanation, it looks like the current display between brace/bracket and properties uses css margin for the spacing. Could I assume that we should replace all the margin styling for objectBrace/objectBracket with real space in js?
Flags: needinfo?(lclark)
| Reporter | ||
Comment 6•9 years ago
|
||
We should get Honza's opinion on this, but I would say that yes, we should replace margin styling for real spaces.
Flags: needinfo?(lclark) → needinfo?(odvarko)
Comment 7•9 years ago
|
||
(In reply to Lin Clark [:linclark] from comment #6)
> We should get Honza's opinion on this, but I would say that yes, we should
> replace margin styling for real spaces.
Agree, using real spaces is better when coping rendered text into the clipboard.
Honza
Flags: needinfo?(odvarko)
| Assignee | ||
Comment 8•9 years ago
|
||
Thanks, hope it's the last question about the spacing: For the grip in tiny mode, it would also have a object with class "objectLeftBrace" and empty text content at the end[1]. I'm not sure if this object is necessary for objectBox. Should we simply remove it, or rename the class instead?
[1] https://dxr.mozilla.org/mozilla-central/source/devtools/client/shared/components/reps/grip.js#162-168
Flags: needinfo?(odvarko)
Comment 9•9 years ago
|
||
(In reply to Steve Chung [:steveck] from comment #8)
> Thanks, hope it's the last question about the spacing: For the grip in tiny
> mode, it would also have a object with class "objectLeftBrace" and empty
> text content at the end[1]. I'm not sure if this object is necessary for
> objectBox. Should we simply remove it, or rename the class instead?
Are talking about a space between `Object` and `,` ?
E.g. Object { foo: Object , bar: Object }
As far as I can tell this space is again CSS margin and as soon as we remove it from reps.css it'll disappear. Does this answer the question?
Honza
Flags: needinfo?(odvarko)
Updated•9 years ago
|
Priority: P2 → P3
Whiteboard: [devtools-html] → [reserve-html]
| Assignee | ||
Comment 10•9 years ago
|
||
Hi Honza,
It's patch for the replacing the styling with real space. Not sure if it totally fit the requirement. I'll also reply the question in the review.
Attachment #8772350 -
Flags: feedback?(odvarko)
Updated•9 years ago
|
Assignee: nobody → schung
Status: NEW → ASSIGNED
| Assignee | ||
Comment 11•9 years ago
|
||
Comment on attachment 8772350 [details] [diff] [review]
bug-1284855.patch
Review of attachment 8772350 [details] [diff] [review]:
-----------------------------------------------------------------
::: devtools/client/shared/components/test/mochitest/test_reps_array.html
@@ +47,5 @@
> const renderedRep = shallowRenderComponent(Rep, { object: stub });
> is(renderedRep.type, ArrayRep.rep, `Rep correctly selects ${ArrayRep.rep.displayName}`);
>
> // Test rendering
> + const defaultOutput = `[ ]`;
It will cause the empty array displayed with 2 spaces inside the brackets, maybe we should remove all the spaces(or only left one space)?
Comment 12•9 years ago
|
||
Comment on attachment 8772350 [details] [diff] [review]
bug-1284855.patch
Review of attachment 8772350 [details] [diff] [review]:
-----------------------------------------------------------------
(In reply to Steve Chung [:steveck] from comment #11)
> Comment on attachment 8772350 [details] [diff] [review]
> bug-1284855.patch
>
> Review of attachment 8772350 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: devtools/client/shared/components/test/mochitest/test_reps_array.html
> @@ +47,5 @@
> > const renderedRep = shallowRenderComponent(Rep, { object: stub });
> > is(renderedRep.type, ArrayRep.rep, `Rep correctly selects ${ArrayRep.rep.displayName}`);
> >
> > // Test rendering
> > + const defaultOutput = `[ ]`;
>
> It will cause the empty array displayed with 2 spaces inside the brackets,
> maybe we should remove all the spaces(or only left one space)?
Yes, this is the part I don't like in the patch.
Can we do it as follows?
1) No space if the array is empty, example: `[]`
2) No space if the array is displayed in tiny mode with number of items inside, example: `[8]`
3) Spaces in short and long modes: [ 1, 2, 3 ]
4) the same for objects: `{}`, `{ p1: "value", p2: value }`
Honza
Attachment #8772350 -
Flags: feedback?(odvarko)
| Assignee | ||
Comment 13•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/66008/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/66008/
Attachment #8773626 -
Flags: review?(odvarko)
Comment 14•9 years ago
|
||
Comment on attachment 8773626 [details]
Bug 1284855 - Reps: match spacing and brace placement in nested objects/arrays.
https://reviewboard.mozilla.org/r/66008/#review63128
R+, but please resolve the one small thing I commented.
Honza
::: devtools/client/shared/components/reps/object.js:162
(Diff revision 1)
> this.getTitle(object),
> objectLink({
> className: "objectLeftBrace",
> role: "presentation",
> object: object
> - }, "{"),
> + }, "{ "),
Why there is no space before `{`?
It should be consistent with Grip rep.
Honza
Attachment #8773626 -
Flags: review?(odvarko) → review+
Comment 15•9 years ago
|
||
This will also need try push
Honza
| Assignee | ||
Comment 16•9 years ago
|
||
Comment on attachment 8773626 [details]
Bug 1284855 - Reps: match spacing and brace placement in nested objects/arrays.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/66008/diff/1-2/
| Assignee | ||
Comment 17•9 years ago
|
||
Thanks for the review! I applied the suggestion and try build has 2 unrelated failed.
Keywords: checkin-needed
| Assignee | ||
Comment 19•9 years ago
|
||
Comment on attachment 8773626 [details]
Bug 1284855 - Reps: match spacing and brace placement in nested objects/arrays.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/66008/diff/2-3/
Comment 21•9 years ago
|
||
has problems to apply:
1 out of 1 hunks FAILED -- saving rejects to file devtools/client/shared/components/reps/grip-array.js.rej
patching file devtools/client/shared/components/test/mochitest/test_reps_grip-array.html
Hunk #1 FAILED at 70
Hunk #2 FAILED at 98
Hunk #3 FAILED at 158
3 out of 3 hunks FAILED -- saving rejects to file devtools/client/shared/components/test/mochitest/test_reps_grip-array.html.rej
patch failed to apply
abort: fix up the working directory and run hg transplant --continue
Flags: needinfo?(schung)
Updated•9 years ago
|
Keywords: checkin-needed
| Assignee | ||
Comment 22•9 years ago
|
||
Comment on attachment 8773626 [details]
Bug 1284855 - Reps: match spacing and brace placement in nested objects/arrays.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/66008/diff/3-4/
| Assignee | ||
Comment 24•9 years ago
|
||
Request checkin-needed again. It is not possible to bust OSX build with this patch... :/
Keywords: checkin-needed
Comment 25•9 years ago
|
||
Needs rebasing :(
applying db587c44ba37
patching file devtools/client/shared/components/test/mochitest/test_reps_array.html
Hunk #2 FAILED at 101
Hunk #4 FAILED at 188
Hunk #5 FAILED at 218
3 out of 5 hunks FAILED -- saving rejects to file devtools/client/shared/components/test/mochitest/test_reps_array.html.rej
patching file devtools/client/shared/components/test/mochitest/test_reps_grip-array.html
Hunk #2 FAILED at 100
1 out of 4 hunks FAILED -- saving rejects to file devtools/client/shared/components/test/mochitest/test_reps_grip-array.html.rej
patching file devtools/client/shared/components/test/mochitest/test_reps_grip.html
Hunk #2 FAILED at 97
Hunk #3 FAILED at 134
2 out of 4 hunks FAILED -- saving rejects to file devtools/client/shared/components/test/mochitest/test_reps_grip.html.rej
patching file devtools/client/shared/components/test/mochitest/test_reps_object.html
Hunk #2 FAILED at 95
Hunk #3 FAILED at 121
2 out of 4 hunks FAILED -- saving rejects to file devtools/client/shared/components/test/mochitest/test_reps_object.html.rej
patch failed to apply
Keywords: checkin-needed
| Assignee | ||
Comment 26•9 years ago
|
||
Comment on attachment 8773626 [details]
Bug 1284855 - Reps: match spacing and brace placement in nested objects/arrays.
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/66008/diff/4-5/
| Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 27•9 years ago
|
||
Still doesn't apply.
patching file devtools/client/shared/components/reps/array.js
Hunk #1 FAILED at 117
1 out of 1 hunks FAILED -- saving rejects to file devtools/client/shared/components/reps/array.js.rej
patching file devtools/client/shared/components/reps/grip-array.js
Hunk #1 FAILED at 100
1 out of 1 hunks FAILED -- saving rejects to file devtools/client/shared/components/reps/grip-array.js.rej
patching file devtools/client/shared/components/reps/grip.js
Hunk #1 FAILED at 183
1 out of 1 hunks FAILED -- saving rejects to file devtools/client/shared/components/reps/grip.js.rej
patching file devtools/client/shared/components/reps/object.js
Hunk #1 FAILED at 145
1 out of 1 hunks FAILED -- saving rejects to file devtools/client/shared/components/reps/object.js.rej
patch failed to apply
Keywords: checkin-needed
Comment 28•9 years ago
|
||
Pushed by bbouvier@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3e7e914abf3d
Baseline fixes for handling custom NaN payloads; r=lth
Comment 29•9 years ago
|
||
(In reply to Pulsebot from comment #28)
> Pushed by bbouvier@mozilla.com:
> https://hg.mozilla.org/integration/mozilla-inbound/rev/3e7e914abf3d
> Baseline fixes for handling custom NaN payloads; r=lth
Oops sorry, landed with the wrong bug number; backed out:
o changeset: 307856:2dda5f625bc0
| summary: Backed out changeset 3e7e914abf3d for landing with the wrong bug number;
Keywords: leave-open
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 31•9 years ago
|
||
Rebase the patch again and triggered a try build...(keep my fingers crossed that no more conflicts)
| Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 32•9 years ago
|
||
Pushed by kwierso@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/a63498564d7d
Reps: match spacing and brace placement in nested objects/arrays. r=Honza
Keywords: checkin-needed
Comment 33•9 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 34•9 years ago
|
||
Could we close this bug since it's already in central(and the reason why it left as open seems not the patch's problem)?
Flags: needinfo?(bbouvier)
Comment 35•9 years ago
|
||
(In reply to Steve Chung [:steveck] from comment #34)
> Could we close this bug since it's already in central(and the reason why it
> left as open seems not the patch's problem)?
Yes, sorry for the trouble.
Flags: needinfo?(bbouvier)
Keywords: leave-open
| Assignee | ||
Comment 36•9 years ago
|
||
Hi Wes, could we close this bug, since this patch is already merged in central?
Flags: needinfo?(wkocher)
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(wkocher)
Resolution: --- → FIXED
Updated•9 years ago
|
Iteration: --- → 51.3 - Sep 12
Priority: P3 → P1
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•