Skip to content

chore(test): new screen and scenario for specialEffects: scrollToTop prop#3934

Merged
LKuchno merged 16 commits intomainfrom
@lkuchno/test-tabs-switching_screen
Apr 29, 2026
Merged

chore(test): new screen and scenario for specialEffects: scrollToTop prop#3934
LKuchno merged 16 commits intomainfrom
@lkuchno/test-tabs-switching_screen

Conversation

@LKuchno
Copy link
Copy Markdown
Collaborator

@LKuchno LKuchno commented Apr 24, 2026

Description

Adds a test scenario for the specialEffects.repeatedTabSelection.scrollToTop property on tab routes. The scenario uses three tabs with a scrollable list each, covering all meaningful states of the property: explicitly enabled, explicitly disabled, and absent (default platform behavior).

The scenario also validates that scrollToTop only triggers on a repeated tap of the already-active tab - switching away and back must preserve scroll position.

Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1154

Changes

test-tabs-special-effects/index.tsx
New test screen component with three tabs sharing a single ScrollScreen component.

test-tabs-special-effects/scenario.md
Manual test scenario with four sections: scrollToTop: true, scrollToTop: false, no specialEffects (default), and a switching-away-and-back case that verifies scroll position is preserved on non-repeated tab navigation.

single-feature-tests/tabs/index.ts
Registered TestTabsSpecialEffects in the tabs scenario group so the screen is reachable from the test navigator.

Test demo

Screen.Recording.2026-04-28.at.16.23.33.mov

@LKuchno LKuchno requested review from Copilot and kligarski April 24, 2026 05:40
@LKuchno LKuchno added area:tabs Issue related to bottom tabs type:chore A general maintenance task, that does not fall into other categories. labels Apr 24, 2026
Copy link
Copy Markdown
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.

Pull request overview

Adds a new manual test scenario and corresponding test screen to validate specialEffects.repeatedTabSelection.scrollToTop behavior on tab routes, including repeated-tap vs switching-tabs behavior.

Changes:

  • Added a new tabs test screen with 3 tabs covering scrollToTop: true, false, and default (unset).
  • Added a manual test scenario describing expected scroll-to-top behavior for each tab configuration.
  • Registered the new scenario in the Tabs single-feature-tests group.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/scenario.md New manual scenario for repeated-tab selection scroll-to-top behavior.
apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/index.tsx New test screen implementing 3-tab configuration for the scenario.
apps/src/tests/single-feature-tests/tabs/index.ts Registers the new scenario so it’s reachable from the navigator.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5 to +6
**Description:** This test scenario validates the `specialEffects.repeatedTabSelection.
scrollToTop` property on tab routes. It verifies that re-tapping an already-active
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

The inline code span for the tested property is broken across a newline (specialEffects.repeatedTabSelection. scrollToTop), which renders awkwardly in Markdown. Keep the property path within a single code span for readability.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

tab scrolls a scrollable screen back to the top when the property is enabled, and
that there is no scroll-to-top behavior when it is disabled or absent.

**OS test creation version:** iOS: 18.4 and 26.2 Android: 16.0 (Baklava).
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

OS test creation version line is missing a comma separator between iOS and Android ("... 26.2 Android ..."). This looks like a typo; align with the existing format used in other scenarios (e.g., "iOS: …, Android: …").

Suggested change
**OS test creation version:** iOS: 18.4 and 26.2 Android: 16.0 (Baklava).
**OS test creation version:** iOS: 18.4 and 26.2, Android: 16.0 (Baklava).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Comment thread apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/index.tsx Outdated
Comment thread apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/index.tsx Outdated
Comment thread apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/index.tsx Outdated
Copy link
Copy Markdown
Contributor

@kligarski kligarski left a comment

Choose a reason for hiding this comment

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

Looks good but I have some comments.

It would also be nice to have some videos with the test in PR description.

Comment thread apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/index.tsx Outdated
Comment thread apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/index.tsx Outdated
Comment thread apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/index.tsx Outdated
Comment thread apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/scenario.md Outdated
LKuchno and others added 6 commits April 27, 2026 12:03
…ects/index.tsx

Co-authored-by: Krzysztof Ligarski <63918941+kligarski@users.noreply.github.com>
…ware-mansion/react-native-screens into @lkuchno/test-tabs-switching_screen
Copy link
Copy Markdown
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

Left a single remark.

platforms: ['ios', 'android'],
};

function ScrollScreen() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be exported, right @sgaczol?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Confirmed with @sgaczol and added in a9b64e3

Comment thread apps/src/tests/single-feature-tests/tabs/test-tabs-special-effects/index.tsx Outdated
@LKuchno LKuchno requested a review from kligarski April 29, 2026 06:17
Copy link
Copy Markdown
Contributor

@kligarski kligarski left a comment

Choose a reason for hiding this comment

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

Thanks!

@kligarski kligarski changed the title chore(test): new screen and scenario for specialEffects: scrolToTop prop chore(test): new screen and scenario for specialEffects: scrollToTop prop Apr 29, 2026
@LKuchno LKuchno merged commit ec0ea94 into main Apr 29, 2026
5 of 6 checks passed
@LKuchno LKuchno deleted the @lkuchno/test-tabs-switching_screen branch April 29, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:tabs Issue related to bottom tabs type:chore A general maintenance task, that does not fall into other categories.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants