feat(autofix): Redesigned autofix previews#110203
Conversation
This implements the new redesigned autofix previews behind the flag autofix-on-explorer-v2. The CTA button is still missing but will be added next.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Autofix Details
Bugbot Autofix prepared fixes for all 3 issues found in the latest run.
- ✅ Fixed: Type guard rejects optional
reproduction_stepsfrom backend- Made reproduction_steps optional in RootCauseArtifactData interface and updated the type guard to accept undefined values, matching the backend schema.
- ✅ Fixed: File count deduplicates across repos by path only
- Updated file count deduplication to include repo name in the Set key, ensuring files with the same path in different repos are counted separately.
- ✅ Fixed: Exported
hasAutofixArtifactsfunction is never imported- Removed the export keyword from hasAutofixArtifacts function since it is never imported or used anywhere in the codebase.
Or push these changes by commenting:
@cursor push b840673eb2
Preview (b840673eb2)
diff --git a/static/app/components/events/autofix/types.ts b/static/app/components/events/autofix/types.ts
--- a/static/app/components/events/autofix/types.ts
+++ b/static/app/components/events/autofix/types.ts
@@ -397,7 +397,7 @@
export interface RootCauseArtifactData {
five_whys: string[];
one_line_description: string;
- reproduction_steps: string[];
+ reproduction_steps?: string[];
}
export function isRootCauseArtifact(
@@ -413,7 +413,7 @@
return (
isString(data.one_line_description) &&
isArrayOf(data.five_whys, isString) &&
- isArrayOf(data.reproduction_steps, isString)
+ (data.reproduction_steps === undefined || isArrayOf(data.reproduction_steps, isString))
);
}
diff --git a/static/app/components/events/autofix/useExplorerAutofix.tsx b/static/app/components/events/autofix/useExplorerAutofix.tsx
--- a/static/app/components/events/autofix/useExplorerAutofix.tsx
+++ b/static/app/components/events/autofix/useExplorerAutofix.tsx
@@ -251,7 +251,7 @@
});
}
-export function hasAutofixArtifacts(blocks: Block[]): boolean {
+function hasAutofixArtifacts(blocks: Block[]): boolean {
for (const block of blocks) {
if (block.artifacts?.length) {
return true;
diff --git a/static/app/components/events/autofix/v3/autofixPreviews.tsx b/static/app/components/events/autofix/v3/autofixPreviews.tsx
--- a/static/app/components/events/autofix/v3/autofixPreviews.tsx
+++ b/static/app/components/events/autofix/v3/autofixPreviews.tsx
@@ -71,9 +71,9 @@
const filesChanged = useMemo(() => {
const changed = new Set<string>();
- for (const patchesForRepo of patchesForRepos.values()) {
+ for (const [repoName, patchesForRepo] of patchesForRepos.entries()) {
for (const patch of patchesForRepo) {
- changed.add(patch.patch.path);
+ changed.add(`${repoName}:${patch.patch.path}`);
}
}
static/app/views/issueDetails/streamline/sidebar/autofixSection.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| {organization.features.includes('autofix-on-explorer-v2') ? ( | ||
| <AutofixSection group={group} project={project} event={event} /> | ||
| ) : ( | ||
| <SeerSection group={group} project={project} event={event} /> | ||
| )} |
There was a problem hiding this comment.
to keep consistent wdyt about naming this SeerSectionV3? (SeerSection is v1 and v2)
There was a problem hiding this comment.
I typically try to avoid naming things v1/v2/vN in the code base as when we we remove the older versions, it removes all references to along side the feature flags.

This implements the new redesigned autofix previews behind the flag autofix-on-explorer-v2. The CTA button and loading states still missing but will be added next.