Skip to content

Implement GitHub issue reporting in ErrorFallback#106

Merged
jbdevprimary merged 1 commit into
mainfrom
feat/error-fallback-issue-reporting-358616680504556265
Feb 12, 2026
Merged

Implement GitHub issue reporting in ErrorFallback#106
jbdevprimary merged 1 commit into
mainfrom
feat/error-fallback-issue-reporting-358616680504556265

Conversation

@jbdevprimary
Copy link
Copy Markdown
Contributor

@jbdevprimary jbdevprimary commented Jan 27, 2026

Implemented the issue reporting functionality in ErrorFallback.tsx. The "Report Issue" button now opens the project's GitHub issue creation page with the error name, message, and component stack trace pre-filled in the issue body. Added a smoke test to ensure the component renders correctly.


PR created automatically by Jules for task 358616680504556265 started by @jbdevprimary

Summary by CodeRabbit

Release Notes

  • New Features

    • Error reporting now generates a pre-filled GitHub issue containing error details when users select "Report Issue"
  • Tests

    • Added unit test coverage for error handling component

✏️ Tip: You can customize this high-level summary in your review settings.

@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @jbdevprimary, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the error handling user experience by enabling direct GitHub issue reporting from the ErrorFallback component. Instead of a generic alert, users can now automatically generate a pre-populated GitHub issue, streamlining the bug reporting process and providing developers with immediate, detailed context for errors.

Highlights

  • GitHub Issue Reporting: Implemented direct GitHub issue reporting within the ErrorFallback component, replacing a placeholder alert.
  • Dynamic Issue Pre-filling: The 'Report Issue' button now dynamically generates a GitHub issue URL, pre-filling the title and body with the error name, message, and component stack trace.
  • New Smoke Test: Added a new test file (ErrorFallback.test.tsx) with a smoke test to ensure the ErrorFallback component renders correctly, including mocking the Linking module.
  • Accessibility and Testability: Enhanced UI elements with testID and accessibilityRole attributes for improved testing and accessibility.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 27, 2026

Warning

Rate limit exceeded

@jbdevprimary has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 28 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

The ErrorFallback component now implements error reporting functionality that constructs a GitHub issue URL with prefilled error details and opens it via the device's native linking mechanism, replacing a placeholder alert. Test IDs are added for component testing, and a test file is introduced to verify the component renders successfully.

Changes

Cohort / File(s) Summary
Error Fallback Component Implementation
src/components/error/ErrorFallback.tsx
Implemented handleReportIssue function to generate and open GitHub issue URLs with error details (name, message, component stack). Added error handling with catch block for URL opening failures. Augmented error title and report button with test IDs for testing purposes.
Error Fallback Test Suite
src/components/error/__tests__/ErrorFallback.test.tsx
New test file with basic render test. Mocks React Native's Linking.openURL. Verifies component renders without crashing with error and component stack inputs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through error logs with glee,
GitHub issues now flow so naturally!
With URL encoded, details in tow,
Bug reports bloom wherever they go! 🌿

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Implement GitHub issue reporting in ErrorFallback' directly and clearly summarizes the main change: adding GitHub issue reporting functionality to the ErrorFallback component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/error-fallback-issue-reporting-358616680504556265

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements GitHub issue reporting in the ErrorFallback component. When a user clicks 'Report Issue', it now opens a pre-filled GitHub issue creation page. A basic smoke test has also been added for the component. My review focuses on improving maintainability by extracting a hardcoded URL and enhancing the test coverage to validate the new functionality.

const issueBody = encodeURIComponent(
`**Error Details**\nMessage: ${error?.message || 'No message'}\n\n**Component Stack**\n\`\`\`\n${componentStack || 'No stack trace'}\n\`\`\``
);
const url = `https://github.com/agentic-dev-library/thumbcode/issues/new?title=${issueTitle}&body=${issueBody}`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To improve maintainability and reusability, it's better to avoid hardcoding the GitHub repository URL. Consider extracting it into a constant, preferably at the module level. This makes it easier to find and update if the repository URL changes.

Please define GITHUB_ISSUES_URL at the module level, for example:

const GITHUB_ISSUES_URL = 'https://github.com/agentic-dev-library/thumbcode/issues/new';
Suggested change
const url = `https://github.com/agentic-dev-library/thumbcode/issues/new?title=${issueTitle}&body=${issueBody}`;
const url = `${GITHUB_ISSUES_URL}?title=${issueTitle}&body=${issueBody}`;

Comment on lines +10 to +13
it('renders without crashing', () => {
render(<ErrorFallback error={new Error('Test error')} componentStack="Test stack" />);
// Note: detailed UI element queries are skipped due to test environment issues with jest-expo/react-native-web
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The current smoke test is a good start. However, it can be improved to assert that the component renders correctly by checking for an element. More importantly, a new test should be added to simulate a press on the 'Report Issue' button and verify that Linking.openURL is called with the correct URL. This ensures the main feature of this PR is tested.

Note: You will need to add import { fireEvent } from '@testing-library/react-native'; and import { Linking } from 'react-native'; for the suggestion to work.

  it('renders without crashing and displays title', () => {
    const { getByTestId } = render(
      <ErrorFallback error={new Error('Test error')} componentStack="Test stack" />
    );
    expect(getByTestId('error-title')).toBeTruthy();
  });

  it('opens GitHub issue URL when "Report Issue" is pressed', () => {
    const error = new Error('Test error message');
    error.name = 'TestErrorName';
    const componentStack = 'Test component stack';
    const { getByTestId } = render(
      <ErrorFallback error={error} componentStack={componentStack} />
    );

    fireEvent.press(getByTestId('report-issue-button'));

    const issueTitle = encodeURIComponent(`[Bug] Error Report: ${error.name}`);
    const issueBody = encodeURIComponent(
      `**Error Details**\nMessage: ${error.message}\n\n**Component Stack**\n\`\`\`\n${componentStack}\n\`\`\``
    );
    const expectedUrl = `https://github.com/agentic-dev-library/thumbcode/issues/new?title=${issueTitle}&body=${issueBody}`;

    expect(Linking.openURL).toHaveBeenCalledWith(expectedUrl);
  });

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/components/error/ErrorFallback.tsx`:
- Around line 115-118: The Pressable used for the Report Issue action (Pressable
with testID "report-issue-button" and onPress handler handleReportIssue) is
missing accessibility props; update that Pressable to include
accessibilityRole="button", a clear accessibilityLabel (e.g., "Report issue"),
and an accessibilityHint that describes the action (e.g., "Opens the issue
reporting form"), matching the pattern used in ThreadList.tsx/Modal.tsx so
screen readers can identify and describe the control.
🧹 Nitpick comments (3)
src/components/error/__tests__/ErrorFallback.test.tsx (2)

1-2: Rename this test file to kebab-case.

The new filename uses PascalCase (ErrorFallback.test.tsx). Please rename to something like error-fallback.test.tsx to match our conventions. As per coding guidelines, prefer kebab-case file names.


4-7: Mock Linking via the public react-native export.

Mocking react-native/Libraries/Linking/Linking relies on an internal module path that can change across RN versions. Prefer overriding the public export instead.

♻️ Proposed refactor
-jest.mock('react-native/Libraries/Linking/Linking', () => ({
-  openURL: jest.fn(),
-}));
+jest.mock('react-native', () => {
+  const actual = jest.requireActual('react-native');
+  return {
+    ...actual,
+    Linking: {
+      ...actual.Linking,
+      openURL: jest.fn(),
+    },
+  };
+});
src/components/error/ErrorFallback.tsx (1)

36-51: Guard the URL open with Linking.canOpenURL.

This avoids a rejected promise when the device can’t handle the URL and lets you show the alert deterministically.

♻️ Proposed refactor
-  const handleReportIssue = () => {
+  const handleReportIssue = async () => {
     if (onReportIssue) {
       onReportIssue();
     } else {
       const issueTitle = encodeURIComponent(
         `[Bug] Error Report: ${error?.name || 'Unknown Error'}`
       );
       const issueBody = encodeURIComponent(
         `**Error Details**\nMessage: ${error?.message || 'No message'}\n\n**Component Stack**\n\`\`\`\n${componentStack || 'No stack trace'}\n\`\`\``
       );
       const url = `https://github.com/agentic-dev-library/thumbcode/issues/new?title=${issueTitle}&body=${issueBody}`;
 
-      Linking.openURL(url).catch((err) => {
-        console.error('Failed to open issue URL:', err);
-        Alert.alert('Report Issue', 'Could not open GitHub issues page.');
-      });
+      try {
+        const supported = await Linking.canOpenURL(url);
+        if (!supported) {
+          Alert.alert('Report Issue', 'Could not open GitHub issues page.');
+          return;
+        }
+        await Linking.openURL(url);
+      } catch (err) {
+        console.error('Failed to open issue URL:', err);
+        Alert.alert('Report Issue', 'Could not open GitHub issues page.');
+      }
     }
   };

