Make TreeViewListbox capable of handling nested rows
Categories
(Thunderbird :: General, enhancement)
Tracking
(thunderbird_esr91 wontfix)
Tracking | Status | |
---|---|---|
thunderbird_esr91 | --- | wontfix |
People
(Reporter: darktrojan, Assigned: darktrojan)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
This turns out to be much easier than expected. nsITreeView
has some very handy methods such as isContainerOpen
and getParentIndex
.
Assignee | ||
Comment 1•3 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/7ccf28c07222
Make TreeViewListbox capable of handling nested rows. r=mkmelin
Assignee | ||
Comment 3•3 years ago
|
||
I had to manually call rowCountChanged
and invalidate the containing row, in the case where the view has no reference to the tree (that is, view.setTree
fails due to TreeViewListbox not being a real tree). That's probably the only real case we have (the thread tree) but the test uses a JS tree view and therefore calls the functions itself.
Comment 4•3 years ago
|
||
This is a big step forward. Congrats!
It's unclear how far along this listbox code is or what's planned. Looking at just the row indentation design, the folder tree and thread tree implementations are radically different
#folderTree > li > ul > li > ul {
--indent: 32px;
}
.container {
padding-inline-start: var(--indent);
}
and
this.children[2].style.paddingInlineStart = `${this.view.getLevel(index)}em`;
It's difficult to choose which is worse. The base class for both should implement getLevel(), per prior art in nsITreeView, whether derived from the view's getLevel() for now (threadpane) or self calculated (folderpane). Latter is better, to get off nsITreeView.
Absent css attr(), the level should be added as a class to the node, which I believe is most performant, with indent rules like this:
:root {
--listbox-indent: 1em;
}
.level1 {
padding-inline-start: calc(var(--listbox-indent) * 1);
}
.level2 {
padding-inline-start: calc(var(--listbox-indent) * 2);
}
Speaking of perf, I tried this on a 100K+ row folder (m-c changelog feed). Select a row and render message takes 4 seconds; arrow key several rows results in a hang with the fan coming on. It is unusable.
Description
•