1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-10-24 01:28:52 +02:00
phorge-phorge/webroot/rsrc/js/application/projects
epriestley 6138e50962 When moving cards on workboards, treat before/after cards as optional hints, not strict requirements
Summary:
Depends on D20320. Ref T12175. Ref T13074. Currently, when you move a card between columns, the internal transaction takes exactly one `afterPHID` or `beforePHID` and moves the card before or after the specified card.

This is a fairly strict interpretation and causes a number of practical issues, mostly because the user/client view of the board may be out of date and the card they're dragging before or after may no longer exist: another user might have moved or hidden it between the last client update and the current time.

In T13074, we also run into a more subtle issue where a card that incorrectly appears in multiple columns fatals when dropped before or after itself.

In all cases, a better behavior is just to complete the move and accept that the position may not end up exactly like the user specified. We could prompt the user instead:

> You tried to drop this card after card X, but that card has moved since you last loaded the board. Reload the board and try again.

...but this is pretty hostile and probably rarely/never what the user wants.

Instead, accept a list of before/after PHIDs and just try them until we find one that works, or accept a default position if none work. In essentially all cases, this means that the move "just works" like users expect it to instead of fataling in a confusing/disruptive/undesirable (but "technically correct") way.

(A followup will make the client JS send more beforePHIDs/afterPHIDs so this works more often.)

We could eventually add a "strict" mode in the API or something if there's some bot/API use case for precise behavior here, but I suspect none exist today or are (ever?) likely to exist in the future.

Test Plan:
  - (T13074) Inserted two conflicting rows to put a card on two columns on the same board. Dropped one version of it underneath the other version. Before: confusing fatal. After: cards merge sensibly into one consistent card.
  - (T12175) Opened two views of a board. Moved card A to a different column on the first view. On the second view, dropped card B under card A (still showing in the old column). Before: confusing fatal. After: card ended up in the right column in approximately the right place, very reasonably.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13074, T12175

Differential Revision: https://secure.phabricator.com/D20321
2019-03-26 07:45:24 -07:00
..
behavior-project-boards.js Add a "Play Sound" workboard trigger rule 2019-03-25 14:03:57 -07:00
behavior-project-create.js Allow commits to be associated with projects and associated goodies 2012-08-08 10:03:41 -07:00
behavior-reorder-columns.js Allow the workboard backlog column to be reordered 2014-08-08 15:50:36 -07:00
WorkboardBoard.js When moving cards on workboards, treat before/after cards as optional hints, not strict requirements 2019-03-26 07:45:24 -07:00
WorkboardCard.js Modularize workboard column orders 2019-03-12 13:07:50 -07:00
WorkboardCardTemplate.js Modularize workboard column orders 2019-03-12 13:07:50 -07:00
WorkboardColumn.js When users hover over a column trigger menu, show a "preview" with the rules instead of a tooltip 2019-03-25 14:02:10 -07:00
WorkboardController.js On workboards, provide all of the supported "create task" forms in the dropdown 2017-03-02 04:24:40 -08:00
WorkboardDropEffect.js When users hover over a column trigger menu, show a "preview" with the rules instead of a tooltip 2019-03-25 14:02:10 -07:00
WorkboardHeader.js Modularize workboard column orders 2019-03-12 13:07:50 -07:00
WorkboardHeaderTemplate.js Preview the effects of a drag-and-drop operation on workboards 2019-03-25 13:22:56 -07:00
WorkboardOrderTemplate.js Add an "Sort by Creation Date" filter to workboards and modularize remaining order behaviors 2019-03-12 13:46:49 -07:00