Closed Bug 1958960 Opened 20 days ago Closed 19 days ago

Items in folder pane context menu shouldn't be hard-coded

Categories

(Thunderbird :: Mail Window Front End, defect)

Thunderbird 137
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: aliledudiable, Unassigned)

Details

With the recent reimplementation of multi-selection in the folder pane (bug 1817605), we now have, in mail/base/content/about3Pane.js , the functions:

  • updatePopupForMultiselection()
  • updatePopupForSingleSelection()

and they're problematic. They hard-code the set of items on the context menu, instead of iterating through some map, or table of these items. Or, better yet, using the mechanism of controllers and commands in a controller. In fact, I wonder if there isn't some redundancy / overlap with the functionality of the folderPaneContextMenu object, and its _commands field.

Why are the problematic? What are you trying to achieve?

(In reply to Magnus Melin [:mkmelin] from comment #1)

Why are the problematic?

Because chrome in Thunderbird (and Firefox) is defined declaratively - either fully so with XHTML, or partially, with controllers and other collections - so that when it is rendered or manipulated, the code doing so is more generic; and so that elements of the chrome can be altered in a straightforward, robust and concise manner.

What are you trying to achieve?

For example - adding an item to the context menu.

But even ignoring that, avoidance of redundancy and separating data from code - are already enough a motivation here.

Well, direct manipulation of the UI like that is not supported. If you're still doing it you can monkey patch those functions as you go.

Status: UNCONFIRMED → RESOLVED
Closed: 19 days ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.