Page MenuHomePhabricator

Separate workboard view state (ordering, filtering, hidden columns) from the View controller

Authored by epriestley on Jun 29 2019, 10:11 PM.



Depends on D20627. Ref T4900. If a user orders a board by "Sort by Title", then toggles the visibility of hidden columns, we want to keep the board sorted by title. To accomplish this, we pass the board state around to all the workflows here.

Pull the "bag of state properties" code out of the View controller. This class basically:

  • reads state from a request (order, hidden, filter);
  • manages defaults;
  • provides the application with the current settings; and
  • generates URIs with "?order=X&hidden=Y&filter=Z" to preserve state.

This is still a little questionable/transitional since some of the controllers need more cleanup.

Test Plan

Toggled state, order, filters, clicked around various workflows and saw the filters preserved.

A lot of these workflows are pretty serious edge cases. For example, here's a feature this implements:

  • Changed workboard order to "Title".
  • Selected "Bulk Edit Tasks..." in an empty column and command-clicked it to open the link in a new window.
  • Hovered over "Cancel".
  • Saw the link properly generate with "?order=title", preserving the order.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

amckinley added inline comments.

I'm pretty sure this is now an unneeded repeat of line 49?


Shouldn't this be urisprintf('%s%p')?


This is just flirting with being enough duplicated code to factor out. Do you think we'll ever add more query params with almost-identical implementations? I can see this is a cut/paste from the old version, so maybe not worth messing with right now anyway.

This revision is now accepted and ready to land.Jul 2 2019, 6:26 PM

Yeah -- this gets (moderately) simpler later in the change sequence, at least.

I don't think we have more of this coming, but who knows what the future holds...


Oh, they're not always the same ($saved vs $state) and line 49 moves out of the controller somewhere down the line.

  • Use "%p" in urisprintf().