Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking trash while editing a notebook entry saves the notebook entry #7651

Open
7 tasks
davetsay opened this issue Mar 28, 2024 · 1 comment · May be fixed by #7991
Open
7 tasks

Clicking trash while editing a notebook entry saves the notebook entry #7651

davetsay opened this issue Mar 28, 2024 · 1 comment · May be fixed by #7991

Comments

@davetsay
Copy link
Contributor

davetsay commented Mar 28, 2024

Summary

Notebooks are being saved on blur, and the click isn't bubbling up (down?) to the trash icon, so clicking the trash button while editing just saves the notebook entry.
Edit: This is only happening on the latest notebook entry. On earlier entries clicking the trash icon prompts the user to confirm deletion of the entry.

Expected vs Current Behavior

Either the trash icon should be disabled or hidden when editing, or clicking the trash can should prompt user to delete the current entry as it does when not editing.

Workaround

Trash the entry after its saved

Steps to Reproduce

  1. create a notebook
  2. create a new entry
  3. click on the trash icon
  4. observe that the entry gets saved

Environment

  • Open MCT Version:
  • Deployment Type:
  • OS:
  • Browser:

Impact Check List

  • Data loss or misrepresented data?
  • Regression? Did this used to work or has it always been broken?
  • Is there a workaround available?
  • Does this impact a critical component?
  • Is this just a visual bug with no functional impact?
  • Does this block the execution of e2e tests?
  • Does this have an impact on Performance?

Additional Information

@johnriedel
Copy link
Contributor

Successfully reproduced error. Details below.

The notebook code has been updated with the following new behavior:

  1. When a notebook entry is in edit mode, the trashcan is not visible.
  2. A new "Escape" shortcut key has been implemented to back-out of entry creation/editing.
  3. A new "Control+Enter" shortcut key has been implemented to save an entry while focus is on the textarea.

Associated PR: #7991

Details:
The existing logic is that when focus is removed from the text area, the entry is automatically committed/saved. Therefore by clicking the trashcan icon, you're removing focus from the textarea which is why your entry is saving. The checkmark "save" button is just a dummy button that does nothing. So when you go to click that, just like with the trashcan button, focus is removed from the textarea and the content is auto-saved giving the appearance that clicking the checkmark button actually did something.

Based on my digging around, I suspect this auto-save behavior is based on an internal requirement (ie: folks didn't want to lose what they typed in an entry if they navigated away from the notebook without saving). So rather than disabling/removing auto-save, I instead decided to remove the trashcan icon when a notebook entry is in edit mode. So in order to cancel your editing, simply press the ESCAPE key and (1) a new entry will disappear, or (2) an existing entry will revert back to its previous value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants