-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open PR and add tests if confident #93127
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
Conversation
…xible naming - Replace hardcoded screenshot names with flexible pattern matching that detects any file containing 'screenshot' and ending with .jpg/.png - Maintains backwards compatibility and adds test coverage - Fixes GitHub issue #92154
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.
Pull Request Overview
This PR updates the screenshot widget in Issue Details to improve file detection by removing hardcoded filename exclusions and implementing a flexible check for screenshot file names. Additionally, it adds a new test case to validate the updated logic and introduces documentation to explain these changes.
- Removed hardcoded SCREENSHOT_NAMES and implemented a flexible filename check.
- Added test coverage for various screenshot naming patterns.
- Provided documentation on improved screenshot detection.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
static/app/components/events/eventTagsAndScreenshot/screenshot/screenshotDataSection.tsx | Removed hardcoded names and updated logic to flexibly detect screenshots. |
static/app/components/events/eventTagsAndScreenshot/index.spec.tsx | Added new test cases to validate detection of screenshots with flexible naming. |
screenshot_detection_improvement.md | New documentation detailing the changes to screenshot detection. |
Comments suppressed due to low confidence (1)
static/app/components/events/eventTagsAndScreenshot/screenshot/screenshotDataSection.tsx:52
- [nitpick] Consider using a case-insensitive check for 'screenshot' (e.g., converting attachment.name to lowercase) to ensure that files with differently cased names are also detected.
attachments?.filter((attachment: EventAttachment) => attachment.name.includes('screenshot') && (attachment.name.endsWith('.jpg') || attachment.name.endsWith('.png'))) ?? [];
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
The screenshot widget in Issue Details was updated to improve file detection.
static/app/components/events/eventTagsAndScreenshot/screenshot/screenshotDataSection.tsx
, the hardcodedSCREENSHOT_NAMES
array was removed.name
includes "screenshot" and ends with.jpg
or.png
. This change addresses issue Issue detail screenshot preview: Improve screenshot file detection #92154, allowing files likecrash_screenshot.png
to be displayed.static/app/components/events/eventTagsAndScreenshot/index.spec.tsx
to validate the updated detection logic, ensuring files with flexible naming patterns are correctly identified and navigable.screenshot_detection_improvement.md
, was created to detail these changes.