Skip to content

Conversation

@sshane
Copy link
Contributor

@sshane sshane commented Apr 3, 2025

  • unblock pull to refresh on Android (Chrome) and iOS (safari) (but not PWA)
  • add pull to refresh in iOS standalone PWA

@github-actions
Copy link

github-actions bot commented Apr 3, 2025

Changes:

path lines diff
./index.css 203 +2
./components/material/Drawer.tsx 70 +1

Total lines: 4524 (+3)

@github-actions
Copy link

github-actions bot commented Apr 3, 2025

deployed preview: https://459.connect-d5y.pages.dev

Welcome to connect! Make sure to:

  • read the contributing guidelines
  • mark your PR as a draft until it's ready to review
  • post the preview on Discord; feedback from users will speedup the PR review

Mobile

Desktop

@sshane sshane changed the title this? Fix no pull to refresh Apr 3, 2025
@greatgitsby
Copy link
Contributor

it works in the browser but not the PWA. seems intentional?

there should be a better way than installing a random package

@incognitojam
Copy link
Collaborator

Looks like we had a custom component for this in old connect - commaai/connect#249

I think they disable it on iOS PWA when you pick "standalone" to make it feel more like a native app

@incognitojam
Copy link
Collaborator

Trying this PR on iOS/Safari, if I drag the page down it does overscroll, but it doesn't trigger a refresh. It also breaks scrolling the page normally..

@incognitojam
Copy link
Collaborator

I think I narrowed down the fix for Android to just one change

@incognitojam
Copy link
Collaborator

incognitojam commented Apr 3, 2025

Hm we added that class to fix another bug on iOS (commaai/connect#18). We could fix that by just making the drawer opacity 0 when it's supposed to be hidden.

@sshane
Copy link
Contributor Author

sshane commented Apr 3, 2025

This is huge. First let's do the simplest thing on Android without regressing, then open another PR for iOS.

This is not splitting PRs up

@incognitojam incognitojam force-pushed the fix-pull-to-refresh branch 3 times, most recently from 6b43235 to ceaaee6 Compare April 3, 2025 22:14
@incognitojam incognitojam marked this pull request as ready for review April 3, 2025 22:17
Comment on lines +125 to +126
/* prevent horizontal scrolling, e.g. when drawer is open */
@apply overflow-x-hidden;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't notice this, what is it for?

Copy link
Collaborator

@incognitojam incognitojam Apr 3, 2025

Choose a reason for hiding this comment

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

You'd have to test the branch as it was in be22dc8. We have to clip the overflow horizontally because we have a couple of animations which translate the UI horizontally:

  • Opening the drawer slides it from left to right slightly, and the rest of the UI slides to the right
  • The route activity slides away to the right when you go back to the route list

Without this you can scroll the whole page horizontally.

@sshane sshane requested a review from Copilot April 3, 2025 22:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • src/index.css: Language not supported
Comments suppressed due to low confidence (1)

src/components/material/Drawer.tsx:52

  • The change in opacity from 0.5 to 0 when the drawer is closed could affect the overscroll behavior; please verify that this does not unintentionally block necessary visual cues for pull-to-refresh.
opacity: drawerVisible() ? 1 : 0,

Comment on lines +51 to +52
// Opacity should be 0 when drawer is closed, otherwise it can be visible when overscrolling
opacity: drawerVisible() ? 1 : 0,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is for the bug previously addressed in #18

@incognitojam incognitojam force-pushed the fix-pull-to-refresh branch from ceaaee6 to 38ff496 Compare April 4, 2025 00:13
@incognitojam
Copy link
Collaborator

incognitojam commented Apr 4, 2025

Even this change causes weirdness on iOS: when I open the drawer, if I swipe left I can scroll and see the dashboard again. I can't repro it on the deployed master. Not sure how not setting overflow-y-hidden causes that.

@incognitojam incognitojam linked an issue Apr 8, 2025 that may be closed by this pull request
@sshane
Copy link
Contributor Author

sshane commented Apr 9, 2025

Can we merge something simple that works on Android?

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.

Don't block pull to refresh gesture on mobile

4 participants