Skip to content

[fix] METEOR GUI FIBSEM tab: adjust size of "filename" text box#3375

Open
pieleric wants to merge 1 commit intodelmic:masterfrom
pieleric:fix-meteor-gui-fibsem-tab-adjust-size-of-filename-text-box
Open

[fix] METEOR GUI FIBSEM tab: adjust size of "filename" text box#3375
pieleric wants to merge 1 commit intodelmic:masterfrom
pieleric:fix-meteor-gui-fibsem-tab-adjust-size-of-filename-text-box

Conversation

@pieleric
Copy link
Member

Same change as in commit fe84c85, but for the FIBSEM tab, instead of
the Localization tab.
The filename text box was fixed to 150px, which left a lot of empty space between
the field and the "change..." button. In many case, because of this, the filename was clipped.
=> Adjust the sizer to let the text box expand to the entire available space.

Copilot AI review requested due to automatic review settings February 20, 2026 17:38
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 adjusts the layout of the filename text box in the FIBSEM tab to allow it to expand and fill available horizontal space, preventing filename clipping. This is the same fix that was previously applied to the Localization tab in commit fe84c85.

Changes:

  • Refactored the filename row layout from a wxFlexGridSizer to a simple wxBoxSizer with proper expansion options
  • Changed the text box width from fixed 150px to -1 (auto-size) with proportion=1 to fill available space
  • Normalized the button label from "Change…" to "change…" for consistency
  • Adjusted spacing and alignment flags for better visual layout
  • Removed the lbl_filename control reference from the generated Python code

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/odemis/gui/xmlh/resources/panel_tab_fibsem.xrc Modified the XRC resource to replace wxFlexGridSizer with wxBoxSizer and allow the filename text box to expand
src/odemis/gui/main_xrc.py Auto-generated Python file reflecting the XRC changes, including removal of lbl_filename control reference

@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

📝 Walkthrough

Walkthrough

The changes remove the lbl_filename control binding (self.lbl_filename = xrc.XRCCTRL(self, "lbl_filename")) from the xrcfr_acq constructor and delete the corresponding <object class="wxStaticText" name="lbl_filename"> element from the UI resource. The FIBSEM filename area in panel_tab_fibsem.xrc was restructured from a nested wxFlexGridSizer to a simpler linear arrangement: label alignment set to wxALIGN_CENTER_VERTICAL, adjusted border and expansion flags, text control size/option updated, and the change-button label altered from "Change…" to "change…". No other control bindings or public signatures were modified.

Sequence Diagram(s)

(omitted)

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and specifically describes the main change: adjusting the filename text box size in the FIBSEM tab's GUI.
Description check ✅ Passed The description is clearly related to the changeset, explaining the rationale (fixed 150px causing clipping) and solution (adjust sizer for expansion).

✏️ 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

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

🧹 Nitpick comments (1)
src/odemis/gui/main_xrc.py (1)

10192-10203: Inconsistent indentation on the button sizer item.

The inner content of the ImageTextButton sizer item (lines 10193–10203) retains deeper indentation from the old nested wxFlexGridSizer structure, while its sibling sizer items (the wxStaticText at line 10171 and wxTextCtrl at line 10177) use a shallower, consistent indent level. This doesn't affect runtime behavior but hurts readability.

🧹 Proposed indentation fix
                                <object class="sizeritem">
-                                      <object class="ImageTextButton" name="btn_cryosecom_change_file">
-                                        <height>24</height>
-                                        <face_colour>def</face_colour>
-                                        <label>change…</label>
-                                        <XRCED>
-                                          <assign_var>1</assign_var>
-                                        </XRCED>
-                                      </object>
-                                      <flag>wxLEFT</flag>
-                                      <border>5</border>
-                                    </object>
+                                  <object class="ImageTextButton" name="btn_cryosecom_change_file">
+                                    <height>24</height>
+                                    <face_colour>def</face_colour>
+                                    <label>change…</label>
+                                    <XRCED>
+                                      <assign_var>1</assign_var>
+                                    </XRCED>
+                                  </object>
+                                  <flag>wxLEFT</flag>
+                                  <border>5</border>
+                                </object>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/odemis/gui/main_xrc.py` around lines 10192 - 10203, The sizeritem
containing the ImageTextButton named btn_cryosecom_change_file has extra/deeper
indentation leftover from a previous nested wxFlexGridSizer; reformat the block
for that <object class="sizeritem"> so its inner lines (the ImageTextButton
properties: <height>, <face_colour>, <label>, <XRCED> and related tags) use the
same shallower indentation level as its sibling sizeritems (the wxStaticText and
wxTextCtrl entries) to improve readability and maintain consistent XML
structure.
🤖 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/main_xrc.py`:
- Around line 10168-10209: The XRC removed the lbl_filename widget but
_on_chkbox_save_acquisition still references
self._panel.lbl_filename.Enable(enable), causing an AttributeError; restore a
wxStaticText named lbl_filename in the same sizer as txt_filename and
btn_cryosecom_change_file (matching the original label styling, e.g.,
"Filename") so self._panel.lbl_filename exists, or update the code to reference
an existing control (txt_filename) in the _on_chkbox_save_acquisition
method—prefer restoring the lbl_filename control to keep the original UI
contract.

---

Nitpick comments:
In `@src/odemis/gui/main_xrc.py`:
- Around line 10192-10203: The sizeritem containing the ImageTextButton named
btn_cryosecom_change_file has extra/deeper indentation leftover from a previous
nested wxFlexGridSizer; reformat the block for that <object class="sizeritem">
so its inner lines (the ImageTextButton properties: <height>, <face_colour>,
<label>, <XRCED> and related tags) use the same shallower indentation level as
its sibling sizeritems (the wxStaticText and wxTextCtrl entries) to improve
readability and maintain consistent XML structure.

@pieleric pieleric requested a review from ilyushkin February 20, 2026 17:56
Same change as in commit fe84c85, but for the FIBSEM tab, instead of
the Localization tab.
The filename text box was fixed to 150px, which left a lot of empty space between
the field and the "change..." button. In many case, because of this, the filename was clipped.
=> Adjust the sizer to let the text box expand to the entire available space.
@pieleric pieleric force-pushed the fix-meteor-gui-fibsem-tab-adjust-size-of-filename-text-box branch from 982dabf to 7c22db8 Compare February 23, 2026 22:26
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.

♻️ Duplicate comments (1)
src/odemis/gui/main_xrc.py (1)

10171-10176: Confirm that lbl_filename removal is safe across the codebase.

The named lbl_filename widget was replaced with an anonymous wxStaticText. A past review flagged that cryo_acq.py references self._panel.lbl_filename.Enable(enable). The enriched summary indicates cryo_acq.py was also updated to remove this reference, but that file is not included in this review.

#!/bin/bash
# Verify no remaining references to lbl_filename in the codebase
echo "=== Searching for lbl_filename references in Python files ==="
rg -n 'lbl_filename' --type py

echo ""
echo "=== Searching for lbl_filename references in XRC/XML files ==="
rg -n 'lbl_filename' --type xml
rg -n 'lbl_filename' -g '*.xrc'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/odemis/gui/main_xrc.py` around lines 10171 - 10176, Search the repo for
any remaining references to the removed widget name "lbl_filename" (e.g.,
occurrences of lbl_filename and the call self._panel.lbl_filename.Enable) and
either restore the named wxStaticText (give it name="lbl_filename" in
main_xrc.py) or update all callers (such as cryo_acq.py) to reference the
panel's new API (find the panel class that used lbl_filename and replace calls
with the correct method/property). Ensure there are no leftover Python or
XRC/XML references; if cryo_acq.py still calls
self._panel.lbl_filename.Enable(enable), change that call to the new widget
reference or remove/update it accordingly so no runtime AttributeError occurs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@src/odemis/gui/main_xrc.py`:
- Around line 10171-10176: Search the repo for any remaining references to the
removed widget name "lbl_filename" (e.g., occurrences of lbl_filename and the
call self._panel.lbl_filename.Enable) and either restore the named wxStaticText
(give it name="lbl_filename" in main_xrc.py) or update all callers (such as
cryo_acq.py) to reference the panel's new API (find the panel class that used
lbl_filename and replace calls with the correct method/property). Ensure there
are no leftover Python or XRC/XML references; if cryo_acq.py still calls
self._panel.lbl_filename.Enable(enable), change that call to the new widget
reference or remove/update it accordingly so no runtime AttributeError occurs.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 982dabf and 7c22db8.

📒 Files selected for processing (3)
  • src/odemis/gui/cont/acquisition/cryo_acq.py
  • src/odemis/gui/main_xrc.py
  • src/odemis/gui/xmlh/resources/panel_tab_fibsem.xrc
💤 Files with no reviewable changes (1)
  • src/odemis/gui/cont/acquisition/cryo_acq.py

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