-
Notifications
You must be signed in to change notification settings - Fork 2
feat: evals for react-native-apis #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
XeonBloomfield
merged 4 commits into
feat/lists-group-3
from
feat/react-native-apis-group
Mar 19, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
evals/react-native-apis/01-rn-stylesheet-card-variants/app/App.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import React from 'react' | ||
| import { Text, View } from 'react-native' | ||
|
|
||
| const CARDS = [ | ||
| { | ||
| id: 'card-1', | ||
| status: 'On schedule', | ||
| title: 'City route handoff', | ||
| }, | ||
| { | ||
| id: 'card-2', | ||
| highlighted: true, | ||
| status: 'Delayed', | ||
| title: 'Warehouse transfer', | ||
| }, | ||
| ] | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <View> | ||
| <Text>Status</Text> | ||
| {CARDS.map((card) => { | ||
| return ( | ||
| <View key={card.id}> | ||
| <Text>{card.title}</Text> | ||
| <Text>{card.status}</Text> | ||
| </View> | ||
| ) | ||
| })} | ||
| </View> | ||
| ) | ||
| } |
3 changes: 3 additions & 0 deletions
3
evals/react-native-apis/01-rn-stylesheet-card-variants/prompt.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Add styles for the two status cards: a normal card and a highlighted card. | ||
| The base card should use a light gray border. | ||
| The highlighted card should keep the same base styling and change the border to red. |
48 changes: 48 additions & 0 deletions
48
evals/react-native-apis/01-rn-stylesheet-card-variants/reference/App.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import React from 'react' | ||
| import { StyleSheet, Text, View } from 'react-native' | ||
|
|
||
| const CARDS = [ | ||
| { | ||
| id: 'card-1', | ||
| status: 'On schedule', | ||
| title: 'City route handoff', | ||
| }, | ||
| { | ||
| id: 'card-2', | ||
| highlighted: true, | ||
| status: 'Delayed', | ||
| title: 'Warehouse transfer', | ||
| }, | ||
| ] | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <View> | ||
| <Text>Status</Text> | ||
| {CARDS.map((card) => { | ||
| return ( | ||
| <View | ||
| key={card.id} | ||
| style={[styles.card, card.highlighted && styles.cardHighlighted]} | ||
| > | ||
| <Text>{card.title}</Text> | ||
| <Text>{card.status}</Text> | ||
| </View> | ||
| ) | ||
| })} | ||
| </View> | ||
| ) | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| card: { | ||
| backgroundColor: '#fff', | ||
| borderColor: '#cbd5e1', | ||
| borderWidth: 2, | ||
| borderRadius: 16, | ||
| padding: 16, | ||
| }, | ||
| cardHighlighted: { | ||
| borderColor: '#dc2626', | ||
| }, | ||
| }) |
11 changes: 11 additions & 0 deletions
11
evals/react-native-apis/01-rn-stylesheet-card-variants/requirements.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| version: 1 | ||
| inputs: | ||
| files: | ||
| - app/App.tsx | ||
| requirements: | ||
| - id: implementation-render-stylesheet-create | ||
| description: Must define styles with `StyleSheet.create(...)`. | ||
| - id: base-card-and-highlight-diff-style | ||
| description: Must define a base card style and a highlighted diff style instead of two full separate card styles. | ||
| - id: highlighted-style-conditionally-extends-base-card | ||
| description: Must conditionally extend the base card style for highlighted cards instead of using separate standalone card styles. |
48 changes: 48 additions & 0 deletions
48
evals/react-native-apis/02-rn-stylesheet-absolute-fill-overlay-badge/app/App.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| import React from 'react' | ||
| import { StyleSheet, Text, View } from 'react-native' | ||
|
|
||
| const CARD = { | ||
| title: 'Dispatch inbox', | ||
| } | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <View style={styles.screen}> | ||
| <Text style={styles.title}>Inbox</Text> | ||
| <View style={styles.card}> | ||
| <View style={styles.thumbnail} /> | ||
| <Text style={styles.cardTitle}>{CARD.title}</Text> | ||
| </View> | ||
| </View> | ||
| ) | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| card: { | ||
| backgroundColor: '#fff', | ||
| borderRadius: 18, | ||
| overflow: 'hidden', | ||
| }, | ||
| cardTitle: { | ||
| color: '#0f172a', | ||
| fontSize: 16, | ||
| fontWeight: '700', | ||
| padding: 14, | ||
| }, | ||
| screen: { | ||
| backgroundColor: '#f8fafc', | ||
| flex: 1, | ||
| justifyContent: 'center', | ||
| paddingHorizontal: 20, | ||
| }, | ||
| thumbnail: { | ||
| backgroundColor: '#cbd5e1', | ||
| height: 160, | ||
| }, | ||
| title: { | ||
| color: '#0f172a', | ||
| fontSize: 24, | ||
| fontWeight: '700', | ||
| marginBottom: 12, | ||
| }, | ||
| }) |
2 changes: 2 additions & 0 deletions
2
evals/react-native-apis/02-rn-stylesheet-absolute-fill-overlay-badge/prompt.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Add an overlay on top of the thumbnail card that says `Login required`. | ||
| The overlay should cover the thumbnail with a black background at 50% opacity. |
64 changes: 64 additions & 0 deletions
64
evals/react-native-apis/02-rn-stylesheet-absolute-fill-overlay-badge/reference/App.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import React from 'react' | ||
| import { StyleSheet, Text, View } from 'react-native' | ||
|
|
||
| const CARD = { | ||
| title: 'Dispatch inbox', | ||
| } | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <View style={styles.screen}> | ||
| <Text style={styles.title}>Inbox</Text> | ||
| <View style={styles.card}> | ||
| <View style={styles.thumbnail} /> | ||
| <View pointerEvents="none" style={styles.overlay}> | ||
| <Text style={styles.overlayText}>Login required</Text> | ||
| </View> | ||
| <Text style={styles.cardTitle}>{CARD.title}</Text> | ||
| </View> | ||
| </View> | ||
| ) | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| overlay: { | ||
| ...StyleSheet.absoluteFill, | ||
| alignItems: 'center', | ||
| backgroundColor: 'rgba(0, 0, 0, 0.5)', | ||
| borderTopLeftRadius: 18, | ||
| borderTopRightRadius: 18, | ||
| justifyContent: 'center', | ||
| }, | ||
| overlayText: { | ||
| color: '#fff', | ||
| fontSize: 16, | ||
| fontWeight: '700', | ||
| }, | ||
| card: { | ||
| backgroundColor: '#fff', | ||
| borderRadius: 18, | ||
| overflow: 'hidden', | ||
| }, | ||
| cardTitle: { | ||
| color: '#0f172a', | ||
| fontSize: 16, | ||
| fontWeight: '700', | ||
| padding: 14, | ||
| }, | ||
| screen: { | ||
| backgroundColor: '#f8fafc', | ||
| flex: 1, | ||
| justifyContent: 'center', | ||
| paddingHorizontal: 20, | ||
| }, | ||
| thumbnail: { | ||
| backgroundColor: '#cbd5e1', | ||
| height: 160, | ||
| }, | ||
| title: { | ||
| color: '#0f172a', | ||
| fontSize: 24, | ||
| fontWeight: '700', | ||
| marginBottom: 12, | ||
| }, | ||
| }) |
9 changes: 9 additions & 0 deletions
9
evals/react-native-apis/02-rn-stylesheet-absolute-fill-overlay-badge/requirements.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| version: 1 | ||
| inputs: | ||
| files: | ||
| - app/App.tsx | ||
| requirements: | ||
| - id: overlay-covers-thumbnail-with-stylesheet-helper | ||
| description: Must position the thumbnail overlay with `StyleSheet.absoluteFill`. | ||
| - id: overlay-background-color-rgba | ||
| description: Must have a background color of `rgba(0, 0, 0, 0.5)`. | ||
50 changes: 50 additions & 0 deletions
50
evals/react-native-apis/03-rn-stylesheet-divider-hairline/app/App.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import React from 'react' | ||
| import { StyleSheet, Text, View } from 'react-native' | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <View style={styles.screen}> | ||
| <Text style={styles.title}>Settings</Text> | ||
| <View style={styles.panel}> | ||
| <View style={styles.row}> | ||
| <Text style={styles.rowLabel}>Notifications</Text> | ||
| </View> | ||
| <View style={styles.row}> | ||
| <Text style={styles.rowLabel}>Theme</Text> | ||
| </View> | ||
| <View style={styles.row}> | ||
| <Text style={styles.rowLabel}>Privacy</Text> | ||
| </View> | ||
| </View> | ||
| </View> | ||
| ) | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| panel: { | ||
| backgroundColor: '#fff', | ||
| borderRadius: 16, | ||
| overflow: 'hidden', | ||
| }, | ||
| row: { | ||
| paddingHorizontal: 16, | ||
| paddingVertical: 16, | ||
| }, | ||
| rowLabel: { | ||
| color: '#0f172a', | ||
| fontSize: 16, | ||
| fontWeight: '600', | ||
| }, | ||
| screen: { | ||
| backgroundColor: '#f8fafc', | ||
| flex: 1, | ||
| justifyContent: 'center', | ||
| paddingHorizontal: 20, | ||
| }, | ||
| title: { | ||
| color: '#0f172a', | ||
| fontSize: 24, | ||
| fontWeight: '700', | ||
| marginBottom: 12, | ||
| }, | ||
| }) |
2 changes: 2 additions & 0 deletions
2
evals/react-native-apis/03-rn-stylesheet-divider-hairline/prompt.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Add a divider between each settings rows. | ||
| The divider should be a thin hairline separator and have black color. |
60 changes: 60 additions & 0 deletions
60
evals/react-native-apis/03-rn-stylesheet-divider-hairline/reference/App.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import React from 'react' | ||
| import { StyleSheet, Text, View } from 'react-native' | ||
|
|
||
| function Divider() { | ||
| return <View style={styles.divider} /> | ||
| } | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <View style={styles.screen}> | ||
| <Text style={styles.title}>Settings</Text> | ||
| <View style={styles.panel}> | ||
| <View style={styles.row}> | ||
| <Text style={styles.rowLabel}>Notifications</Text> | ||
| </View> | ||
| <Divider /> | ||
| <View style={styles.row}> | ||
| <Text style={styles.rowLabel}>Theme</Text> | ||
| </View> | ||
| <Divider /> | ||
| <View style={styles.row}> | ||
| <Text style={styles.rowLabel}>Privacy</Text> | ||
| </View> | ||
| </View> | ||
| </View> | ||
| ) | ||
| } | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| panel: { | ||
| backgroundColor: '#fff', | ||
| borderRadius: 16, | ||
| overflow: 'hidden', | ||
| }, | ||
| divider: { | ||
| backgroundColor: '#000', | ||
| height: StyleSheet.hairlineWidth, | ||
| }, | ||
| row: { | ||
| paddingHorizontal: 16, | ||
| paddingVertical: 16, | ||
| }, | ||
| rowLabel: { | ||
| color: '#0f172a', | ||
| fontSize: 16, | ||
| fontWeight: '600', | ||
| }, | ||
| screen: { | ||
| backgroundColor: '#f8fafc', | ||
| flex: 1, | ||
| justifyContent: 'center', | ||
| paddingHorizontal: 20, | ||
| }, | ||
| title: { | ||
| color: '#0f172a', | ||
| fontSize: 24, | ||
| fontWeight: '700', | ||
| marginBottom: 12, | ||
| }, | ||
| }) |
11 changes: 11 additions & 0 deletions
11
evals/react-native-apis/03-rn-stylesheet-divider-hairline/requirements.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| version: 1 | ||
| inputs: | ||
| files: | ||
| - app/App.tsx | ||
| requirements: | ||
| - id: reusable-divider-component-present | ||
| description: Must render a divider component between each row. | ||
| - id: divider-uses-hairline-width | ||
| description: Must use `StyleSheet.hairlineWidth` for the divider thickness. | ||
| - id: divider-color-light-gray | ||
| description: Must use backgroundColor for the divider color. |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could add "must not use deprecated StyleSheet.absoluteFillObject" (removed in 0.85 btw)