Skip to content

fix(Preferences): Issue 5949 - updates for escaping preference error - #6191

Open
gdicristofaro wants to merge 2 commits into
OHIF:masterfrom
gdicristofaro:5949_escapePrefError
Open

fix(Preferences): Issue 5949 - updates for escaping preference error#6191
gdicristofaro wants to merge 2 commits into
OHIF:masterfrom
gdicristofaro:5949_escapePrefError

Conversation

@gdicristofaro

@gdicristofaro gdicristofaro commented Jul 27, 2026

Copy link
Copy Markdown

Context

Changes & Results

This is a PR to address the issue outlined in #5949

Testing

I believe this can be tested with the reproduction steps outlined in #5949.

Checklist

PR

Code

  • My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • (N/A) The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • OS: Ubuntu 26.04
  • Node version: 24.16.0
  • Browser: Google Chrome 149.0.7827.155 (64-bit)

Summary by CodeRabbit

  • Bug Fixes
    • Improved stability when preview actions are triggered without an active viewport, such as pressing Escape during a modal.
    • Prevented errors when displaying Segment AI previews if no viewport element is available.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit c264b67
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/6a870a913ff42800088ccd35
😎 Deploy Preview https://deploy-preview-6191--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5a4f4dba-7046-4d06-a645-b47ea5383142

📥 Commits

Reviewing files that changed from the base of the PR and between 1628ddb and 758db4e.

📒 Files selected for processing (1)
  • extensions/cornerstone/src/commandsModule.ts

📝 Walkthrough

Walkthrough

The preview action handler now tolerates cases without an enabled viewport and passes an optional viewport element to Segment AI preview actions.

Changes

Preview viewport safety

Layer / File(s) Summary
Handle missing enabled viewports
extensions/cornerstone/src/commandsModule.ts
_handlePreviewAction now treats the enabled viewport element as optional and safely passes its viewport element to Segment AI preview handling.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: sedghi, jbocce, wayfarer3130

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The template sections exist, but Context, Changes, and Testing are mostly boilerplate, and the PR checklist is not fully completed. Add substantive Context/Changes/Testing details and mark every required checklist item with [x], especially the PR title checkbox.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise, uses semantic-release format, and matches the fix for the Preferences escaping error.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Shenkeeee

Copy link
Copy Markdown

Worked for me, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants