Skip to content

feat(investigations): Edit and delete comments - #127576

Merged
wedamija merged 1 commit into
masterfrom
danf/investigations-activity-edit
Oct 15, 2026
Merged

wedamija merged 1 commit into
masterfrom
danf/investigations-activity-edit

Conversation

@wedamija

Copy link
Copy Markdown
Member

We're adding comments to Investigations, and this is one of a series of frontend PRs that build the feature. Comments show in an Activity section at the bottom of the page, and block comments open in a thread drawer. Everything is behind the investigations flag.

This PR adds edit and delete for the comment's author:

  • A "…" menu on your own comments with Edit and Delete.
  • Edit opens the comment inline. Enter saves, Esc cancels.
  • Delete asks for confirmation first.
  • Edited comments show "(edited)".

Stacked on #127574. The next PR adds block comments in a drawer.

@wedamija
wedamija requested a review from a team as a code owner October 15, 2026 17:57
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 95.74% 95.74% ±0%
Typed 142,074 142,139 🟢 +65
Untyped 6,329 6,330 🔴 +1
🔍 1 new type safety issue introduced

Type assertions (as) (1 new)

File Line Detail
static/app/views/investigations/comments/commentActions.tsx 42 as {ref?: React.Ref<HTMLButtonElement>} — triggerProps as {ref?: React.Ref<HTMLButtonElement>}

This is informational only and does not block the PR.

@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.

Stale Bugbot comment from a previous run.

Comment thread static/app/views/investigations/activity/investigationActivity.tsx
Comment thread static/app/views/investigations/comments/commentActions.tsx Outdated
Comment thread static/app/views/investigations/comments/commentActions.tsx Outdated
Comment thread static/app/views/investigations/api.ts
Comment thread static/app/views/investigations/api.ts
Comment thread static/app/views/investigations/comments/commentComposer.tsx Outdated
Comment thread static/app/views/investigations/comments/commentComposer.tsx Outdated
Comment thread static/app/views/investigations/comments/commentComposer.tsx Outdated
Comment thread static/app/views/investigations/comments/commentComposer.tsx Outdated
Comment thread static/app/views/investigations/comments/commentComposer.tsx Outdated
Comment thread static/app/views/investigations/comments/commentComposer.tsx Outdated
Comment thread static/app/views/investigations/comments/commentComposer.tsx Outdated

@billyvg billyvg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 AI review by Claude, an AI agent. I'm reviewing this stack at @billyvg's request and wrote the inline comments below. @wedamija, Billy will also go through these comments and the code, so please treat this as a first pass, not a final review.

Ryan's isPending and toast comments are addressed in 524b53b, and Bugbot's catch about archived actions is fixed in 30f6171, so I didn't repeat those. I have one question about the "(edited)" threshold and one small focus nit.

Comment thread static/app/views/investigations/activity/investigationActivity.tsx
Comment thread static/app/views/investigations/comments/commentActions.tsx
Comment thread static/app/views/investigations/comments/commentComposer.tsx
@sentry

sentry Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 630 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@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.

Stale Bugbot comment from a previous run.

Comment thread static/app/views/investigations/comments/commentComposer.tsx

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

Comment thread static/app/views/investigations/api.ts
Comment authors get a menu on their own comments with Edit and Delete. Edit opens the comment inline: Enter saves, Esc cancels. Delete asks for confirmation first, then moves focus to the composer. Edited comments show "(edited)", and actions are hidden on archived investigations.
@wedamija
wedamija force-pushed the danf/investigations-activity-edit branch from 60c6095 to 4dd7894 Compare October 15, 2026 22:40
@wedamija
wedamija merged commit 63ac4bc into master Oct 15, 2026
73 checks passed
@wedamija
wedamija deleted the danf/investigations-activity-edit branch October 15, 2026 23:05
@billyvg

billyvg commented Oct 16, 2026

Copy link
Copy Markdown
Member

Visual QA

Screenshots from Scraps stories (fixture data, 1440×900, light theme). "Before" is the #127574 head with the same story and data.

Story coverage: no story had comments by the signed-in user, so the actions menu never showed. The fixture now handles PUT/DELETE …/comments/:id/, and a story persona (Ada Lovelace) carries the signed-in user's id. I also added a "Your comments (as Ada Lovelace)" story with an edited comment. That's in a local commit that isn't pushed yet.

before after
Activity without comment actions Activity with the actions menu on your own comment
your comments, one edited actions menu
Own comments with the edited label Edit and Delete menu
inline edit delete confirmation
Inline edit with Cancel and Save Delete confirmation modal

Checked in the browser:

  • The menu appears only on your own comments (2 of 3), and not at all on an archived investigation.
  • Edit opens focused and prefilled, and Save stays disabled until the text changes. Enter saves, and focus returns to "…".
  • Delete asks first, then removes the comment.

billyvg added a commit that referenced this pull request Oct 19, 2026
### Why?

The comments PRs shipped without story coverage. The stories' fixture
API throws on any investigation endpoint it doesn't know, so since the
Activity section landed, every investigation page story shows a loading
error in Activity. Posting, editing, block threads, and the comment
entry points can't be reached from Scraps at all. A thread opened from a
story also rendered outside the fixture and requested the real API.

### How?

Teach the fixture API the comment endpoints and mount a drawer inside
it, then add stories for each comment state. There is one commit per
comments PR. Stories view the page as a fixed persona, so they look the
same for everyone.

Screenshots from these stories are in the visual QA comments on each PR:

- #127498
- #127574
- #127576
- #127590
- #127593

<sub>Generated with Claude Code</sub>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
RudraPatel2003 pushed a commit that referenced this pull request Oct 19, 2026
We're adding comments to Investigations, and this is one of a series of
frontend PRs that build the feature. Comments show in an Activity
section at the bottom of the page, and block comments open in a thread
drawer. Everything is behind the `investigations` flag.

This PR adds edit and delete for the comment's author:
- A "…" menu on your own comments with Edit and Delete.
- Edit opens the comment inline. Enter saves, Esc cancels.
- Delete asks for confirmation first.
- Edited comments show "(edited)".

Stacked on #127574. The next PR
adds block comments in a drawer.
RudraPatel2003 pushed a commit that referenced this pull request Oct 19, 2026
### Why?

The comments PRs shipped without story coverage. The stories' fixture
API throws on any investigation endpoint it doesn't know, so since the
Activity section landed, every investigation page story shows a loading
error in Activity. Posting, editing, block threads, and the comment
entry points can't be reached from Scraps at all. A thread opened from a
story also rendered outside the fixture and requested the real API.

### How?

Teach the fixture API the comment endpoints and mount a drawer inside
it, then add stories for each comment state. There is one commit per
comments PR. Stories view the page as a fixed persona, so they look the
same for everyone.

Screenshots from these stories are in the visual QA comments on each PR:

- #127498
- #127574
- #127576
- #127590
- #127593

<sub>Generated with Claude Code</sub>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview — 4dd7894a Deployed Oct 15, 2026 by vercel[bot]
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.

3 participants