Skip to content

H-6327: Integrate Sentry feedback button into ViewportControls#8537

Merged
kube merged 7 commits intomainfrom
cf/petrinaut-sentry-integrated-button-in-ui
Mar 16, 2026
Merged

H-6327: Integrate Sentry feedback button into ViewportControls#8537
kube merged 7 commits intomainfrom
cf/petrinaut-sentry-integrated-button-in-ui

Conversation

@kube
Copy link
Collaborator

@kube kube commented Mar 12, 2026

🌟 What is the purpose of this PR?

The Sentry "Give feedback" button was floating on top of the UI and hiding elements underneath it. This PR moves it into the ViewportControls panel by introducing a viewportActions prop on the Petrinaut component, allowing consumers to inject custom action buttons.

🔗 Related links

🔍 What does this change?

  • Adds a ViewportAction type (key, icon, label, tooltip, onClick, style, className, ref) exported from @hashintel/petrinaut
  • Adds an optional viewportActions?: ViewportAction[] prop to PetrinautProps, threaded through to ViewportControls
  • ViewportControls renders each action as an IconButton after the built-in buttons
  • Sets autoInject: false on Sentry's feedbackIntegration to remove the floating button
  • Adds a useSentryFeedbackAction() hook in the website that returns a ViewportAction using Sentry's getFeedback().attachTo() API with a React 19 ref cleanup pattern
  • Purple-styled button with MdBugReport icon

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

❓ How to test this?

  1. Checkout the branch
  2. Run yarn dev in apps/petrinaut-website
  3. Confirm the floating Sentry feedback button is gone
  4. Confirm a purple feedback button appears at the bottom of the viewport controls (bottom-right)
  5. Click it and confirm the Sentry feedback dialog opens

@vercel
Copy link

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
petrinaut Ready Ready Preview Mar 16, 2026 10:12am
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
hash Ignored Ignored Preview Mar 16, 2026 10:12am
hashdotdesign Ignored Ignored Preview Mar 16, 2026 10:12am
hashdotdesign-tokens Ignored Ignored Preview Mar 16, 2026 10:12am

@github-actions github-actions bot added area/deps Relates to third-party dependencies (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team area/apps labels Mar 12, 2026
@kube kube marked this pull request as ready for review March 12, 2026 23:49
@cursor
Copy link

cursor bot commented Mar 12, 2026

PR Summary

Medium Risk
Introduces a new optional viewportActions API threaded through core editor components and changes how Sentry feedback is injected, which could affect viewport control rendering/behavior if consumers rely on existing layout.

Overview
Moves Sentry “Give feedback” into Petrinaut’s built-in viewport controls by adding a new optional viewportActions prop on Petrinaut and rendering provided actions as extra IconButtons in ViewportControls.

Adds a new exported ViewportAction type to define these injected buttons, and updates the hosted website to supply a Sentry-backed action (purple bug icon) while disabling Sentry’s default floating injection via autoInject: false.

Written by Cursor Bugbot for commit d8ec669. This will update automatically on new commits. Configure here.

Copy link
Collaborator Author

kube commented Mar 12, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@augmentcode
Copy link

augmentcode bot commented Mar 12, 2026

🤖 Augment PR Summary

Summary: This PR adds an extension point for extra viewport control buttons and uses it to expose a Sentry “Give feedback” button in Petrinaut.

Changes:

  • Introduces a shared ViewportAction type and a new viewportActions prop on Petrinaut, threading it through EditorView and SDCPNView into ViewportControls.
  • Updates ViewportControls to render the provided actions as additional IconButtons after the built-in controls.
  • Adds a Petrinaut-website hook that attaches Sentry Feedback to a viewport control button (using a bug-report icon).
  • Adjusts Sentry Feedback integration config to disable auto-injection so the UI button is only rendered via the new viewport action.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@kube kube changed the title Integrate Sentry feedback button into ViewportControls H-6327: Integrate Sentry feedback button into ViewportControls Mar 12, 2026
@graphite-app graphite-app bot requested a review from a team March 13, 2026 00:08
Base automatically changed from cf/petrinaut-extract-website to main March 13, 2026 17:50
@kube kube requested a review from a team as a code owner March 13, 2026 17:50
@graphite-app graphite-app bot requested a review from a team March 13, 2026 17:51
@kube kube changed the base branch from main to graphite-base/8537 March 14, 2026 12:59
@kube kube force-pushed the cf/petrinaut-sentry-integrated-button-in-ui branch from 70d198a to 1b89853 Compare March 14, 2026 12:59
@kube kube force-pushed the cf/petrinaut-sentry-integrated-button-in-ui branch from 1b89853 to 1bf2e71 Compare March 14, 2026 13:03
@kube kube force-pushed the graphite-base/8537 branch from e91ad49 to 2cd6534 Compare March 14, 2026 13:03
@kube kube changed the base branch from graphite-base/8537 to cf/h-6324-migrate-petrinaut-to-oxlint-and-verify-react-compiler March 14, 2026 13:03
Copy link
Member

@CiaranMn CiaranMn left a comment

Choose a reason for hiding this comment

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

The testing instructions say this:

Checkout the branch
Run yarn dev in apps/petrinaut-website
Confirm the floating Sentry feedback button is gone
Confirm a purple feedback button appears at the bottom of the viewport controls (bottom-right)
Click it and confirm the Sentry feedback dialog opens

But the Sentry feedback dialog does not in fact open. I understand this is because Sentry is not configured for staging, and therefore the button will do nothing, but there is no way of telling this and we are likely to get people reporting this as a bug in local / staging at some point. Can we add an alert that explains the click has been registered but Sentry is not configured, so it's clear what is happening?

@kube kube changed the base branch from cf/h-6324-migrate-petrinaut-to-oxlint-and-verify-react-compiler to graphite-base/8537 March 15, 2026 16:20
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 15, 2026

Merge activity

  • Mar 15, 10:59 PM UTC: This pull request can not be added to the Graphite merge queue. Please try rebasing and resubmitting to merge when ready.
  • Mar 15, 10:59 PM UTC: Graphite disabled "merge when ready" on this PR due to: a merge conflict with the target branch; resolve the conflict and try again..

kube and others added 6 commits March 16, 2026 10:38
Add a `viewportActions` prop to Petrinaut that allows consumers to inject
custom action buttons into the viewport controls panel. Use this to move
the Sentry feedback trigger from a floating overlay into the controls,
with a purple button style and bug report icon.

- Add `ViewportAction` type with key, icon, label, tooltip, onClick,
  style, className, and ref fields
- Thread `viewportActions` through Petrinaut → EditorView → SDCPNView →
  ViewportControls
- Set `autoInject: false` on Sentry feedbackIntegration
- Use React 19 ref cleanup to attach/detach Sentry feedback listener

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kube kube force-pushed the graphite-base/8537 branch from 3125bda to 46e4caf Compare March 16, 2026 09:42
@kube kube force-pushed the cf/petrinaut-sentry-integrated-button-in-ui branch from e95f163 to 6d6cfca Compare March 16, 2026 09:42
@kube kube changed the base branch from graphite-base/8537 to main March 16, 2026 09:42
When Sentry isn't configured (local dev, staging), the feedback button
was silently inert. Now it shows an alert explaining the situation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kube kube added this pull request to the merge queue Mar 16, 2026
Merged via the queue into main with commit 0043f72 Mar 16, 2026
45 checks passed
@kube kube deleted the cf/petrinaut-sentry-integrated-button-in-ui branch March 16, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/apps area/deps Relates to third-party dependencies (area) area/libs Relates to first-party libraries/crates/packages (area) type/eng > frontend Owned by the @frontend team

Development

Successfully merging this pull request may close these issues.

2 participants