Skip to content

fix(feedback): prevent crash submitting feedback without a highlight - #5319

Merged
Jeremy Rose (jeremyrose-viam) merged 1 commit into
viamrobotics:mainfrom
jeremyrose-viam:worktree-jiggly-gliding-yeti
Sep 17, 2026
Merged

Jeremy Rose (jeremyrose-viam) merged 1 commit into
viamrobotics:mainfrom
jeremyrose-viam:worktree-jiggly-gliding-yeti

Conversation

@jeremyrose-viam

@jeremyrose-viam Jeremy Rose (jeremyrose-viam) commented Sep 15, 2026

Copy link
Copy Markdown
Member

Summary

  • submitFeedback() in assets/js/feedback.js assumed a page element was always highlighted before submit, so highlightedInfo[0].text threw a TypeError when a user typed feedback and clicked Submit without highlighting anything (highlighting is optional).
  • The uncaught error silently killed the click handler, so the button appeared to "not work" with no visible error to the user.
  • Falls back to "(no element selected)" when nothing was highlighted.

Jira: DOCS-4968

Test plan

Note: We'll need to test this in production. CORS does not appear to be configured for dev or preview environments.

  • Load a docs page, click "Give Feedback", type feedback text, click Submit without highlighting any page content — confirm it submits successfully instead of silently failing
  • Confirm the existing flow (highlight an element, then submit) still works and includes the highlighted element's text

@netlify

netlify Bot commented Sep 15, 2026

Copy link
Copy Markdown

Deploy Preview for viam-docs ready!

Name Link
🔨 Latest commit 74a43d5
🔍 Latest deploy log https://app.netlify.com/projects/viam-docs/deploys/6aa9b85adf27080008a50644
😎 Deploy Preview https://deploy-preview-5319--viam-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 41 (🟢 up 6 from production)
Accessibility: 99 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@viambot viambot added the safe to build This pull request is marked safe to build from a trusted zone label Sep 15, 2026
@jeremyrose-viam
Jeremy Rose (jeremyrose-viam) merged commit 6ee825c into viamrobotics:main Sep 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to build This pull request is marked safe to build from a trusted zone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants