Skip to content

Comments

[feat] METEOR overlay cryofeature: clarify the current posture in "recalculate position" message box#3379

Open
pieleric wants to merge 1 commit intodelmic:masterfrom
pieleric:feat-meteor-overlay-cryofeature-clarify-the-current-posture-in-recalculate-position-message-box
Open

[feat] METEOR overlay cryofeature: clarify the current posture in "recalculate position" message box#3379
pieleric wants to merge 1 commit intodelmic:masterfrom
pieleric:feat-meteor-overlay-cryofeature-clarify-the-current-posture-in-recalculate-position-message-box

Conversation

@pieleric
Copy link
Member

In the FIBSEM tab, there are two view: SEM and FIB. If one moves the
feature in the FIB view, she/he could beleive that this changes the
MILLING posture, while moving the feature in SEM view would adjust the
SEM posture. However, that's not the case, it's unrelated to the view,
and only linked to the current posture (based on the current stage position).

So adjust the dialog to highlight which posture is modified, if not
updating all the posture.

…calculate position" message box

In the FIBSEM tab, there are two view: SEM and FIB. If one moves the
feature in the FIB view, she/he could beleive that this changes the
MILLING posture, while moving the feature in SEM view would adjust the
SEM posture. However, that's not the case, it's unrelated to the view,
and only linked to the current posture (based on the current stage position).

So adjust the dialog to highlight which posture is modified, if not
updating all the posture.
Copilot AI review requested due to automatic review settings February 23, 2026 13:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the clarity of the dialog shown when moving cryo features in the FIBSEM tab. The dialog now explicitly indicates which posture (SEM IMAGING, MILLING, FIB IMAGING, etc.) is being modified, addressing user confusion about whether the change affects the view-specific posture or the current posture based on stage position.

Changes:

  • Import POSITION_NAMES dictionary to map posture constants to human-readable names
  • Update dialog message to specify which posture is being modified
  • Customize button labels to show "All" vs "Only [posture name]" options

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

📝 Walkthrough

Walkthrough

This change modifies the user confirmation dialog in the cryo feature overlay's position update workflow. It imports POSITION_NAMES to derive the current posture name and updates the dialog message and button labels to explicitly present two options: updating the feature position for all other postures versus only the current posture. The underlying logic for processing user confirmation and updating positions remains unchanged.

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: clarifying the current posture in the recalculate position message box for the METEOR overlay cryofeature component.
Description check ✅ Passed The description directly relates to the changeset by explaining the user confusion about postures in different views and how the PR clarifies which posture is being modified in the dialog.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/odemis/gui/comp/overlay/cryo_feature.py`:
- Around line 254-258: The call to box.SetYesNoLabels(...) may fail; check its
boolean return and handle the False case by updating the dialog text to a
generic yes/no question that matches the default "Yes"/"No" labels.
Specifically, after creating the wx.MessageDialog as box and calling
box.SetYesNoLabels("All", f"Only {current_posture_name}"), test the return value
and if it is False call box.SetMessage(...) (or otherwise set the dialog text)
to a fallback like "Apply this feature position only to the current posture
(Yes) or to all postures (No)?" so the prompt makes sense when the custom labels
couldn’t be applied.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6dea6a and 191981f.

📒 Files selected for processing (1)
  • src/odemis/gui/comp/overlay/cryo_feature.py

Comment on lines 254 to +258
box = wx.MessageDialog(wx.GetApp().main_frame,
message="Do you want to recalculate this feature position for all other postures?",
message=f"Do you want to update this feature position only for {current_posture_name} "
"or recalculate for all other postures?",
caption="Recalculate feature positions?", style=wx.YES_NO | wx.ICON_QUESTION | wx.CENTER)
box.SetYesNoLabels("All", f"Only {current_posture_name}")
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cat -n src/odemis/gui/comp/overlay/cryo_feature.py | sed -n '250,265p'

Repository: delmic/odemis

Length of output: 1179


🌐 Web query:

wxPython SetYesNoLabels return value documentation

💡 Result:

wx.MessageDialog.SetYesNoLabels(yes, no) returns a bool:

  • True: the Yes/No button labels were successfully changed.
  • False: labels couldn’t be changed (e.g., not supported on that platform/port). In that case the dialog keeps the standard “Yes”/“No” labels. [1]

Also, changing the labels does not change the result code returned by ShowModal()—it still returns one of wx.ID_OK, wx.ID_CANCEL, wx.ID_YES, or wx.ID_NO (the custom IDs only affect the displayed text). [1]

Sources:
[1] (docs.wxpython.org)

Citations:


SetYesNoLabels return value is unchecked — fallback message missing

SetYesNoLabels may return False to indicate that the labels couldn't be changed; True means they were set successfully. When it fails the buttons will still read "Yes" / "No", but the current message text ("…only for X or recalculate for all other postures?") is not a yes/no question, leaving users with a confusing prompt. The recommended pattern is to check the return value and, in the else branch, set a rephrased message that fits the generic labels.

🛡️ Proposed fix — add a fallback message
-            box.SetYesNoLabels("All", f"Only {current_posture_name}")
+            if not box.SetYesNoLabels("All", f"Only {current_posture_name}"):
+                # Custom labels not supported on this platform; rephrase for generic Yes/No
+                box.SetMessage(f"Do you want to recalculate this feature position "
+                               f"for all other postures (Yes), or keep the change "
+                               f"only for {current_posture_name} (No)?")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
box = wx.MessageDialog(wx.GetApp().main_frame,
message="Do you want to recalculate this feature position for all other postures?",
message=f"Do you want to update this feature position only for {current_posture_name} "
"or recalculate for all other postures?",
caption="Recalculate feature positions?", style=wx.YES_NO | wx.ICON_QUESTION | wx.CENTER)
box.SetYesNoLabels("All", f"Only {current_posture_name}")
box = wx.MessageDialog(wx.GetApp().main_frame,
message=f"Do you want to update this feature position only for {current_posture_name} "
"or recalculate for all other postures?",
caption="Recalculate feature positions?", style=wx.YES_NO | wx.ICON_QUESTION | wx.CENTER)
if not box.SetYesNoLabels("All", f"Only {current_posture_name}"):
# Custom labels not supported on this platform; rephrase for generic Yes/No
box.SetMessage(f"Do you want to recalculate this feature position "
f"for all other postures (Yes), or keep the change "
f"only for {current_posture_name} (No)?")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/odemis/gui/comp/overlay/cryo_feature.py` around lines 254 - 258, The call
to box.SetYesNoLabels(...) may fail; check its boolean return and handle the
False case by updating the dialog text to a generic yes/no question that matches
the default "Yes"/"No" labels. Specifically, after creating the wx.MessageDialog
as box and calling box.SetYesNoLabels("All", f"Only {current_posture_name}"),
test the return value and if it is False call box.SetMessage(...) (or otherwise
set the dialog text) to a fallback like "Apply this feature position only to the
current posture (Yes) or to all postures (No)?" so the prompt makes sense when
the custom labels couldn’t be applied.

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.

1 participant