Skip to content

fix(investigations): Reveal report cells when results are ready - #124516

Merged
arslnb merged 1 commit into
masterfrom
sentry/investigation-ready-cells
Sep 17, 2026
Merged

arslnb merged 1 commit into
masterfrom
sentry/investigation-ready-cells

Conversation

@arslnb

@arslnb arslnb commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Investigation report cells now appear when they have usable text, a table, or a chart. Waiting, pending, failed-without-output, and empty query cells stay out of the report, while polling continues to reveal new results. Query evidence opens expanded so it is visible as soon as it arrives.

The cell menu offers Refine and Delete, with Rerun removed. Existing results remain visible while a refinement is running.

Based on #124334. The backend counterpart, #124607, preserves query provenance and the original time window during refinement.

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 15, 2026
@github-actions

github-actions Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-4c82wxbbf.sentry.dev

@arslnb
arslnb marked this pull request as ready for review September 16, 2026 17:45
Comment on lines +435 to +438
export function shouldDisplayInvestigationBlock(block: InvestigationBlock) {
if (block.kind === 'text') {
return Boolean((getTextOutput(block.output) ?? block.content).trim());
}

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: In shouldDisplayInvestigationBlock, an empty markdown output ('') incorrectly hides a text block, even if it has user-written content, due to improper use of the nullish coalescing operator.
Severity: MEDIUM

Suggested Fix

Modify the logic in shouldDisplayInvestigationBlock to correctly handle an empty string from getTextOutput. Change the condition to use a logical OR (||) instead of nullish coalescing (??), like (getTextOutput(block.output) || block.content).trim(). This will ensure that if getTextOutput returns a falsy empty string, it correctly falls back to block.content.

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/investigations/detail/cell.tsx#L435-L438

Potential issue: The `shouldDisplayInvestigationBlock` function determines if a text
block should be visible. It uses the expression `(getTextOutput(block.output) ??
block.content).trim()`. The `getTextOutput` function can return an empty string (`''`)
if the API response contains `markdown: ''`. Because the nullish coalescing operator
(`??`) only provides a fallback for `null` or `undefined`, the expression evaluates to
`''` instead of falling back to `block.content`. Consequently, `Boolean(''.trim())`
becomes `false`, and the block is hidden from view, even if `block.content` contains
user-written text that should be displayed.

Also affects:

  • static/app/views/investigations/detail/cell.tsx:273~279

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

@billyvg
billyvg force-pushed the billyvong/investigations-agentic-entry-points branch from 5a2c9ef to 248163c Compare September 16, 2026 18:52
@billyvg
billyvg requested a review from a team as a code owner September 16, 2026 18:52
Base automatically changed from billyvong/investigations-agentic-entry-points to master September 16, 2026 19:33

@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 d379dcb. Configure here.

return Boolean(
output.tableMarkdown.trim() ||
(output.preferredView === 'chart' && getRenderableChart(output.chart))
);

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.

Awaiting-input cells stay hidden

Medium Severity

shouldDisplayInvestigationBlock only reveals cells that already have persisted text, a table, or a chart. A first-run cell in awaiting_input has none of those, so InvestigationCell never mounts and the pending-question UI cannot appear. The run stays blocked with no way to answer, while polling continues.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d379dcb. Configure here.

@arslnb
arslnb merged commit cd5c7c0 into master Sep 17, 2026
74 checks passed
@arslnb
arslnb deleted the sentry/investigation-ready-cells branch September 17, 2026 20:07
arslnb added a commit that referenced this pull request Sep 17, 2026
Query refinements preserve saved data and its original time window.
Presentation changes reuse the stored measurements and query links;
changes that need another query keep the recorded dates unless the user
explicitly requests a different period. Relative windows saved with an
execution become absolute dates anchored to that execution, and report
cells retain their original source context.

Missing historical filters stay unknown rather than combining today's
duration with an old timestamp. Explicit linked-parameter edits are
supplied separately from the saved settings and carried into subsequent
refinements, so changing an environment or date parameter takes
precedence without treating current page filters as an edit.

Regression coverage includes refining ten days later, stable request
fingerprints, report cells without saved filters, and environment/date
edits across successive refinements. Rebased onto master after #124334
merged. The frontend counterpart is #124516, which reveals ready cells
and removes Rerun.
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