1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-12 08:36:13 +01:00
phorge-phorge/src/applications/project
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
..
__tests__ When moving cards on workboards, treat before/after cards as optional hints, not strict requirements 2019-03-26 07:45:24 -07:00
application Allow triggers to be attached to and removed from workboard columns 2019-03-25 13:21:26 -07:00
capability Add default View, Edit, and Join Policies to Projects 2014-11-21 11:22:17 -08:00
command Implement a "!projects" mail command 2015-04-01 11:51:51 -07:00
conduit Migrate Project color to modular transactions 2017-05-18 16:46:06 -07:00
config Support subtypes in Projects 2019-01-30 06:17:55 -08:00
constants Allow workboard background colors to be configured 2016-02-16 08:15:12 -08:00
controller When moving cards on workboards, treat before/after cards as optional hints, not strict requirements 2019-03-26 07:45:24 -07:00
customfield Fix errors found by PHPStan 2017-02-17 10:10:15 +00:00
edge Replace subscribe/unsubscribe for projects with explicit mail setting 2016-01-19 19:39:02 -08:00
editor Track how many columns use a particular trigger 2019-03-25 14:04:55 -07:00
engine When moving cards on workboards, treat before/after cards as optional hints, not strict requirements 2019-03-26 07:45:24 -07:00
engineextension Track how many columns use a particular trigger 2019-03-25 14:04:55 -07:00
events Property list view on Diffusion commits should show build status but not Subscriptions, Projects, or Tokens 2017-12-01 18:16:26 +00:00
exception Hard code a "close task" action on every column Trigger 2019-03-25 13:21:55 -07:00
herald Add "Committer's projects" and "Author's projects" fields to Herald commit rules 2018-02-27 14:33:12 -08:00
icon 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
interface Roughly implement milestone columns on workboards 2016-02-03 16:37:59 -08:00
lipsum Migrate Project status to modular transactions 2017-05-18 11:36:13 -07:00
mail phtize all the things 2015-05-22 21:16:39 +10:00
menuitem Prevent hiding the PhabricatorProjectDetailsProfileMenuItem 2017-12-23 11:38:05 -08:00
order Don't show workboard action previews if the action won't have any effect 2019-03-25 13:24:01 -07:00
phid Provide basic scaffolding for workboard column triggers 2019-03-25 13:13:58 -07:00
policyrule Add a "members of all projects" (vs "...any project") custom policy rule to the upstream 2018-06-12 11:51:51 -07:00
query Track how many columns use a particular trigger 2019-03-25 14:04:55 -07:00
remarkup Fix spelling 2017-10-09 10:48:04 -07:00
search Support Ferret engine in Projects 2017-09-07 13:24:23 -07:00
searchfield Fix a bad call when prefilling ApplicationSearch from ?projects=some_slug 2016-02-08 10:44:33 -08:00
storage Track how many columns use a particular trigger 2019-03-25 14:04:55 -07:00
trigger Add a "Play Sound" workboard trigger rule 2019-03-25 14:03:57 -07:00
typeahead Support subtypes in Projects 2019-01-30 06:17:55 -08:00
view Provide better UI feedback about cards that can't be dragged or edited 2019-03-12 13:43:46 -07:00
xaction Track how many columns use a particular trigger 2019-03-25 14:04:55 -07:00