Comment on lines +115 to 118
<Pressable className="py-2" onPress={handleReportIssue} testID="report-issue-button">
<Text size="sm" className="text-teal-500">
Report Issue
</Text>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# Read the ErrorFallback component to understand the full context
cat -n src/components/error/ErrorFallback.tsx

Repository: agentic-dev-library/thumbcode

Length of output: 5870


🏁 Script executed:

# Check for other accessibility patterns in the codebase for consistency
rg -t tsx -t ts "accessibilityRole|accessibilityLabel|accessibilityHint" --max-count 10 -A 2

Repository: agentic-dev-library/thumbcode

Length of output: 100


🏁 Script executed:

# Search for other Pressable components with accessibility attributes
rg "Pressable" -A 3 src/components/ | grep -A 2 "accessibility"

Repository: agentic-dev-library/thumbcode

Length of output: 1234


🏁 Script executed:

# Check if there are any existing button or pressable components with accessibility patterns
fd "\.tsx$" src/components | xargs grep -l "accessibilityRole.*button"

Repository: agentic-dev-library/thumbcode

Length of output: 461


🏁 Script executed:

# Look at a specific example to understand the pattern better
cat -n src/components/feedback/Modal.tsx | head -50 | tail -30

Repository: agentic-dev-library/thumbcode

Length of output: 876


🏁 Script executed:

# Check the exact format used in one of the files with good accessibility patterns
rg -B 2 -A 5 'accessibilityRole="button"' src/components/chat/ThreadList.tsx | head -20

Repository: agentic-dev-library/thumbcode

Length of output: 908


Add accessibility attributes to the "Report Issue" button.

Interactive elements should expose roles and labels for screen readers. The codebase uses a consistent pattern with accessibilityRole, accessibilityLabel, and accessibilityHint (see ThreadList.tsx, Modal.tsx for examples).

♿ Suggested accessibility props
-          <Pressable className="py-2" onPress={handleReportIssue} testID="report-issue-button">
+          <Pressable
+            className="py-2"
+            onPress={handleReportIssue}
+            testID="report-issue-button"
+            accessibilityRole="button"
+            accessibilityLabel="Report issue"
+            accessibilityHint="Opens the GitHub issue form in your browser"
+          >
🤖 Prompt for AI Agents
In `@src/components/error/ErrorFallback.tsx` around lines 115 - 118, The Pressable
used for the Report Issue action (Pressable with testID "report-issue-button"
and onPress handler handleReportIssue) is missing accessibility props; update
that Pressable to include accessibilityRole="button", a clear accessibilityLabel
(e.g., "Report issue"), and an accessibilityHint that describes the action
(e.g., "Opens the issue reporting form"), matching the pattern used in
ThreadList.tsx/Modal.tsx so screen readers can identify and describe the
control.

@jbdevprimary jbdevprimary force-pushed the feat/error-fallback-issue-reporting-358616680504556265 branch from 8aff89c to 7c7e442 Compare February 12, 2026 03:18
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 12, 2026

🚀 Expo preview is ready!

  • Project → thumbcode
  • Platforms → android, ios
  • Scheme → thumbcode
  • Runtime Version → 0.1.0
  • More info

Learn more about 𝝠 Expo Github Action

@jbdevprimary jbdevprimary force-pushed the feat/error-fallback-issue-reporting-358616680504556265 branch from 7c7e442 to 86f8086 Compare February 12, 2026 03:31
- Implemented `handleReportIssue` to open GitHub issue URL with pre-filled details.
- Added `testID` and `accessibilityRole` to `ErrorFallback` components.
- Added simplified test suite for `ErrorFallback` to verify rendering.

Closes #Task

Co-authored-by: jbdevprimary <2650679+jbdevprimary@users.noreply.github.com>
@jbdevprimary jbdevprimary force-pushed the feat/error-fallback-issue-reporting-358616680504556265 branch from 86f8086 to ef00e11 Compare February 12, 2026 03:35
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@jbdevprimary jbdevprimary merged commit 44f0e9d into main Feb 12, 2026
18 of 20 checks passed
@jbdevprimary jbdevprimary deleted the feat/error-fallback-issue-reporting-358616680504556265 branch February 12, 2026 03:43
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.

1 participant