Closed Bug 715970 Opened 13 years ago Closed 12 years ago

Highlighted node should center in the visualization (Tilt)

Categories

(DevTools :: Inspector, defect)

12 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 13

People

(Reporter: vporof, Assigned: vporof)

References

Details

(Whiteboard: [tilt])

Attachments

(2 files, 2 obsolete files)

Sometimes we're selecting a node using the breadcrumbs or the HTML panel which is not visible in the visualization viewport. It would be nice if the camera automatically translated/zoomed/centered/danced so we can see it.
Assignee: nobody → vporof
Status: NEW → ASSIGNED
Whiteboard: [tilt]
Summary: Highlighted node should center in the visualization → Highlighted node should center in the visualization (Tilt)
Attached patch v0 (obsolete) — Splinter Review
WIP.
Attached patch v1 (obsolete) — Splinter Review
Attachment #592485 - Attachment is obsolete: true
Attached patch v2Splinter Review
Fixed a few small problems with moveIntoView().
Attachment #592500 - Attachment is obsolete: true
Attachment #592517 - Flags: review? → review?(rcampbell)
Attached patch v2.1Splinter Review
Made sure bringing the node into view only happens when the selection is changed via the highlighter or breadcrumbs, and not by picking inside Tilt. I think this way is better. Rob, what do you think?
Attachment #593880 - Flags: review?(rcampbell)
Depends on: 722129
Blocks: 719042
Attachment #592517 - Flags: review?(rcampbell)
Comment on attachment 593880 [details] [diff] [review]
v2.1

    *                 the index of the node in the this.traverseData array
+   * @param {String} aFlags
+   *                 flags specifying highlighting options
    */
-  highlightNodeFor: function TVP_highlightNodeFor(aNodeIndex)
+  highlightNodeFor: function TVP_highlightNodeFor(aNodeIndex, aFlags)
   {
     this.redraw = true;

do you see adding other flags in the future? Could the be better served by a flags object or even a moveIntoView boolean parameter?
I think other flags are pretty feasible someday ("bounce"? "makeItPop"?). Maybe using a string for this is too hacky (the nice thing about it that instead of simply a string you could also use an array like ["moveIntoView, "makeItPop"] because indexOf).

An object may be more obvious. But then we're dealing with redundancy (like highlight(aNode, { moveIntoView: false });), since I don't see a scenario when flags should be turned off, since they're all off by default. Which approach do you prefer?
Comment on attachment 593880 [details] [diff] [review]
v2.1

I don't feel strongly about it. Providing room for future flags is an ok reason to do this and the string check isn't horrible.
Attachment #593880 - Flags: review?(rcampbell) → review+
Whiteboard: [tilt] → [tilt][land-in-fx-team]
https://hg.mozilla.org/integration/fx-team/rev/0f5003f35498
Whiteboard: [tilt][land-in-fx-team] → [tilt][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/0f5003f35498
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [tilt][fixed-in-fx-team] → [tilt]
Target Milestone: --- → Firefox 13
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: