Skip to content

Conversation

@lucas-zimerman
Copy link
Collaborator

@lucas-zimerman lucas-zimerman commented Jul 4, 2025

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Previous app had buttons with different sizes and also no scroll, making it hard to select items on the bottom.
This pr adds a scrollview and also makes all buttons the same size

image

💡 Motivation and Context

💚 How did you test it?

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

#skip-changelog.

@lucas-zimerman lucas-zimerman marked this pull request as ready for review July 4, 2025 17:23
@lucas-zimerman lucas-zimerman requested a review from antonis as a code owner July 4, 2025 17:23
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2025

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1213.56 ms 1235.61 ms 22.05 ms
Size 2.63 MiB 3.81 MiB 1.17 MiB

Baseline results on branch: v7

Startup times

Revision Plain With Sentry Diff
f870f2d+dirty 1227.18 ms 1232.30 ms 5.12 ms
472960b+dirty 1213.96 ms 1222.58 ms 8.62 ms
fb47c4a+dirty 1231.00 ms 1231.33 ms 0.33 ms
7eff2d7+dirty 1225.34 ms 1234.53 ms 9.19 ms
3c99746+dirty 1215.12 ms 1222.31 ms 7.18 ms

App size

Revision Plain With Sentry Diff
f870f2d+dirty 2.63 MiB 3.79 MiB 1.15 MiB
472960b+dirty 2.63 MiB 3.79 MiB 1.15 MiB
fb47c4a+dirty 2.63 MiB 3.80 MiB 1.17 MiB
7eff2d7+dirty 2.63 MiB 3.79 MiB 1.16 MiB
3c99746+dirty 2.63 MiB 3.78 MiB 1.15 MiB

Previous results on branch: lz/v7/up-expo-ui

Startup times

Revision Plain With Sentry Diff
daf6f1a+dirty 1232.00 ms 1239.08 ms 7.08 ms

App size

Revision Plain With Sentry Diff
daf6f1a+dirty 2.63 MiB 3.80 MiB 1.17 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2025

