Skip to content

GUACAMOLE-1740: Don't display clipboard contents in the clipboard editor until it is focused on.#796

Merged
jmuehlner merged 1 commit intoapache:masterfrom
aleitner:KCM-186-Hide-Clipboard-Contents-By-Default
Feb 27, 2023
Merged

GUACAMOLE-1740: Don't display clipboard contents in the clipboard editor until it is focused on.#796
jmuehlner merged 1 commit intoapache:masterfrom
aleitner:KCM-186-Hide-Clipboard-Contents-By-Default

Conversation

@aleitner
Copy link
Contributor

@aleitner aleitner commented Feb 22, 2023

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.

@aleitner aleitner changed the title KCM-186: Don't display clipboard contents in the clipboard editor until it is focused on. GUAC-XXXX: Don't display clipboard contents in the clipboard editor until it is focused on. Feb 22, 2023
@aleitner aleitner changed the title GUAC-XXXX: Don't display clipboard contents in the clipboard editor until it is focused on. GUACAMOLE-1740: Don't display clipboard contents in the clipboard editor until it is focused on. Feb 22, 2023
@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from d67e99b to 36f9afd Compare February 22, 2023 18:59
@jmuehlner
Copy link
Contributor

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 : '';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch 3 times, most recently from fabec83 to 1559de4 Compare February 22, 2023 21:38
});

// Update the prefocus clipboard editor message
guacTranslate('CLIENT.TEXT_CLIPBOARD_AWAITING_FOCUS', '').then(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...",
Copy link
Contributor

@jmuehlner jmuehlner Feb 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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.

@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch 2 times, most recently from 8a0f410 to 7e3e990 Compare February 24, 2023 17:41
@aleitner
Copy link
Contributor Author

aleitner commented Feb 24, 2023

Screenshot_20230224_125815

Screenshot_20230224_125832

Edited to remove branding from screenshots

@jmuehlner
Copy link
Contributor

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?

@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from 7e3e990 to 57ed1a9 Compare February 24, 2023 18:16
@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch 2 times, most recently from 7865795 to fe614eb Compare February 27, 2023 17:50
@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from fe614eb to 515c043 Compare February 27, 2023 18:25
@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from 515c043 to d6496eb Compare February 27, 2023 18:45
@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from d6496eb to 7124870 Compare February 27, 2023 18:51
@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from 7124870 to be6445e Compare February 27, 2023 20:20
@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from be6445e to 46b8145 Compare February 27, 2023 20:26
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from 46b8145 to dc3f786 Compare February 27, 2023 20:29
* determined from the HTML contents of the clipboard field.
*/
var updateClipboardData = function updateClipboardData() {
const updateClipboardData = function updateClipboardData() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from dc3f786 to 5458e6b Compare February 27, 2023 20:36
@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from 5458e6b to d7331e3 Compare February 27, 2023 21:09
@aleitner aleitner force-pushed the KCM-186-Hide-Clipboard-Contents-By-Default branch from d7331e3 to 2c15f3d Compare February 27, 2023 23:25
@jmuehlner jmuehlner merged commit 4308bc1 into apache:master Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants