Skip to content

Graph context menus not UI mode aware - shows "Peptide" in small molecule mode #3937

@bspratt

Description

@bspratt

Summary

The "View > Retention Times > Molecule Comparison" menu navigation correctly displays "Molecule Comparison", but the graph's right-click context menu and its submenus inconsistently use "Peptide" terminology instead of adapting to the UI mode setting.

Transferred from: skyline.ms Issue #1048

Problems

  1. Right-click context menu items on RT, peak area, and mass error comparison graphs are not translated for UI mode
  2. "Graph" submenu shows "Peptide Comparison" instead of "Molecule Comparison" in small molecule/mixed mode

Root Cause

  • The BuildRTGraphMenu, peak area, and mass error context menu builders in SkylineGraphs.cs did not call PeptideToMoleculeTextMapper.TranslateMenuItems after populating context menus
  • TranslateMenuItems only translates top-level menu items — it does not recurse into DropDownItems of submenus, so nested items like "Peptide Comparison" under the "Graph" submenu were never translated

Fix

Added a CleanupZedGraphMenuItems helper method in SkylineGraphs.cs that:

  1. Removes unwanted ZedGraph menu items (set_default, show_val)
  2. Calls PeptideToMoleculeTextMapper.TranslateMenuItems on top-level context menu items
  3. Recurses into dropdown submenus to translate nested items (e.g., "Peptide Comparison" → "Molecule Comparison")

Applied to all 3 affected context menu builder methods. This also eliminates code duplication — the remove + translate pattern was repeated identically in each method.

Files Modified

  • pwiz_tools/Skyline/SkylineGraphs.cs

Verification

Tested with TestMultiSelectPeakAreaGraphAsSmallMolecules using PauseTest() to visually confirm:

  • Graph title says "Molecule Comparison"
  • Right-click context menu items use "Molecule" terminology
  • "Graph" submenu shows "Molecule Comparison" instead of "Peptide Comparison"

Getting Started

Use /pw-startissue to begin work.


Transferred from: skyline.ms Issue #1048

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingskylineSkyline application changes - create Skyline/work branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions