GUACAMOLE-1740: Don't display clipboard contents in the clipboard editor until it is focused on.#796
Conversation
d67e99b to
36f9afd
Compare
|
Can you post a screenshot showing what this change would look like to a user? |
| // If the clipboard data is a string, render it as text | ||
| if (typeof data.data === 'string') | ||
| element.value = data.data; | ||
| element.value = (shouldDisplay) ? data.data : ''; |
There was a problem hiding this comment.
It looks like this just shows an empty clipboard until the user clicks on the clipboard element, and then the data pops in, yeah? It'd probably be lot more obvious to users if there was some sort of styling to indicate an inactive clipboard, and some indication to the user about what to do if they want to see the clipboard.
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
fabec83 to
1559de4
Compare
| }); | ||
|
|
||
| // Update the prefocus clipboard editor message | ||
| guacTranslate('CLIENT.TEXT_CLIPBOARD_AWAITING_FOCUS', '').then( |
There was a problem hiding this comment.
It might be a bit cleaner/easier to just do the translation in the template. That would also improve separation of concerns - the controller shouldn't have to care about what specific messages are being displayed to the user. All it should need to know is what the state of the clipboard is, exposing that state to the template which can then render different elements (with translated text in them) according to that state.
There was a problem hiding this comment.
Also, what if a user literally has the text "Focus here to view clipboard data..." in their clipboard?
Having some quick visual method to clearly identify that the clipboard is inactive would be nice. Rather than just sticking a message into the textarea - how about visually disabling (greying out, etc) the textarea and rendering a message in a different spot where it couldn't be confused with actual clipboard contents?
| "TEXT_USER_LEFT" : "{USERNAME} has left the connection.", | ||
| "TEXT_RECONNECT_COUNTDOWN" : "Reconnecting in {REMAINING} {REMAINING, plural, one{second} other{seconds}}...", | ||
| "TEXT_FILE_TRANSFER_PROGRESS" : "{PROGRESS} {UNIT, select, b{B} kb{KB} mb{MB} gb{GB} other{}}", | ||
| "TEXT_CLIPBOARD_AWAITING_FOCUS" : "Focus here to view clipboard data...", |
There was a problem hiding this comment.
"Focus" seems like an excessively technical term here: one that people not fluent in web technologies might not understand. If the required action is to click on the clipboard, it should probably just say that plainly.
8a0f410 to
7e3e990
Compare
|
That looks pretty good! It does look like that screenshot has a branding extension applied however - can you show what it looks like without the extension? |
7e3e990 to
57ed1a9
Compare
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
7865795 to
fe614eb
Compare
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
fe614eb to
515c043
Compare
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Show resolved
Hide resolved
515c043 to
d6496eb
Compare
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
d6496eb to
7124870
Compare
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/clipboard/templates/guacClipboard.html
Outdated
Show resolved
Hide resolved
7124870 to
be6445e
Compare
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
be6445e to
46b8145
Compare
| * user interface provided by this directive. | ||
| * user interface provided by this directive. We populate the clipboard | ||
| * editor via this DOM element rather than updating a model so that we | ||
| * have support for rich text contents. |
There was a problem hiding this comment.
I think we're getting a bit ahead of ourselves claiming that we "have support for rich text contents". Might want to clarify that this is to enable future support for this functionality, since we certainly don't have it now.
46b8145 to
dc3f786
Compare
| * determined from the HTML contents of the clipboard field. | ||
| */ | ||
| var updateClipboardData = function updateClipboardData() { | ||
| const updateClipboardData = function updateClipboardData() { |
There was a problem hiding this comment.
I'm a fan of using const over var for this sort of thing for sure - but since no actual changes were made to this function, we should just leave it unchanged as much as possible - to ensure clean git history. Same with the removal of line 105 below. Let's just leave things the way they were.
dc3f786 to
5458e6b
Compare
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
5458e6b to
d7331e3
Compare
guacamole/src/main/frontend/src/app/clipboard/directives/guacClipboard.js
Outdated
Show resolved
Hide resolved
…tor until it is focused on.
d7331e3 to
2c15f3d
Compare


When bringing up the Guacamole menu (Ctrl+Alt+Shift) the contents of your clipboard are immediately visible within the clipboard editor. For privacy purposes, the contents of the clipboard editor should be hidden/collapsed until the user chooses to expand/show them.
This Pull request updates the Clipboard Directive to prevent displaying clipboard data in the clipboard editor until the clipboard editor has been focused on.