You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0a40a7d
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,11 @@
12
12
- Review new or modified public APIs for visibility, naming, defaults, customizability, and extensibility.
13
13
- Ensure public APIs and exported types do not leak implementation details.
14
14
15
-
## Tests
15
+
## Dependencies
16
+
17
+
- For dependencies added for individual components, evaluate bundle size and platform impact. Prefer existing capabilities when they meet the requirements.
18
+
19
+
## Validation
16
20
17
21
- Call out missing tests when the changed behavior is risky.
22
+
- For visual changes, check before and after screenshots or videos for each affected platform and a nearby unaffected case.
- Avoid `React.Children`, `cloneElement`, and reading React elements directly unless there is a strong justification.
30
31
- Treat memoization as something that needs a reason: expensive calculation, stable identity requirement, or measured performance need.
31
32
- Check async effects for cancellation or race conditions when relevant.
32
-
- Check accessibility: labels, roles, focus order, keyboard interactions, disabled states, and loading states.
33
33
34
-
## Animations And Layout
34
+
## Component APIs and Styles
35
+
36
+
- Prefer existing native props or `style` over new props when they express the required behavior.
37
+
- Verify that components forward relevant native props and events without changing their meaning.
38
+
- Ensure controlled values have callbacks to update them. Support uncontrolled input when controlled rendering causes a demonstrated performance or reliability problem.
39
+
- Merge consumer styles after defaults for supported overrides. Check that computed styles preserve supplied padding, colors, dimensions, and other supported values.
40
+
- Expose test IDs for public interaction or content. Avoid IDs on internal wrappers solely for tests and default IDs that can collide across component instances.
41
+
42
+
## Design and Accessibility
43
+
44
+
- Compare component states, dimensions, icons, shapes, ripple effects, and disabled appearance with the Material Design specification.
45
+
- Use theme defaults and named tokens for colors, spacing, sizing, and motion where available. Check spacing against the design scale.
46
+
- Check labels, roles, focus order, and loading states. Verify keyboard, mouse, and touch interaction where applicable.
47
+
- Ensure disabled controls expose their state to assistive technology and prevent activation. Preserve appropriate focus when a control becomes unavailable after activation.
48
+
- Check that dismissing temporary UI restores focus to an appropriate element.
49
+
- Ensure visual changes do not make noninteractive content pressable.
50
+
51
+
## Platforms
52
+
53
+
- Check affected behavior on iOS, Android, and web, including positioning and interaction within scrolling containers and safe areas.
54
+
- Use direct `Platform.OS` checks or `Platform.select` so build tools can remove unused branches. Use `.native` files for native/web splits.
55
+
- Use CSS for web behavior it already supports instead of recreating it with JavaScript or layout measurements.
56
+
- Keep browser APIs and layout measurements out of server rendering. Verify that server output and the initial client render match.
57
+
58
+
## Animations and Layout
35
59
36
60
- Check for unnecessary layout shifts.
37
61
- Prefer animating only `transform` and `opacity` unless another property is required.
38
-
-For layout transitions, verify the approach handles rapid state changes, gestures, interruption, and cancellation.
62
+
-Verify that animations handle rapid state changes, gestures, interruption, and cancellation. Stale completion callbacks must not leave rendered state, focus, or component callbacks inconsistent.
39
63
- Check that duration and easing feel appropriate for the platform and interaction.
64
+
- Keep continuous gesture work off the JavaScript thread when responsiveness requires it, using Gesture Handler and Reanimated where appropriate.
65
+
- Measure dimensions near animation start when this provides current values and avoids extra state.
40
66
- Verify text and UI elements do not overlap or overflow at supported screen sizes.
- Check that tests verify public behavior, not implementation details.
7
+
- Check that tests verify public behavior, including rendered output, interaction, callbacks, and warnings. Flag assertions about private properties, context internals, or exact internal style values.
8
+
- Test internal helpers directly only when their logic is complex enough to justify separate coverage.
9
+
- Prefer accessibility queries, then test IDs for public interaction or content.
8
10
- Check that test titles describe user-facing behavior.
9
11
- Check coverage of happy paths, edge cases, and error states.
Copy file name to clipboardExpand all lines: docs/6.x/docs/guides/migration.md
+55-6Lines changed: 55 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,12 +71,61 @@ You can use the component's color prop where available, or override the correspo
71
71
72
72
### Test IDs
73
73
74
-
Some hardcoded and generated test IDs have been removed for the following components:
75
-
76
-
-`Appbar.Header`: `${testID}-root-layer`
77
-
-`Surface`: `surface` and `${testID}-outer-layer`
78
-
79
-
You can specify a `testID` explicitly and use that value to query the component.
74
+
Hardcoded default test IDs have been removed for the components listed below. Many of these components also derive test IDs for their internal parts by appending a suffix to the `testID` prop (e.g. `${testID}-container`). Since `testID` is no longer defaulted to a hardcoded value, none of these derived test IDs are set either unless you pass a `testID` explicitly — so all queries by the IDs below will stop matching:
0 commit comments