Skip to content

feat(issues): collapse repetitive issue activity - #121488

Merged
scttcper merged 3 commits into
masterfrom
scttcper/issue-activity-rollups
Aug 7, 2026
Merged

feat(issues): collapse repetitive issue activity#121488
scttcper merged 3 commits into
masterfrom
scttcper/issue-activity-rollups

Conversation

@scttcper

@scttcper scttcper commented Aug 6, 2026

Copy link
Copy Markdown
Member

Older resolve and regress loops can bury useful issue activity. This rolls older flapping status and automatic priority events into an expandable activity row, preserves the latest resolve and regress activity.

flag pr #121489

before

image

after

image

Roll older status flapping and priority event runs into expandable activity rows while keeping the newest resolve and regress cycle visible. Preserve the underlying event count in the sidebar and gate the behavior behind the organization feature.

Co-Authored-By: Codex <noreply@openai.com>
@scttcper
scttcper marked this pull request as ready for review August 6, 2026 21:53
@scttcper
scttcper requested a review from a team as a code owner August 6, 2026 21:53
@scttcper
scttcper requested a review from a team August 6, 2026 21:53

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 798365f. Configure here.

const visibleActivityCount = sidebarVisibleActivities.filter(
item => item.type !== 'collapsed_status_activities'
).length;
const hiddenActivityCount = totalActivityCount - visibleActivityCount;

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.

Sidebar count ignores expanded rollups

Low Severity

hiddenActivityCount always treats rollup events as hidden. After expanding a sidebar rollup, the footer still says those now-visible events remain to be viewed, and its analytics count is also incorrect.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 798365f. Configure here.

Keep the status flapping rollups compatible with the latest activity feed props, comment links, and connector behavior.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 7, 2026
Comment on lines +58 to +68
>
<Button
variant="transparent"
size="zero"
style={{marginLeft: -6}}
onClick={onClick}
>
<Text as="span" variant="muted" size="md" density="comfortable">
{label}
</Text>
</Button>

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.

Bug: When expanding a collapsed status activity group, the inner ActivityFeedRow components are rendered without the showConnector prop, causing connector lines to be missing between items.
Severity: LOW

Suggested Fix

Pass the showConnector prop to the recursive ActivityFeedRow component when rendering the items within an expanded collapsed_status_activities group. This will ensure connector lines are drawn, matching the rest of the activity feed's appearance.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
static/app/views/issueDetails/activitySection/activityLineItem/collapsedStatusActivityRow.tsx#L58-L68

Potential issue: When a collapsed status activity group is expanded, the inner
`ActivityFeedRow` components are rendered without the `showConnector` prop. The
`ActivityLineRow` component only draws the vertical connector lines between activity
items when `showConnector` is truthy. Because this prop is omitted when rendering the
expanded `collapsed_status_activities`, the connector lines are not drawn, creating a
visual inconsistency in the activity feed.

Did we get this right? 👍 / 👎 to inform future reviews.

Comment thread static/app/views/issueDetails/activitySection/index.tsx
The sidebar mixed underlying rollup events with rendered rows, so it could show both "Show 2 more" and "View 2 more" for the same activity. Count only rows omitted from the sidebar and remove the unused rollup exports flagged by knip.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
Comment on lines +223 to +233
const latestPairIndex = activities.findIndex((activity, index) => {
const nextActivity = activities[index + 1];
return (
activity.activity.type === GroupActivityType.SET_REGRESSION &&
nextActivity !== undefined &&
isResolutionActivity(nextActivity)
);
});

// Preserve everything through the newest pair; +2 includes both the regression and resolution.
const protectedActivityCount = latestPairIndex === -1 ? 0 : latestPairIndex + 2;

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.

Bug: The collapseSeerActivityPairs function can insert a CollapsedSeerActivity between a regression/resolution pair, breaking the adjacency check in collapseFlappingStatusActivities and preventing flapping detection.
Severity: MEDIUM

Suggested Fix

Modify collapseFlappingStatusActivities to be robust against intervening activities. Instead of checking the immediately adjacent element activities[index+1], the logic should scan forward from a SET_REGRESSION activity to find the next relevant activity, skipping over others like CollapsedSeerActivity, to see if it is a SET_RESOLVED activity.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
static/app/views/issueDetails/activitySection/activityLineItem/activityFeedItem.ts#L223-L233

Potential issue: The `collapseFlappingStatusActivities` function assumes that
`SET_REGRESSION` and `SET_RESOLVED` activities are adjacent in the activity feed to
detect a "flapping" issue. However, the `collapseSeerActivityPairs` function, which runs
prior, can create and insert a `CollapsedSeerActivity` object between the regression and
resolution activities. This breaks the adjacency assumption, as the logic specifically
checks `activities[index+1]`. Consequently, if a Seer analysis completes between an
issue regressing and being resolved, the flapping status will not be correctly
identified and displayed in the UI.

@scttcper
scttcper merged commit e092563 into master Aug 7, 2026
71 checks passed
@scttcper
scttcper deleted the scttcper/issue-activity-rollups branch August 7, 2026 22:42
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