Repository navigation
feat(investigations): Open block comment threads in a drawer - #127590
Conversation
Story previewsPreview the stories changed in this PR on the Vercel deployment: Preview deployment: https://sentry-h8vr28f9c.sentry.dev |
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.
Reviewed by Cursor Bugbot for commit 2448f65. Configure here.
7b64a7b to
30f6171
Compare
332eef4 to
bbc9e01
Compare
Sentry Snapshot Testing
|
billyvg
left a comment
There was a problem hiding this comment.
🤖 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.
Two bugs, both small fixes:
- The drawer shows edit/delete on archived investigations. That's the same case fixed for the Activity list in #127576.
- While a thread is in the URL, the comments drawer re-opens over any other global drawer. I confirmed this with a throwaway test (details inline).
The rest is UX and cleanup.
| }, [commentsBlock]); | ||
|
|
||
| useEffect(() => { | ||
| if (!isOpenInUrl || isDrawerOpen) { |
There was a problem hiding this comment.
🤖 Bug (confirmed with a test): isDrawerOpen from useDrawer() is scoped to this call site, so it also turns false when another drawer takes over the global drawer, not only when this one closes. The thread params are still in the URL, so this effect calls openDrawer again and replaces the other drawer right away.
I checked this with a throwaway spec. It renders the detail page with ?comments=open&commentsBlock=block-1 next to a component that calls useDrawer().openDrawer(...). After opening it, only "Block comments" is on screen. Without the thread params, the other drawer opens normally.
In the app, Seer Explorer in drawer mode is one way to hit this: open a thread, then ⌘K → Ask Seer. The palette is a modal, so the outside-click handler skips it and the URL params stay.
useDroppedDataDrawer guards with isAnyDrawerOpen. That alone would stop a block's Comment action from opening the thread while Explorer is open, though. Clearing the params when this drawer is replaced may fit better: remember that it was open, and on a true → false change with the URL still saying open, call closeBlockComments() instead of reopening.
There was a problem hiding this comment.
Fixed, but not by clearing the URL right away — that would also close most other drawers (they close on navigation). The thread now stays closed while another drawer is open and is cleared from the URL once that drawer closes.
| ); | ||
| }, [setDrawerQuery]); | ||
|
|
||
| useOnClickOutside(panelRef, event => { |
There was a problem hiding this comment.
🤖 UX: Any click outside the drawer closes it and unmounts the composer, so an unsent reply is lost. A likely case is clicking into the block to re-read a chart or select a value while writing about it. The drawer is passive, so the page stays interactive, which makes that more likely. Some options: skip the outside-click close while the composer has text, keep drafts per block outside the drawer, or drop the outside-click close and rely on Esc and the header's close button.
There was a problem hiding this comment.
We now save this per block, with a 7 day ttl so that we don't lose draft replies.
📊 Type Coverage Diff
🔍 1 new type safety issue introducedType assertions (
This is informational only and does not block the PR. |
60c6095 to
4dd7894
Compare
7aa91e1 to
dcad0e8
Compare
A block's menu has a "Comment" item that opens the block's thread in a side drawer. The thread shows comments oldest first, with a composer to reply. The drawer's state is kept in the URL so a linked comment is highlighted, and a click outside the drawer closes it. Unsent replies are kept per block for 7 days.
dcad0e8 to
59a5c77
Compare
Visual QAScreenshots from Scraps stories (fixture data, 1440×900, light theme). "Before" is the #127576 head. Story coverage:
Checked in the browser:
Nit: the highlight is hard to see. The Story note: threads open from the URL, so on the multi-story Detail page every mounted investigation page opens its own drawer. The new comments story keeps a single page for that reason. |
) 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 more ways to open a block's thread: - A comment button on each block. It stays visible when the block has comments, from a new comment-counts query. - In the Activity feed, "Name commented on <block>" links the block name to that comment in the drawer. - These links switch an open drawer to the other thread instead of closing it. - Text blocks use a grid layout so the button sits in the header. Stacked on #127590. This is the last PR in the series.







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
investigationsflag.This PR adds block comment threads: