[fix] METEOR GUI FIBSEM tab: adjust size of "filename" text box#3375
[fix] METEOR GUI FIBSEM tab: adjust size of "filename" text box#3375pieleric wants to merge 1 commit intodelmic:masterfrom
Conversation
There was a problem hiding this comment.
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_filenamecontrol 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 |
📝 WalkthroughWalkthroughThe changes remove the Sequence Diagram(s)(omitted) Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
ImageTextButtonsizer item (lines 10193–10203) retains deeper indentation from the old nestedwxFlexGridSizerstructure, while its sibling sizer items (thewxStaticTextat line 10171 andwxTextCtrlat 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.
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.
982dabf to
7c22db8
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/odemis/gui/main_xrc.py (1)
10171-10176: Confirm thatlbl_filenameremoval is safe across the codebase.The named
lbl_filenamewidget was replaced with an anonymouswxStaticText. A past review flagged thatcryo_acq.pyreferencesself._panel.lbl_filename.Enable(enable). The enriched summary indicatescryo_acq.pywas 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
📒 Files selected for processing (3)
src/odemis/gui/cont/acquisition/cryo_acq.pysrc/odemis/gui/main_xrc.pysrc/odemis/gui/xmlh/resources/panel_tab_fibsem.xrc
💤 Files with no reviewable changes (1)
- src/odemis/gui/cont/acquisition/cryo_acq.py
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.