Skip to content

feat(autofix): Redesigned autofix previews#110203

Merged
Zylphrex merged 6 commits intomasterfrom
txiao/feat/redesigned-autofix-previews
Mar 9, 2026
Merged

feat(autofix): Redesigned autofix previews#110203
Zylphrex merged 6 commits intomasterfrom
txiao/feat/redesigned-autofix-previews

Conversation

@Zylphrex
Copy link
Member

@Zylphrex Zylphrex commented Mar 9, 2026

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.

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.
@Zylphrex Zylphrex requested review from a team as code owners March 9, 2026 14:09
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 9, 2026
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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_steps from 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 hasAutofixArtifacts function is never imported
    • Removed the export keyword from hasAutofixArtifacts function since it is never imported or used anywhere in the codebase.

Create PR

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}`);
       }
     }
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +98 to +102
{organization.features.includes('autofix-on-explorer-v2') ? (
<AutofixSection group={group} project={project} event={event} />
) : (
<SeerSection group={group} project={project} event={event} />
)}
Copy link
Member

Choose a reason for hiding this comment

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

to keep consistent wdyt about naming this SeerSectionV3? (SeerSection is v1 and v2)

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

@Zylphrex Zylphrex merged commit ec97db8 into master Mar 9, 2026
62 checks passed
@Zylphrex Zylphrex deleted the txiao/feat/redesigned-autofix-previews branch March 9, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants