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

Add note field to progress window #533

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

abaevbog
Copy link
Contributor

@abaevbog abaevbog commented Feb 25, 2025

So one can add a child note to items that are being saved.

  • if client passes canUserAddNote flag in ping response, display a textarea note field above tag selector
  • the window will remain open if the focus is in the textarea, same as with tags
  • on blur, note content is passed to the client to save as a child note
  • Enter from the note field will add a new line. Shift-Enter can close the dialog.

Needs: zotero/zotero#5064
Fixes: #376

Brief demo: https://www.dropbox.com/scl/fi/k7jm6uc3t4syve2vs8z6a/connector_note_demo.mov?rlkey=3h91ujz6qzeyzyd72nsv50uyw&st=gyuac1x4

- if client passes canUserAddNote flag in ping response,
display a textarea note field above tag selector
- the window will remain open if the focus is in the
textarea, same as with tags
- on blur, note content is passed to the client to save
as a child note
- Enter from the note field will add a new line.
Shift-Enter can close the dialog.

Fixes: zotero#376
@abaevbog
Copy link
Contributor Author

The positioning of the textarea may need to be tweaked with a bit, especially with the tags autocomplete being added. We could only show the textarea if one presses a separate button, and keep it hidden otherwise - not sure.

@abaevbog abaevbog requested a review from adomasven February 26, 2025 00:05
@adomasven
Copy link
Member

This is good, but the textarea should either be more than 2 rows or auto-expand on focus/typing to at least 5 rows. Also your uploaded demo is inaccessible.

@abaevbog
Copy link
Contributor Author

the textarea should either be more than 2 rows or auto-expand on focus/typing to at least 5 rows.

I figured that we don't want to make the textarea too big because the iframe is fairly small. I suppose not everyone would be regularly adding notes like this, so it's good to keep it as compact as possible. That said, 2 lines is indeed quite tight. First I tried to expand it to 5 lines on focus, same way we do it in editable-text with multiline fields in itembox. But it means that on blur, the field can potentially shrink, resize of the iframe, and potentially make one mis-click a component they were not aiming for. So maybe auto-expanding is the best solution here? Now, the field will expand to have the same height as the scrollHeight up to 6em, which fits 5 lines. On blur, it remains as is, without causing any resizing jumpiness.

Screen.Recording.2025-02-25.at.10.54.46.PM.mov

Also your uploaded demo is inaccessible.

Sorry about that! I must've not copied some path params in the url, which still worked fine for me cause I was logged in. I updated the link in the first comment.

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

Successfully merging this pull request may close these issues.

Add note field to save popup
2 participants