Skip to content

fix(context-menu): Move the reposition logic from the context menu to the dialog component.#5060

Merged
sedghi merged 2 commits intoOHIF:masterfrom
jbocce:fix/context-menu
May 24, 2025
Merged

fix(context-menu): Move the reposition logic from the context menu to the dialog component.#5060
sedghi merged 2 commits intoOHIF:masterfrom
jbocce:fix/context-menu

Conversation

@jbocce
Copy link
Collaborator

@jbocce jbocce commented May 22, 2025

Context

See #5048 .

Changes & Results

Moved the reposition logic from the context menu to the dialog component. This has two benefits...

  • the context menu should not reposition itself by changing coordinates that its ancestor is using to position it
  • dialogs that are fixed position should have reposition logic in general

Testing

The problematic behaviour seen in #5048 should no longer occur.

Checklist

PR

  • My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

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

Public Documentation Updates

  • The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • OS: Windows 11
  • Node version: 23.9.0
  • Browser: Chrome 136.0.7103.114

@jbocce jbocce requested review from dan-rukas and wayfarer3130 May 22, 2025 16:00
@netlify
Copy link

netlify bot commented May 22, 2025

Deploy Preview for ohif-dev canceled.

Name Link
🔨 Latest commit b48115e
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/682f745127820b0008fc46e1

ref={contentRef}
className={cn(unstyled ? 'p-0' : '', containerClassName, contentVisibility)}
unstyled={unstyled}
shouldAnimate={!defaultPosition}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The

animation: 'none'

just wasn't cutting it.

Copy link
Member

Choose a reason for hiding this comment

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

I'm surprised it doesn't work, can we try animate-none in the above in classname, it is supposed to override the innner classname in DialogContent, since it is applied last in Dialog.tsx

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes I tried that as I was coding and just tried it again. See the video below, animation still occurs. Notice that menu looks like it slides in on an angle near the bottom of the screen.

context.menu.animation.mp4

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this might explain why the class name ordering is NOT working.

I suspect for the style it is likely that animation: none is just overriding the name of the animation and there are several other animation attributes that would require overriding/resetting as well.

But what do I know? 🤣

import { Icons } from '@ohif/ui-next';

