1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-24 21:48:21 +01:00
phorge-phorge/src/infrastructure/diff
epriestley 1308a5555f Update client logic for inline comment "Save" and "Cancel" actions
Summary: Ref T13559. Substantially correct the client logic for "Save" and "Cancel" actions to handle unusual cases.

Test Plan:
Quoting behavior:

  - Quoted a comment.
  - Cancelled the quoted comment without modifying anything.
  - Reloaded page.
    - Before changes: quoted comment still exists.
    - After changes: quoted comment is deleted.
  - Looked at comment count in header, saw consistent behavior (before: weird behavior).

Empty suggestion behavior:

  - Created a new comment on a suggestable file.
  - Clicked "Suggest Edit" to enable suggestions.
  - Without making any text or suggestion changes, clicked "Save".
    - Before changes: comment saves, but is empty.
    - After changes: comment deletes itself without undo.

General behavior:

  - Created and saved an empty comment (deletes itself).
  - Created and saved a nonempty comment (saves as draft).
  - Created and saved an empty comment with an edit suggestion (saves).
  - Created and saved an empty comment with a suggestion to entirely delete lines -- that is, no suggestion text (saves).
  - Edited a comment, saved without changes (save).
  - Edited a comment, save deleting all text (saves -- note that this is intentionally without undo, since this is a lot of steps to do by accident).
  - Cancel editing an unchanged comment (cancels without undo).
  - Cancel editing a changed comment (cancels with undo).
    - Undo'd, got text back.
  - Cancel new comment with no text (deletes without undo).
  - Cancel new comment with text (deletes with undo).
    - Undo'd, got text back.
  - Saved a quoted comment with no changes (saves -- note that this is intentionally not a "delete", since just quoting someone seems fine if you click "Save" -- maybe you want to come back to it later).

Maniphest Tasks: T13559

Differential Revision: https://secure.phabricator.com/D21654
2021-03-29 09:00:27 -07:00
..
__tests__ Extract scope line selection logic from the diff rendering engine so it can reasonably be iterated on 2019-02-19 10:55:10 -08:00
engine Correct an apparent off-by-one error when adjusting inlines across revision changes 2020-08-05 13:12:53 -07:00
inline Put a readthrough cache in front of inline context construction 2020-05-20 14:28:37 -07:00
interface Formally track "initial", "committed", and "active" states for inline comments 2021-03-29 09:00:27 -07:00
prose Fix an issue where prose diffing may fail after hitting the PCRE backtracking limit 2020-07-23 07:46:15 -07:00
query Put a readthrough cache in front of inline context construction 2020-05-20 14:28:37 -07:00
view Formally track "initial", "committed", and "active" states for inline comments 2021-03-29 09:00:27 -07:00
viewstate Fix an issue where non-ID changeset state keys were used as changeset IDs 2020-05-04 16:05:05 -07:00
PhabricatorChangesetResponse.php Make "renderer", "engine", and "encoding" sticky across reloads in Differential and Diffusion 2020-04-19 08:59:09 -07:00
PhabricatorDifferenceEngine.php Continue moving classes with no callers in libphutil or Arcanist to Phabricator 2020-02-12 13:14:04 -08:00
PhabricatorDiffScopeEngine.php Make very minor generality improvements to the scope selector 2019-04-30 06:52:29 -07:00
PhabricatorInlineCommentController.php Update client logic for inline comment "Save" and "Cancel" actions 2021-03-29 09:00:27 -07:00