Skip to content

Comments

feat: allow tab swipes from any horizontal gesture#503

Open
vforsh wants to merge 3 commits intoDimillian:mainfrom
vforsh:feat/tab-swipes
Open

feat: allow tab swipes from any horizontal gesture#503
vforsh wants to merge 3 commits intoDimillian:mainfrom
vforsh:feat/tab-swipes

Conversation

@vforsh
Copy link
Contributor

@vforsh vforsh commented Feb 24, 2026

Summary

  • keep tab switching by swipe on phone layout
  • allow switching tabs from any horizontal swipe start point, not only from edge zones
  • keep behavior without sliding animations

Context

I have tried to do animated swipes several times but Codex failed me so I have decided to keep it as is.

Testing

  • npm run typecheck

@vforsh
Copy link
Contributor Author

vforsh commented Feb 24, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c9cf24b6f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2143 to +2145
const nextTab = resolveSwipeTabTarget(state, touch.clientX, touch.clientY);
if (nextTab) {
handleMainTabSelect(nextTab);

Choose a reason for hiding this comment

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

P1 Badge Avoid switching tabs from horizontal drags in scrollable content

Because handleAppTouchStart arms swipe detection for every single-touch gesture and handleAppTouchEnd immediately routes any qualifying horizontal drag to handleMainTabSelect, horizontal drags inside content areas now trigger tab changes instead of interacting with that content. On phone layouts this steals gestures from existing horizontally scrollable UI (for example message image rails and code blocks styled with overflow-x: auto in src/styles/messages.css), so users trying to pan those surfaces can be navigated away to another tab.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in cee8f62.

Changes:

  • Arm tab swipe only when touch starts near screen edges (24px zone).
  • Do not arm swipe when touch starts inside a horizontally scrollable ancestor.

This keeps horizontal pan behavior for code blocks/image rails while preserving edge tab-swipe navigation.

@Dimillian
Copy link
Owner

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cee8f62f66

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2154 to +2156
if (!isTouchWithinEdgeSwipeZone(touch.clientX, container.getBoundingClientRect())) {
edgeSwipeRef.current = null;
return;

Choose a reason for hiding this comment

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

P2 Badge Remove edge-only start check for global tab swipes

handleAppTouchStart still drops the swipe state unless the initial touch is within a 24px edge zone, so swipes that begin in the middle of the screen never reach handleAppTouchEnd and cannot change tabs. In practice, this keeps the old edge-only behavior and prevents the advertised “swipe from any horizontal gesture” flow on phones.

Useful? React with 👍 / 👎.

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