Open Bug 1882042 Opened 2 years ago Updated 1 year ago

Deal with reviewer comments in D200242

Categories

(Thunderbird :: Folder and Message Lists, task)

task

Tracking

(Not tracked)

People

(Reporter: john, Unassigned, NeedInfo)

References

Details

Does this comment from Alessandro still require work?

Indeed, there's a little bit of messed up architecture in the about3Pane regarding this.
We have some instances in which we fetch the columns via ThreadPaneColumns.getDefaultColumns() and then we update that object with all the visible/hidden columns and store it inside the threadPane.columns.

These are all the instances in which we're making the object returned by getDefaultColumns() stale.
https://searchfox.org/comm-central/search?q=this.columns+%3D+&path=about3Pane.js&case=false&regexp=false

We should update this and ensure that the thread-pane-columns.mjs file always holds the source of truth of the currently visible and custom columns for the needed view.
Algon these lines we should also convert DBViewWrapper.jsm to a system module so we can more easily us it inside our modules.
Martin, what do you think?

Not sure if you want to do it or I could do it in a separate patch you can then rebase this off of.

Whenever a custom column is added, it also gets added to the DEFAULT_COLUMNS array. That array is never returned as a reference, but always as a clone, so each consumer gets its own fresh copy, which should always be the most recent known correct default state. The correct default state for custom columns is defined by the add-on it was added by.

We currently do not have different default data for the different view types (synthetic/folder) and if we want that, it needs to be defined by the add-on. Since we recently introduced the concept of a synthetic view to the WebExtension API, that would be possible now.

From my current understanding, the ThreadPaneColumns.mjs file does hold the source of truth of the currently visible and custom columns for the needed view (with respect to defaults).

Flags: needinfo?(martin)
Flags: needinfo?(alessandro)
You need to log in before you can comment on or make changes to this bug.