purebred-mua / purebred

A terminal based mail user agent based on notmuch
GNU Affero General Public License v3.0
139 stars 19 forks source link

RFC: decompose toggled/selected actions #471

Open frasertweedale opened 2 years ago

frasertweedale commented 2 years ago

Within the UI code, we have toggledOrSelectedItemHelper for several actions, including:

The helper has the following behaviour:

I propose that we "decompose" this action into separate actions/keybindings for "apply to toggled items" and "apply to current item". This decomposition would then enable a clean-up of the HasList and HasToggleableList classes and instances, providing for more ergonomic access and safer handling of items in toggleable lists. For example, we can avoid exposing the "toggled" state in traversals that targets toggled items.

It may also make some things in the UI less ambiguous as to what items a given operation shall be applied to.

Seeking your feedback @romanofski on this idea.

romanofski commented 2 years ago

Sounds good. The current state is a "make-it-work" implementation anyways. I guess it would also be useful due to the changes in Brick in the background?