bcgov / bcgov/foi-flow

'Delete' key not deleting when Comments Pane open

Open
#4,095 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
8
Forks
2
Avg merge
14h 34m
Merged PRs (30d)
46

Description

**Describe the bug in current situation**
When the Comments Pane is open in the redaction app, a user is unable to left-click once on a redaction or annotation in the working (middle) pane and use the 'Delete' key to delete redactions.

In order the delete redactions or annotations with the 'Delete' key, a user must left-click the redaction or annotation twice, then hit 'Delete' on their keyboard, in order to delete the redaction.

It appears this may be due to the 'Delete' key being tied to the open comment or reply text box in the Comments Pane when a redaction or annotation is selected. However, the delete key is not currently functioning in the reply or comment text box (i.e., you cannot use 'Delete' to delete text, you must use 'Backspace'). Therefore, the 'Delete' key should perform the action of deleting on the selected redaction/annotation in the middle (working) pane, rather than the Comments Pane.

**Link bug to the User Story**

**Impact of this bug**
Describe the impact, i.e. what the impact is, and number of users impacted.

Low

**Chance of Occurring (high/medium/low/very low)**

Medium

**Pre Conditions: which Env, any pre-requesites or assumptions to execute steps?**
TEST - EDU-2022-202020

**Steps to Reproduce**
Steps to reproduce the behavior:
1. Go to a request with records in the Records tab, and as an IAO user enter the redaction app through the Records tab
2. Add a redaction box to a page, including a FOIPPA section stamp
3. Open the Comments Pane and left-click the redaction box in the working (middle) pane to select the redaction box
4. Hit 'Delete' on keyboard
5. See error, where redaction box is not deleted.
6. Left-click the redaction box a second time
7. Hit 'Delete' on keyboard
8. Redaction box now is delete

**Actual/ observed behaviour/ results**

You must double left-click a redaction or annotation, then hit 'Delete' on keyboard, to delete a redaction or annotation using the 'Delete' key

**Expected behaviour**

GIVEN a user has made a redaction, and applied a section stamp
OR added any other annotation to a page
WHEN a user left-clicks the redaction or annotation once
AND hits 'Delete' on their keyboard
THEN the redaction or annotation should be deleted from the Comments Pane, and Redaction Panel (if applicable)

**Screenshots/ Visual Reference/ Source**

Redaction made, Comments Pane is open, left-clicked redaction once. Unable to use 'Delete' key to delete the redaction (as it appears it is tied / responding to the open comment textbox). See highlight where cursor has comment box selected.

![image](https://github.com/bcgov/foi-flow/assets/117312323/abc10999-da25-4edc-8b9d-39bd2249da2f)

Double left-clicked redaction box, cursor now deselects from comment text box (see highlight). Hit 'Delete' on keyboard and deletes redaction.

![image](https://github.com/bcgov/foi-flow/assets/117312323/f1c9dd97-dbd2-47c0-8669-2096deb9096b)

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the redaction app using the listed TEST environment and steps, with the Comments Pane open. Trace how a single click selects a redaction or annotation and how keyboard focus reaches the comment or reply box; done means one click followed by Delete removes the selected item and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.