Skip to content

Fix tree disappearing - #3061

Merged
HelioGuilherme66 merged 3 commits into
robotframework:developfrom
HelioGuilherme66:fix_tree_disappearing
Aug 1, 2026
Merged

Fix tree disappearing#3061
HelioGuilherme66 merged 3 commits into
robotframework:developfrom
HelioGuilherme66:fix_tree_disappearing

Conversation

@HelioGuilherme66

Copy link
Copy Markdown
Member

No description provided.

HelioGuilherme66 and others added 3 commits August 1, 2026 17:32
The Tree is a CustomTreeCtrl, i.e. a wx.ScrolledWindow. AUI reparents the
managed window when a floating pane is docked, and on wxGTK a reparented
ScrolledWindow permanently stops receiving paint events: the widget keeps
its parent, size, visibility and contents, but OnPaint is never called
again, in any parent, for the rest of the session.

Measured with a paint counter: while floating it kept climbing, and from
the first dock onwards it froze and never moved again, including through
further float/dock cycles. Refresh(), Update(), Hide/Show, re-Reparent,
SendSizeEvent, Freeze/Thaw, Layout, Enable cycling, size toggling and
InvalidateBestSize were all tried against a standalone reproducer and
none of them revived it.

AUI now manages a plain wx.Panel holder with the Tree as its sizer child,
so the ScrolledWindow is never reparented. This is the idiom the Files
pane already uses (FileExplorer is a wx.Panel wrapping its tree_ctrl),
which is why that pane was never affected. self.tree is still the Tree,
so the plugin API is unchanged; only the AUI registration points move to
the holder, and on_show_tree shows the holder and pane as well so F12
does not reveal the tree inside a still-hidden parent.

Also drop the tree rebuilding that hung off UI events:

- EVT_SHOW was bound to on_show_tree, which calls populate() and so
  DeleteAllItems(): the panel merely becoming visible destroyed every
  node and its handler data. EVT_MOVE did the same on every pane move.
  Repopulating now happens only on explicit paths (startup, enable(),
  opening a suite, F12, theme change).
- The show_count parity counter existed only to damp that re-entrancy.
  It made behaviour depend on the parity of all previous calls, which is
  why the symptom looked intermittent.
- on_show_tree populated twice (directly and again via _update_tree),
  and _update_tree called refresh_view() which populate() already does.
- OnFloatDock no longer rebuilds the tree. With the parity counter gone
  it would repopulate on every float and dock, and refresh_view()
  re-selects the first datafile node, so docking would have reset the
  current selection every time.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
RIDE is a wxPython GUI with no in-process automation API, and no unit test
covers docking, painting or pane layout -- the areas where its long-standing
bugs live. Verifying a UI change meant launching by hand and looking.

This adds a driver that runs the real app headlessly (Xvfb + xfwm4 + XTEST
input via xdotool) and observes it with screenshots, plus a SKILL.md that
documents it. Every command in the skill was executed while writing it.

The driver can launch, screenshot, click, send keys, toggle the tree via the
View menu, and drag the Test Suites pane between floating and docked using a
real stepped drag onto the AUI docking guide.

check-tree turns "the panel went blank" into an assertion: it counts unique
colours in the tree pane, exiting 0 for RENDERED and 1 for BLANK. Verified in
both directions against the blank-on-dock bug -- HEAD~1 reports 2 colours
(BLANK), HEAD reports 585 (RENDERED). RIDE_SRC points the driver at another
checkout, so an old commit can be run with today's driver to A/B a GUI
regression.

Traps found while building it, all documented in Gotchas:

- Without PYTHONPATH=src, `python -m robotide.__init__` imports the installed
  package from site-packages, so you silently test released code. The driver
  logs the resolved robotide path.
- A window manager is required; without one AUI floating mini-frames misbehave.
- `xdotool key --window` sends a synthetic event that GTK ignores; only XTEST
  works. The F12 accelerator is unreliable even so, hence toggle-tree.
- RIDE captures stdout, so print() inside the app never reaches the terminal.
- Runs rewrite ~/.robotframework/ride/settings.cfg; `up` backs it up and `down`
  restores it.
- The floating Files pane overlaps the tree region and leaks colours into
  check-tree, so it gets parked first.
- check-tree cannot distinguish a blank pane from a hidden one, so dock-tree
  must run immediately before it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@HelioGuilherme66 HelioGuilherme66 added this to the v2.3 milestone Aug 1, 2026
@HelioGuilherme66 HelioGuilherme66 added the enhancement Request for improvement: either for an existing feature or a new one label Aug 1, 2026
@HelioGuilherme66
HelioGuilherme66 merged commit 59d5f06 into robotframework:develop Aug 1, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Request for improvement: either for an existing feature or a new one

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant