Repository navigation
refactor: example app - #5053
michalfedyna wants to merge 17 commits into
Conversation
MikitasK
left a comment
There was a problem hiding this comment.
looks awesome! good job 👍
just a few points to address before merge:
d553f1e to
803f2c7
Compare
803f2c7 to
d09e485
Compare
ab14dd0 to
a461e3e
Compare
JKobrynski
left a comment
There was a problem hiding this comment.
LGTM! @satya164 all yours
|
@michalfedyna the workflows are running, please resolve those comments that you've addressed to clean this PR up 🙏 |
|
@JKobrynski Thank you! |
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical navigation-state persistence issue and additional preference, layout, and accessibility issues.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Refactors the example app into a samples-first experience with searchable examples, stack navigation, and modal preferences.
Changes:
- Adds eight focused sample screens and a samples catalog.
- Replaces drawer navigation and preferences with stack navigation and a modal.
- Adds example search, preference state management, and typed object utilities.
Review findings:
- Critical (3 votes): Version or validate persisted navigation state after the navigator migration.
- Moderate (3 votes): Reset must restore the initial RTL setting.
- Moderate (2 votes): Keep the preferences action available while searching.
- Moderate (1 vote): Move
Dialog.ActionsoutsideDialog.Content. - Moderate (1 vote): Add accessible, row-specific labels to order checkboxes.
File summaries
| File | Description |
|---|---|
example/utils/typedObject.ts |
Adds typed object helpers. |
example/utils/index.ts |
Removes the obsolete web helper. |
example/src/SamplesList.tsx |
Adds the samples catalog. |
example/src/Samples/WorkspaceSample.tsx |
Adds the workspace sample. |
example/src/Samples/types.ts |
Defines sample metadata. |
example/src/Samples/SignUpSample.tsx |
Adds the sign-up sample. |
example/src/Samples/SettingsSample.tsx |
Adds the settings sample. |
example/src/Samples/PlayerSample.tsx |
Adds the player sample. |
example/src/Samples/OrdersSample.tsx |
Adds the orders sample; checkbox labels require accessibility updates. |
example/src/Samples/HelpCenterSample.tsx |
Adds the help center sample. |
example/src/Samples/ContactsSample.tsx |
Adds the contacts sample. |
example/src/Samples/ArticleSample.tsx |
Adds the article sample. |
example/src/RootNavigator.tsx |
Configures sample and example routes. |
example/src/Preferences/useSetupPreferences.ts |
Centralizes preference persistence; navigation-state migration and RTL reset require fixes. |
example/src/Preferences/usePreferences.tsx |
Adds the preferences hook. |
example/src/Preferences/PreferencesModal.tsx |
Adds the preferences modal; dialog actions need to be moved outside content. |
example/src/Preferences/PreferencesContext.tsx |
Updates the preferences context type. |
example/src/index.tsx |
Integrates navigation and preferences setup. |
example/src/Examples/TooltipExample.tsx |
Updates platform detection. |
example/src/Examples/SnackbarExample.tsx |
Uses the preferences hook. |
example/src/Examples/SearchbarExample.tsx |
Replaces drawer access with preferences access. |
example/src/Examples/CardExample.tsx |
Uses the preferences hook and platform API. |
example/src/ExampleListHeader.tsx |
Adds searchable example controls; the preferences action must remain persistent. |
example/src/ExampleList.tsx |
Adds example filtering and empty-state handling. |
example/src/DrawerItems.tsx |
Removes the legacy drawer implementation. |
Review details
Suppressed comments (2)
example/src/Preferences/PreferencesModal.tsx:164
Dialog.Actionsis nested insideDialog.Content, but Paper's dialog API expects these to be sibling children. This applies the content padding around the actions and the actions container padding again, producing incorrect spacing. Move the</Dialog.Content>before<Dialog.Actions>.
<Dialog.Actions>
<Button onPress={_handleDismissRTLDialog}>Ok</Button>
</Dialog.Actions>
</Dialog.Content>
example/src/Samples/OrdersSample.tsx:122
- Each row renders a bare checkbox without an accessible label, so assistive technology exposes multiple indistinguishable checkbox controls and users cannot tell which order they are selecting. Add a row-specific label such as
Select order ${order.id}.
<Checkbox
status={selected.includes(order.id) ? 'checked' : 'unchecked'}
onPress={() => toggleSelected(order.id)}
/>
- Files reviewed: 25/25 changed files
- Comments generated: 3
- Review effort level: Lite (auto)
Note
Copilot is running an experiment and ran this review at Lite.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Review by Claude Web
|
satya164
left a comment
There was a problem hiding this comment.
Review by Claude
- This branch conflicts with
main, and some APIs it uses changed there. After the rebase:SearchbarrenamedtraileringIcon,traileringIconAccessibilityLabelandonTraileringIconPresstotrailingIcon,trailingIconAccessibilityLabelandonTrailingIconPress(#5117, used inExampleListHeader.tsx).ModalrenamedoverlayAccessibilityLabeltodismissAccessibilityLabeland now needs anaria-label(#5125, used inPreferencesModal.tsxandHelpCenterSample.tsx).Dialogrenders its ownPortalnow, so thePortalwrappers inPreferencesModal.tsxandSettingsSample.tsxcan go. @react-navigation/draweris still inexample/package.json, but nothing in the example imports it after this change. Remove it.
See the inline comments for the rest. (via Claude, verify if it makes sense)
| {item.components.map((component) => ( | ||
| <Chip key={component} compact> | ||
| {component} | ||
| </Chip> | ||
| ))} |
There was a problem hiding this comment.
These tags are Chips without onPress, so each one is still a button for screen readers. On Android TalkBack announces every tag as a disabled button (6 to 8 per card), and iOS and web also expose them as buttons. The card itself, which is the real control, has no button role on any platform. Render the tags as plain Text (or another non-pressable element) so only the card is interactive. Giving the card a button role may need a change in Card, because Card passes role to its outer Surface and not to the inner Pressable. (via Claude, verify if it makes sense)
There was a problem hiding this comment.
Tags are now plain Text with a border, so screen readers no longer announce them as buttons; only the card is interactive. The card’s own button role is covered by callstack/react-native-paper#5116: it routes role and the accessibility props to the actionable target and defaults to button when the Card has a press handler, so I’ll pick that up here once it lands rather than duplicating it.
|
/review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 2 new findings on a0ec761. The verdict and the full list are in the summary comment.
|
/review |
Apex Sentinel · ✅ Approve · review of
|
| Where | Finding |
|---|---|
example/src/Preferences/useSetupPreferences.ts:110 |
Reset leaves RTL mode on and re-persists the preferences it just cleared |
Not in the reviewers' prompt (1 file)
yarn.lock: generated or a lockfile, so its lines were left out
1 finding below minor hidden (user_settings.min_severity).
Reviewed with this repository's own Sentinel configuration (b354fa9b5977).
💬 Talking to Sentinel
In a finding's thread, reply with:
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
There was a problem hiding this comment.
Apex Sentinel: 1 finding moved to a new line on c535297. The verdict and the full list are in the summary comment.
# Conflicts: # example/src/DrawerItems.tsx


Motivation
PR improves example app. It adds:
Related issue
#4992
Test plan
yarn lint,yarn typecheck,yarn testand a visual check of provided screenshots