Android (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 384.06 ms 385.16 ms 1.10 ms
Size 7.15 MiB 8.35 MiB 1.20 MiB

Baseline results on branch: v7

Startup times

Revision Plain With Sentry Diff
f870f2d+dirty 398.49 ms 434.24 ms 35.75 ms
fb47c4a+dirty 408.58 ms 407.17 ms -1.41 ms
472960b+dirty 394.39 ms 376.18 ms -18.20 ms
7eff2d7+dirty 393.13 ms 426.77 ms 33.65 ms
3c99746+dirty 400.65 ms 399.59 ms -1.06 ms

App size

Revision Plain With Sentry Diff
f870f2d+dirty 7.15 MiB 8.34 MiB 1.18 MiB
fb47c4a+dirty 7.15 MiB 8.35 MiB 1.20 MiB
472960b+dirty 7.15 MiB 8.34 MiB 1.18 MiB
7eff2d7+dirty 7.15 MiB 8.35 MiB 1.20 MiB
3c99746+dirty 7.15 MiB 8.34 MiB 1.18 MiB

Previous results on branch: lz/v7/up-expo-ui

Startup times

Revision Plain With Sentry Diff
daf6f1a+dirty 380.60 ms 401.77 ms 21.17 ms

App size

Revision Plain With Sentry Diff
daf6f1a+dirty 7.15 MiB 8.35 MiB 1.20 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2025

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1226.65 ms 1231.02 ms 4.37 ms
Size 3.19 MiB 4.37 MiB 1.18 MiB

Baseline results on branch: v7

Startup times

Revision Plain With Sentry Diff
f870f2d+dirty 1230.08 ms 1238.88 ms 8.80 ms
472960b+dirty 1243.67 ms 1233.57 ms -10.11 ms
fb47c4a+dirty 1243.40 ms 1245.86 ms 2.46 ms
7eff2d7+dirty 1224.84 ms 1227.94 ms 3.10 ms
3c99746+dirty 1227.65 ms 1228.81 ms 1.16 ms

App size

Revision Plain With Sentry Diff
f870f2d+dirty 3.19 MiB 4.36 MiB 1.17 MiB
472960b+dirty 3.19 MiB 4.36 MiB 1.17 MiB
fb47c4a+dirty 3.19 MiB 4.37 MiB 1.18 MiB
7eff2d7+dirty 3.19 MiB 4.36 MiB 1.17 MiB
3c99746+dirty 3.19 MiB 4.35 MiB 1.16 MiB

Previous results on branch: lz/v7/up-expo-ui

Startup times

Revision Plain With Sentry Diff
daf6f1a+dirty 1224.96 ms 1219.49 ms -5.47 ms

App size

Revision Plain With Sentry Diff
daf6f1a+dirty 3.19 MiB 4.37 MiB 1.18 MiB

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2025

Android (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 389.10 ms 389.14 ms 0.04 ms
Size 17.75 MiB 19.60 MiB 1.85 MiB

Baseline results on branch: v7

Startup times

Revision Plain With Sentry Diff
fb47c4a 435.33 ms 434.94 ms -0.40 ms
472960b 418.84 ms 405.38 ms -13.46 ms
7eff2d7 420.64 ms 401.86 ms -18.78 ms
3c99746 399.51 ms 429.09 ms 29.58 ms
f870f2d 444.67 ms 449.62 ms 4.95 ms

App size

Revision Plain With Sentry Diff
fb47c4a 17.75 MiB 19.60 MiB 1.85 MiB
472960b 17.75 MiB 19.58 MiB 1.83 MiB
7eff2d7 17.75 MiB 19.60 MiB 1.85 MiB
3c99746 17.75 MiB 19.58 MiB 1.83 MiB
f870f2d 17.75 MiB 19.58 MiB 1.83 MiB

Previous results on branch: lz/v7/up-expo-ui

Startup times

Revision Plain With Sentry Diff
daf6f1a 417.50 ms 410.12 ms -7.38 ms

App size

Revision Plain With Sentry Diff
daf6f1a 17.75 MiB 19.60 MiB 1.85 MiB

Copy link
Contributor

@antonis antonis left a comment

Choose a reason for hiding this comment

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

Thank you for improving the sample app @lucas-zimerman 🙇
The changes LGTM 🎸

NIT Suggestion: I was thinking that we could wrap everything in a scrollview so that the scroll indicator moves at the edge. Wdyt?

Current Full scrollview
Screenshot_20250707_124620 Screenshot_20250707_125600
suggested index.tsx
import { Button, ScrollView, StyleSheet } from 'react-native';
import * as Sentry from '@sentry/react-native';
import { reloadAppAsync, isRunningInExpoGo } from 'expo';
import * as DevClient from 'expo-dev-client';

import { Text, View } from '@/components/Themed';
import { setScopeProperties } from '@/utils/setScopeProperties';
import React from 'react';
import * as WebBrowser from 'expo-web-browser';
import { useUpdates } from 'expo-updates';
import { isWeb } from '../../utils/isWeb';

export default function TabOneScreen() {
  const { currentlyRunning } = useUpdates();
  return (
    <ScrollView>
      <View style={styles.container}>
        <Sentry.TimeToInitialDisplay record />

        <Text>Welcome to Sentry Expo Sample App!</Text>
        <Text>Update ID: {currentlyRunning.updateId}</Text>
        <Text>Channel: {currentlyRunning.channel}</Text>
        <Text>Runtime Version: {currentlyRunning.runtimeVersion}</Text>

        <View style={styles.buttonWrapper}>
          <Button
            title="Open DevMenu"
            onPress={() => {
              DevClient.openMenu();
            }}
            disabled={isWeb()}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Capture message"
            onPress={() => {
              Sentry.captureMessage('Captured message');
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Capture exception"
            onPress={() => {
              Sentry.captureException(new Error('Captured exception'));
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Capture exception with cause"
            onPress={() => {
              const error = new Error('Captured exception');
              error.cause = new Error('Cause of captured exception');
              Sentry.captureException(error);
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Uncaught Thrown Error"
            onPress={() => {
              throw new Error('Uncaught Thrown Error');
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Unhandled Promise Rejection"
            onPress={() => {
              // TODO: No working in Expo Go App
              Promise.reject(new Error('Unhandled Promise Rejection'));
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Native Crash"
            onPress={() => {
              if (isRunningInExpoGo()) {
                console.warn('Not supported in Expo Go. Build the application to test this feature.');
                return;
              }
              Sentry.nativeCrash();
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Show feedback form"
            onPress={() => {
              Sentry.showFeedbackWidget();
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Show feedback button"
            onPress={() => {
              Sentry.showFeedbackButton();
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Set Scope Properties"
            onPress={() => {
              setScopeProperties();
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="console.warn()"
            onPress={() => {
              console.warn('This is a warning.');
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Flush"
            onPress={async () => {
              await Sentry.flush();
              console.log('Sentry.flush() completed.');
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Close"
            onPress={async () => {
              await Sentry.close();
              console.log('Sentry.close() completed.');
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button title="Reload" onPress={() => reloadAppAsync()} />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Open WebBrowser"
            onPress={() => {
              WebBrowser.openBrowserAsync('https://sentry.io');
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Set different types of tags globally"
            onPress={async () => {
              Sentry.setTags({
                number: 123,
                boolean: true,
                null: null,
                undefined: undefined,
                symbol: Symbol('symbol'),
                string: 'string',
                bigint: BigInt(123),
              });
              Sentry.captureMessage('Message with different types of tags globally');
              Sentry.setTags({
                number: undefined,
                boolean: undefined,
                null: undefined,
                symbol: undefined,
                string: undefined,
                bigint: undefined,
              });
            }}
          />
        </View>
        <View style={styles.buttonWrapper}>
          <Button
            title="Set different types of tags in scope"
            onPress={async () => {
              const evt = {
                message: 'Message with different types of tags isolated',
                tags: {
                  number: 123,
                  boolean: true,
                  null: null,
                  undefined: undefined,
                  symbol: Symbol('symbol'),
                  string: 'abc',
                  bigint: BigInt(123),
                },
              };
              Sentry.captureEvent(evt);
            }}
          />
        </View>
      </View>
    </ScrollView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  title: {
    fontSize: 20,
    fontWeight: 'bold',
  },
  separator: {
    marginVertical: 30,
    height: 1,
    width: '80%',
  },
  buttonWrapper: {
    marginVertical: 6,
    marginHorizontal: 12,
    width: '80%',
  },
});

@lucas-zimerman
Copy link
Collaborator Author

Thank you for the suggestions @antonis !

Base automatically changed from lz/v7/uc-boolean to v7 July 7, 2025 12:07
@lucas-zimerman lucas-zimerman merged commit 87e2950 into v7 Jul 7, 2025
68 of 69 checks passed
@lucas-zimerman lucas-zimerman deleted the lz/v7/up-expo-ui branch July 7, 2025 16:15
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.

3 participants