const ContextMenu = ({ items, ...props }) => {
const contextMenuRef = useRef<HTMLDivElement>(null);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was a bit weird that the positioning was being changed here, yet "used" by an ancestor.

@jbocce jbocce requested review from sedghi and removed request for wayfarer3130 May 22, 2025 16:53
transform: 'translate(0, 0)',
margin: 0,
animation: 'none',
transition: 'none',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok @sedghi, I figured it out. We need transition: none too. Every once in a while even a blind squirrel finds a nut. 🤣

@sedghi sedghi merged commit cb814e6 into OHIF:master May 24, 2025
6 of 7 checks passed
@jbocce jbocce deleted the fix/context-menu branch June 2, 2025 17:29
pickzt18 added a commit to NenckaLab/Viewers that referenced this pull request Jun 9, 2025
* fix: make datasource selection work (OHIF#4944)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: enable measurements panel scroll (OHIF#4943)

* feat: expose scroll thumbnail into view (OHIF#4941)

* fix: add back study browser scrollbar (OHIF#4942)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* ui(fix): Study panel scrollbar fix and updates (OHIF#4951)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: making onnxruntime work with rsbuild (OHIF#4957)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* chore: add test coverage (OHIF#4960)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: github runner (OHIF#4961)

* fix/runner (OHIF#4965)

* fix/runner (OHIF#4966)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix/runner4 (OHIF#4967)

* fix/runner (OHIF#4968)

* fix/runner (OHIF#4969)

* fix/runner (OHIF#4970)

* fix/runner (OHIF#4971)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(ExtensionManager): getDataSources method (OHIF#4959)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* chore(deps): bump @babel/runtime-corejs3 from 7.24.7 to 7.27.0 (OHIF#4962)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump http-proxy-middleware from 2.0.7 to 2.0.9 (OHIF#4963)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump @babel/runtime from 7.26.0 to 7.27.0 in /platform/docs (OHIF#4964)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump estree-util-value-to-estree from 3.2.1 to 3.3.3 in /platform/docs (OHIF#4929)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(dicomWebClient): use public getter for activeDataSourceName instead of accessing private property (OHIF#4973)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat: Improve unsupported displayset messages (OHIF#4979)

* docs(components): Adds new components to ui-next documentation (OHIF#4974)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix docs (OHIF#4986)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix docs (OHIF#4988)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(docs): Fix SSR build errors by dynamically importing UI components and resolving other issues (OHIF#4991)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(template): Update mode template to match current implementation (OHI-1833) (OHIF#4998)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Alireza Sedghi <ar.sedghi@gmail.com>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(referencelines): and bring back the notification for worker updates but disallow duplication (OHIF#5005)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* Fix: issue OHIF#4759 Enable proper DICOM image rendering when Rescale parameters are set to null (OHIF#5003)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* docs: clarify terminology for study, series, and display sets (OHIF#5000)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* docs: add llm txt (OHIF#5009)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix/remove legacy ui (OHIF#5010)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat: improve menu modals customizations (OHIF#5011)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* refactor(viewport): Remove resize detector and optimize viewport resizing logic (OHIF#5006)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(data overlay): add foreground background control plus orientation change in the UI and add RTDOSE support (OHIF#5007)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(i18n): add Arabic translations (OHIF#5013)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat: add locale files for Russian language, translated texts in locale json files to Russian language. (OHIF#4984)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(orientationMarker): MPR orientation change should get reflected too (OHIF#5020)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(thumbnails): Enhance DICOM Thumbnail Rendering with different strategies (OHIF#5004)

Co-authored-by: Martin Bellehumeur, M. Eng. <23396581+mbellehumeur@users.noreply.github.com>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(app): Decouple colorbar UI from service and enable action menu programatic control (OHIF#5018)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(DicomWebProxyDataSource): bug fix to save Segmentation files back to Kheops (OHIF#5028)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(NotFoundStudy): Fixed the viewer not-found page when showStudyList: false (OHIF#5035)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: Added missing export for LayoutSelector in ui-next (OHIF#5040)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* Small update

* feat(actions): simplify action corner api through the toolbarService (OHIF#5033)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* ui(feat): Adds light/dark mode support for viewport overlay text and markers (OHIF#5041)

Co-authored-by: sedghi <ar.sedghi@gmail.com>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat(viewport): Added getter for presentation id provider. (OHIF#5053)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(segmentation): segmentation stats calculations were not being done on a subsequent navigation to a mode (OHIF#5046)

* fix: backward compatibility with toolbar service (OHIF#5052)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(cli): removing missing imports in mode template (OHIF#5049)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* Still working on seg

* fix(context-menu): Move the reposition logic from the context menu to the dialog component. (OHIF#5060)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(router): Expose the react router from the worklist too. (OHIF#5062)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(frame-view): After pan and/or zoom, stack scroll is now synchronized for frame view (OHIF#5067)

* fix(capture): Disable or enable the tool group based on the show flag. (OHIF#5069)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix: e2e playwright tests runnigns (OHIF#5070)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* fix(Customization): Fixed incorrect events broadcast  (OHIF#5075)

Co-authored-by: Dan Elkis <dan.elkis@signalpet.com>

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* Images Working 3.11, right panel not

* fix(ui): Prevent unintended text selection and improve component behavior (OHIF#5077)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* feat: create memo when manually adding and removing annotations (OHIF#5051)

* chore(version): version.json [skip ci]

* chore(version): Update package versions [skip ci]

* StudyBrowser Working

* Segmentation 3.11 working.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Pedro Köhler <pedrokohlerbh@gmail.com>
Co-authored-by: ohif-bot <danny.ri.brown+ohif-bot@gmail.com>
Co-authored-by: Dan Rukas <dan.rukas@gmail.com>
Co-authored-by: Alireza <ar.sedghi@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Devu-trenser <91659097+Devu-trenser@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Tang Cheng <45505657+tctco@users.noreply.github.com>
Co-authored-by: Julia Young <114963757+julia-young@users.noreply.github.com>
Co-authored-by: Ibrahim <81184787+1brahimmohamed@users.noreply.github.com>
Co-authored-by: Rafael Osipov <rafael.osipov@outlook.com>
Co-authored-by: Bill Wallace <wayfarer3130@gmail.com>
Co-authored-by: Martin Bellehumeur, M. Eng. <23396581+mbellehumeur@users.noreply.github.com>
Co-authored-by: taliabeckie <147656147+taliabeckie@users.noreply.github.com>
Co-authored-by: Dan <12800016+rinslow@users.noreply.github.com>
Co-authored-by: Celian-abd <101793092+Celian-abd@users.noreply.github.com>
Co-authored-by: Joe Boccanfuso <109477394+jbocce@users.noreply.github.com>
Co-authored-by: Alexis jankowski <73858646+Sixela33@users.noreply.github.com>
Co-authored-by: Dan Elkis <dan.elkis@signalpet.com>
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