Repository navigation
feat(mobile): swipe between the workspace and conversation lists - #673
Merged
Merged
Conversation
The list's two tabs were reachable only by tapping the segmented control. Page between them with a horizontal swipe on the list: left from workspaces into conversations, right back out of them. The drag is claimed only once it is clearly horizontal, so the vertical list keeps its own drags, and a direction with no page behind it is damped and never commits. Built on PanResponder/Animated (the app ships no gesture stack), the same pair ZoomableImage uses for its pinch; native gesture delivery still needs device validation. Swipes are ignored while the toolbar is searching or multi-selecting: the tab bar is hidden then, so the swipe would change mode unseen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The mobile list's two tabs (workspaces ⇄ conversations) were reachable only by tapping the segmented control. A horizontal swipe on the list now pages between them: left from workspaces into conversations, right back out of them (workspaces are the left page, conversations the right one — the order the tab control already shows).
How
mobile/src/screens/useTabSwipe.ts— a small PanResponder/Animated controller, the same pairZoomableImageuses (the app ships no gesture stack, and a swipe does not justify adding one):SessionListspreads the handlers and thetranslateXtransform on a new wrapper around theFlatList; the toolbar stays put, and the tabs themselves still switch on tap. The tab order is now oneTABSconstant used by both the tab control and the swipe.Swipes are ignored while the toolbar is searching or multi-selecting: the tab bar is hidden then, so a swipe would change mode unseen.
Tests
mobile/src/screens/__tests__/useTabSwipe.test.tscovers the claim/commit predicates and the controller (follows the finger, slides out, settles back, edge damping, cancel, disabled, re-configure).SessionList.test.tscovers the wiring: right from conversations → workspaces, left from workspaces → conversations, nothing behind either end, vertical drags stay with the list, and search/selection keep the tabs put.npm run typecheck,eslint .,jest --runInBand: 106 suites / 1481 tests green.Native gesture delivery (iOS/Android scroll-view touch delivery around a native
ScrollView) still needs a real-device pass — the automated tests drive the controller, not the OS touch stack.Docs:
docs/internals/mobile/README.md+.zh-CN.md(both languages).