Closed Bug 1269891 Opened 6 years ago Closed 6 years ago

Add more documentation comments to the Tree component

Categories

(DevTools :: Shared Components, defect)

defect
Not set
normal

Tracking

(firefox49 fixed)

RESOLVED FIXED
Firefox 49
Tracking Status
firefox49 --- fixed

People

(Reporter: fitzgen, Assigned: fitzgen)

Details

Attachments

(1 file)

No description provided.
Assignee: nobody → nfitzgerald
Status: NEW → ASSIGNED
Comment on attachment 8748375 [details] [diff] [review]
Add more documentation comments to the Tree component

Review of attachment 8748375 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great. I still think a good feature would be making keyboard navigation optional and thus making `getParent` optional because most data structures don't have that off-hand, so any usage of this component requires computing a parent map.

I'll discuss with others soon about all this, we need to resolve this with Honza's.

::: devtools/client/shared/components/tree.js
@@ +18,5 @@
> + *
> + * This tree component doesn't make any assumptions about the structure of your
> + * tree data. Whether children are computed on demand, or stored in an array in
> + * the parent's `_children` property, it doesn't matter. We only require the
> + * implementation of a `getChildren` function. Likewise for parents, roots, and

Maybe combine these two sentences. The sentence "We only require the implementation of a `getChildren` function." makes it sounds like that's all that required, but the next sentence lists more required things
Attachment #8748375 - Flags: review?(jlong) → review+
(In reply to James Long (:jlongster) from comment #2)
> Comment on attachment 8748375 [details] [diff] [review]
> Add more documentation comments to the Tree component
> 
> Review of attachment 8748375 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> Looks great. I still think a good feature would be making keyboard
> navigation optional and thus making `getParent` optional because most data
> structures don't have that off-hand, so any usage of this component requires
> computing a parent map.

We could do that. Another option would be to create the parent map ourselves during traversal, on main thread if `getParent` is not supplied.
https://hg.mozilla.org/mozilla-central/rev/3fd6d4621afc
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 49
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.