-
Notifications
You must be signed in to change notification settings - Fork 807
GUACAMOLE-2178: Enhance inputMethod handling via cookie for easier text input on mobile devices #1135
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
base: main
Are you sure you want to change the base?
GUACAMOLE-2178: Enhance inputMethod handling via cookie for easier text input on mobile devices #1135
Conversation
|
@ferman-guzel Thanks for submitting this PR. Please change the title of the PR to include the I'm also going to defer to @mike-jumper on this review, particularly with regard to the introduction of Cookies - we spent some time and effort several years ago removing all of the cookies from Guacamole in favor of the |
necouchman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a glance it looks pretty straight-forward, and I don't have a lot of concerns other than getting Mike's input on the use of Cookies.
However, your code style needs to conform to the style used throughout the code. Mostly this means:
- Multi-line comments should be updated to match style used throughout the code.
- Indentation should follow the existing style (4 spaces per stop).
guacamole/src/main/frontend/src/app/settings/services/preferenceService.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/settings/services/preferenceService.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/settings/services/preferenceService.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/settings/services/preferenceService.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/settings/services/preferenceService.js
Outdated
Show resolved
Hide resolved
66685c0 to
fee2fe8
Compare
Let me add some background: We have a few users who are using tablets/phones to remote-access their systems and typically want to change a few settings quickly. Without keyboard it's hard to impossible to give them keyboard input, so the idea is to open a sane default without interaction. |
That's helpful, thanks. I'll let Mike comment on it. -Nick |
guacamole/src/main/frontend/src/app/settings/services/preferenceService.js
Outdated
Show resolved
Hide resolved
guacamole/src/main/frontend/src/app/settings/services/preferenceService.js
Outdated
Show resolved
Hide resolved
Enhances the preference service to read the `inputMethod` exclusively from a browser cookie (`GUAC_INPUT_METHOD`) instead of localStorage. This allows non-technical users accessing Guacamole via tablets or mobile devices to enter text with minimal effort, without needing a keyboard or swipe gestures
fee2fe8 to
1294cdb
Compare
corentin-soriano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m not sure how accurately this can be implemented, but it would be useful to detect whether the client is using a touchscreen. In that case only, we could automatically force the default input mode to keyboard/mouse if the user hasn’t explicitly selected one.
The administrator could also choose to enable or disable this behavior directly from the interface, without needing to add reverse-proxy rules or anything similar.
|
I definitely think we shouldn't rely on an externally set cookie to determine core behavior. The webapp should perform its own checks and decide on preference defaults. While we can't just look at whether touch events are supported (we need to support devices that have both a physical keyboard and a touch screen), there should be other mechanisms we can use to hint at better defaults. Other options:
|
|
@mike-jumper I'm not happy with cookies here myself, consider this as a functional prototype. The point is that we want to keep our end-users in charge of their devices, they know best what they want. But as they are low-tech, we give them a reasonable default bound to the device they interact with, plus an easy web interface to change this, while enabling them multi-device access (PC/mobile/tablet). Technical integration - which other options do we have? Is there a way for the webapp or guacd to forward settings from the connection_parameters table? A query parameter would also be straight-forward without storing something on the browser. |
Overview
This change improves the user experience for non-technical users accessing
Guacamole via tablets or mobile devices, particularly for VNC sessions.
Issue
JIRA: GUACAMOLE-2178
What changed
inputMethodpreference is now read exclusively from a browser cookie (GUAC_INPUT_METHOD)inputMethodgetCookie()is added to safely read cookie valuesWhy
By reading
inputMethodfrom a cookie, users can enter text withoutrequiring a keyboard or swipe gesture. In our environment, this cookie
is set when redirecting users to the Guacamole UI, making text input
more intuitive and low-effort.
This approach also centralizes control over
inputMethodand preventsuser-side overrides via localStorage.
Backward Compatibility
inputMethoddefaults toTEXTNotes / Testing