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

web UI not allowing panels to be resized #3059

Closed
devinrsmith opened this issue Nov 3, 2022 · 4 comments · Fixed by #3060
Closed

web UI not allowing panels to be resized #3059

devinrsmith opened this issue Nov 3, 2022 · 4 comments · Fixed by #3060
Assignees
Labels
bug Something isn't working release blocker A bug/behavior that puts is below the "good enough" threshold to release. triage web-client-ui The Web GUI
Milestone

Comments

@devinrsmith
Copy link
Member

PR #3049 seems to have broken my ability to resize panels in the web UI. web console logs showing "TouchEvent is not defined"

Easy to reproduce in main, ./gradlew server-jetty-app:run -Pgroovy, open web ui, create notebook if none open, try to resize.

May also be able to reproduce like:

docker pull ghcr.io/deephaven/server:edge
docker run --rm -p 10000:10000 ghcr.io/deephaven/server:edge
@devinrsmith devinrsmith added bug Something isn't working web-client-ui The Web GUI triage release blocker A bug/behavior that puts is below the "good enough" threshold to release. labels Nov 3, 2022
@devinrsmith devinrsmith added this to the Oct 2022 milestone Nov 3, 2022
@mofojed
Copy link
Member

mofojed commented Nov 3, 2022

Reproducible in FireFox 106.0.3, not reproducible in Chrome. Almost certainly caused by converting golden-layout to TS: deephaven/web-client-ui#796

Uncaught ReferenceError: TouchEvent is not defined
    _getCoordinates DragListener.ts:136
    onMouseDown DragListener.ts:66
    jQuery 2
DragListener.ts:136:6

@mofojed
Copy link
Member

mofojed commented Nov 3, 2022

Before conversion the _getCoordinates function was:

  _getCoordinates: function (event) {
    event =
      event.originalEvent && event.originalEvent.touches
        ? event.originalEvent.touches[0]
        : event;
    return {
      x: event.pageX,
      y: event.pageY,
    };
  },

After conversion, it is:

  _getCoordinates(event: JQuery.TriggeredEvent) {
    const baseEvent =
      event.originalEvent instanceof TouchEvent
        ? event.originalEvent.touches[0]
        : event;
    return {
      x: baseEvent.pageX,
      y: baseEvent.pageY,
    };
  }

According to caniuse, TouchEvent should be available in FireFox: https://caniuse.com/?search=touchevent
However, it looks like it's also not supported in Safari, so should rip it out anyway.

@mofojed
Copy link
Member

mofojed commented Nov 3, 2022

Seems like TouchEvent may only be defined on FireFox mobile: https://bugzilla.mozilla.org/show_bug.cgi?id=1693172
Either way it's not defined, we only use it in two places so just fix that.

As mentioned on https://developer.mozilla.org/en-US/docs/Web/API/Touch_events#example:

Touch events are typically available on devices with a touch screen, but many browsers make the touch events API unavailable on all desktop devices, even those with touch screens.

The reason for this is that some websites use the availability of parts of the touch events API as an indicator that the browser is running on a mobile device. If the touch events API is available, these websites will assume a mobile device and serve mobile-optimized content. This may then provide a poor experience for users of desktop devices that have touch screens.

@mofojed
Copy link
Member

mofojed commented Nov 3, 2022

PR for web-client-ui posted: deephaven/web-client-ui#868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release blocker A bug/behavior that puts is below the "good enough" threshold to release. triage web-client-ui The Web GUI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants