Closed Bug 1286259 Opened 8 years ago Closed 8 years ago

Reps: grip-array rep should support limited preview

Categories

(DevTools :: Shared Components, defect, P1)

defect

Tracking

(firefox51 fixed)

RESOLVED FIXED
Firefox 51
Iteration:
51.1 - Aug 15
Tracking Status
firefox51 --- fixed

People

(Reporter: Honza, Assigned: gasolin)

References

Details

(Whiteboard: [reserve-html][good taipei bug])

Attachments

(3 files, 2 obsolete files)

GripArray is limiting number of items in long mode to 300, but number of items in grip-preview is limited to 10. This causes that the following array: let arr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]; is rendered as follows in long mode: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] The last "10" element is missing and there is no "more..." label. The rep should: 1) look at grip.preview.length -> to see the total number of items 2) and display 'more...' if grip.preview.length > than the actual number of items in the preview. --- Additionally (not as part of this bug) it could be great if the user can load the rest (by issuing 'getPrototypeAndProperties' packet) without going to the Variables view... In case of the HTTP Inspector (the Console panel) there is a 'more...' link that allows to fetch the rest of the response body if it's bigger than LongStringGrip max limit. Honza
Whiteboard: [devtools-html]
Flags: qe-verify-
Whiteboard: [devtools-html] → [devtools-html] [triage]
Priority: -- → P3
Whiteboard: [devtools-html] [triage] → [reserve-html]
Whiteboard: [reserve-html] → [reserve-html][good taipei bug]
took it. > it could be great if the user can load the rest (by issuing 'getPrototypeAndProperties' packet) without going to the Variables view... Sounds cool, can you point me any example that already provide such feature in devtools?
Assignee: nobody → gasolin
Status: NEW → ASSIGNED
Flags: needinfo?(odvarko)
Attached image right result (obsolete) —
I took the example on console and the result looks right to me
Ooh it's object grip-array, I'll add related test in test_reps_grip-array.html to make sure things works well.
Flags: needinfo?(odvarko)
Comment on attachment 8771212 [details] [diff] [review] 0001-Bug-1286259-Reps-grip-array-rep-should-support-limit.patch Review of attachment 8771212 [details] [diff] [review]: ----------------------------------------------------------------- I don't see the `more...` link when testing this in RepTester. Home come that the test passes...? Honza ::: devtools/client/shared/components/reps/grip-array.js @@ +50,5 @@ > return items; > } > > + if (grip.preview.length) { > + max = max > grip.preview.length ? grip.preview.length : max; This is wrong. You need to check (and use) number of items available in the preview (grip.preview.items.length) @@ +91,4 @@ > } > } > > + if (array.length > max) { This also needs to use the preview.items array.
Attachment #8771212 - Flags: review?(odvarko)
Hi Fred, it's just a reminder that I'll also fix the length limit issue in Bug 1285530 and it might have some conflict wit your patch. Sorry if it cause any inconvenience to you.
Flags: needinfo?(gasolin)
Depends on: 1285530
Flags: needinfo?(gasolin)
Priority: P3 → P2
Honza said in comment 1 > number of items in grip-preview is limited to 10. I can't neither find `grip-preview` related code and its limit, do you know how to reproduce this issue?
Flags: needinfo?(lclark)
It was a typo. It should be a '.', not a '-'. Search for grip.preview in grip-array.js
Flags: needinfo?(lclark)
Attached image rep result
seems the rep result already shows correctly in rep tester, should I just resolve this issue?
Attachment #8770846 - Attachment is obsolete: true
Flags: needinfo?(lclark)
Let's wait for Honza's opinion before closing this out.
Flags: needinfo?(lclark) → needinfo?(odvarko)
(In reply to Fred Lin [:gasolin] from comment #9) > Created attachment 8777216 [details] > rep result > > seems the rep result already shows correctly in rep tester, should I just > resolve this issue? I can still see the problem in rep-tester. When evaluating `["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]` using `long` mode, the result is: `Array["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]` While it should be: `Array["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 1 more…]` (In reply to Lin Clark [:linclark] from comment #8) > It was a typo. It should be a '.', not a '-'. Correct, sorry for confusion. Honza
Flags: needinfo?(odvarko)
thanks, I can reproduce it now!
Comment on attachment 8779956 [details] Bug 1286259 - Reps: grip-array rep should support limited preview; https://reviewboard.mozilla.org/r/70818/#review68680 Looks good to me now! R+ assuming all tests are green. Thanks for working on this! Honza
Attachment #8779956 - Flags: review?(odvarko) → review+
Thanks for review! tree herder green
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/autoland/rev/fccbaff0ea6f Reps: grip-array rep should support limited preview; r=Honza
Keywords: checkin-needed
Bug 1284855 had add extra space between braces, will update the test case to reflect the change
Flags: needinfo?(gasolin)
The only change is add extra space for test case to pass all tests, so carry r+ here. change format because mozreview push shows `Parent review request is submitted or discarded` message
Attachment #8771212 - Attachment is obsolete: true
Attachment #8781369 - Flags: review+
Please help check-in 0001-Bug-1286259-Reps-grip-array-rep-should-support-limit.patch thanks
Keywords: checkin-needed
Pushed by ntim.bugs@gmail.com: https://hg.mozilla.org/integration/fx-team/rev/cc8350ff1a9b Reps: grip-array rep should support limited preview, add extra space; r=Honza
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Iteration: --- → 51.1 - Aug 15
Priority: P2 → P1
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: