Closed Bug 1733887 Opened 3 years ago Closed 3 years ago

Make TreeViewListbox capable of handling nested rows

Categories

(Thunderbird :: General, enhancement)

enhancement

Tracking

(thunderbird_esr91 wontfix)

RESOLVED FIXED
95 Branch
Tracking Status
thunderbird_esr91 --- wontfix

People

(Reporter: darktrojan, Assigned: darktrojan)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

This turns out to be much easier than expected. nsITreeView has some very handy methods such as isContainerOpen and getParentIndex.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/7ccf28c07222
Make TreeViewListbox capable of handling nested rows. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED

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.

Target Milestone: --- → 95 Branch

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.

Regressions: 1865548
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: