From 66fc462a30d60e395eeb45794ad5945fa587cde5 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Mon, 3 Aug 2026 02:22:57 +0100 Subject: [PATCH 1/3] Fix disappearing elements when editing __init__.robot. WIP select element --- src/robotide/ui/treeplugin.py | 18 +++++++++++++++++- src/robotide/version.py | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/robotide/ui/treeplugin.py b/src/robotide/ui/treeplugin.py index edbc455f7..55f1367c6 100644 --- a/src/robotide/ui/treeplugin.py +++ b/src/robotide/ui/treeplugin.py @@ -35,8 +35,9 @@ RideDataFileRemoved, RideDataChangedToDirty, RideDataDirtyCleared, RideVariableRemoved, RideVariableAdded, RideVariableMovedUp, RideVariableMovedDown, RideVariableUpdated, RideOpenResource, RideSuiteAdded, RideSelectResource, RideDataFileSet, RideItemNameChanged, - RideSettingsChanged) + RideSaving, RideSettingsChanged) from ..controller.ctrlcommands import MoveTo +from ..controller.filecontrollers import TestDataDirectoryController from ..pluginapi import Plugin from ..action import ActionInfo from ..widgets import PopupCreator @@ -111,6 +112,7 @@ def enable(self): doc=_('Show Test Suites tree panel'), position=2)) self.subscribe(self.on_tree_selection, RideTreeSelection) + self.subscribe(self.on_saving, RideSaving) self.subscribe(self.reload_tree, RideSettingsChanged) # self.save_setting('opened', True) # DEBUG: Add toggle checkbox to menu View/Hide Tree @@ -263,6 +265,20 @@ def on_tree_selection(self, message): if self.is_focused(): self._tree.tree_node_selected(message.item) + def on_saving(self, message): + changes = self.is_unsaved_changes() + selected_item = self.get_selected_item() + print(f"DEBUG: TreePlugin ENTER on_saving {message.path=} \n" + f"{message.datafile=}" + f"{changes=} model={self._model}" + f"selected_item={selected_item}") + if isinstance(message.datafile, TestDataDirectoryController): + wx.CallAfter(self.populate, self._model) + # DEBUG We also need to restore selected item and make it visible + print(f"DEBUG: TreePlugin POPULATE on_saving element selected to RESTORE " + f"-> ( {selected_item.source}, {selected_item.name} )") + wx.CallAfter(self._tree.select_node_by_data, selected_item) + def _update_tree(self, event=None): __ = event # print(f"DEBUG: treeplugin.py TreePlugin _update_tree called model={self._model}") diff --git a/src/robotide/version.py b/src/robotide/version.py index 424ad307a..81e814076 100644 --- a/src/robotide/version.py +++ b/src/robotide/version.py @@ -15,4 +15,4 @@ # # Automatically generated by `tasks.py`. -VERSION = 'v2.2.5dev7' +VERSION = 'v2.2.5dev8' From 53c13a504f624c3d19ab414ce52e7ba7770b1236 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Tue, 4 Aug 2026 01:58:48 +0100 Subject: [PATCH 2/3] New method select_node_name. WIP --- src/robotide/ui/treeplugin.py | 43 +++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/src/robotide/ui/treeplugin.py b/src/robotide/ui/treeplugin.py index 55f1367c6..a5b81de66 100644 --- a/src/robotide/ui/treeplugin.py +++ b/src/robotide/ui/treeplugin.py @@ -276,8 +276,10 @@ def on_saving(self, message): wx.CallAfter(self.populate, self._model) # DEBUG We also need to restore selected item and make it visible print(f"DEBUG: TreePlugin POPULATE on_saving element selected to RESTORE " - f"-> ( {selected_item.source}, {selected_item.name} )") - wx.CallAfter(self._tree.select_node_by_data, selected_item) + f"-> ( {selected_item.data.source}, {selected_item.source}, {selected_item.name} )") + # self._tree._get_datafile_node(selected_item.data.source) + wx.CallAfter(self._tree.select_node_by_name, selected_item.data.source, + selected_item.source, selected_item.name) def _update_tree(self, event=None): __ = event @@ -832,6 +834,33 @@ def select_node_by_data(self, controller): self.SelectItem(node) return node + def select_node_by_name(self, filepath, parent_name=None, name=None): + node = self._get_node_by_path(filepath) + print(f"DEBUG: treeplugin.py Tree select_node_by_name filepath={filepath} \n" + f" {parent_name=} {name=} {node=}") + if node: + item = self.controller.get_handler(node).item + # self.select_controller_node(node) + self.EnsureVisible(node) + self.SelectItem(node) + print(f"DEBUG: treeplugin.py Tree select_node_by_name FIRST item {item=}" + f"{type(item)} {type(node)}") + if name: + if parent_name != name: + select_item = self.controller.find_node_with_label(node, parent_name) + print(f"DEBUG: treeplugin.py Tree select_node_by_name LOOK parent={parent_name} " + f"select_item {select_item=}") + if select_item: + select_item = self.controller.find_node_with_label(select_item, name) + else: + select_item = self.controller.find_node_with_label(node, parent_name) + else: + select_item = self.controller.find_node_with_label(node, parent_name) + if select_item: + self.EnsureVisible(select_item) + self.SelectItem(select_item) + print(f"DEBUG: treeplugin.py Tree select_node_by_name FINAL {select_item=}") + def select_user_keyword_node(self, uk): parent_node = self._get_datafile_node(uk.parent.parent) if not parent_node: @@ -854,6 +883,16 @@ def _get_datafile_node(self, datafile): return node return None + def _get_node_by_path(self, path): + print(f"DEBUG: treeplugin.py Tree _get_node_by_path ENTER path={path}") + for node in self.datafile_nodes: + item = self.controller.get_handler(node).item + if hasattr(item, 'source') and item.source == path: + name = item.name if hasattr(item, 'name') else '' + print(f"DEBUG: treeplugin.py Tree _get_node_by_path FOUND node={node}, item.name={name}") + return node + return None + def get_selected_datafile(self): """Returns currently selected data file. From ba2fbc4247eb21b349fd635b0d8283ff888af707 Mon Sep 17 00:00:00 2001 From: HelioGuilherme66 Date: Fri, 7 Aug 2026 00:16:32 +0100 Subject: [PATCH 3/3] Fix missing Tree elements after saving directory node. --- CHANGELOG.adoc | 1 + README.adoc | 2 +- rtest/testdir/Suite.robot | 2 +- rtest/testdir/__init__.robot | 7 +- rtest/testdir/resources/resu.txt | 2 +- src/robotide/application/CHANGELOG.html | 2 + src/robotide/application/releasenotes.py | 3 +- src/robotide/ui/treeplugin.py | 127 +++++++++++++---------- utest/ui/test_tree_restore_selection.py | 95 +++++++++++++++++ 9 files changed, 177 insertions(+), 64 deletions(-) create mode 100644 utest/ui/test_tree_restore_selection.py diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 4d17f0750..319e63dc8 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -9,6 +9,7 @@ and this project adheres to http://semver.org/spec/v2.0.0.html[Semantic Versioni == https://github.com/robotframework/RIDE[Unreleased] === Fixed +- Fixed disappering Project Explorer tree elements, after editing directory elements (i.e. variable or keyword). - Fixed blank Project Explorer panel when docking. Long time existing issue. - Fixed bad resizing of File Explorer content when opening Test Suites. - Fix selection of items (variables, test names, keywords) from Project Explorer and highlight at Text Editor. diff --git a/README.adoc b/README.adoc index d5f1527f0..d43e6bec5 100644 --- a/README.adoc +++ b/README.adoc @@ -46,7 +46,7 @@ Likewise, the current version of wxPython, is 4.2.5, but RIDE is known to work w `pip install -U robotframework-ride` -(3.9 <= python <= 3.14) Install current development version (**2.2.5dev7**) with: +(3.9 <= python <= 3.14) Install current development version (**2.2.5dev8**) with: `pip install -U https://github.com/robotframework/RIDE/archive/develop.zip` diff --git a/rtest/testdir/Suite.robot b/rtest/testdir/Suite.robot index 78d0650e4..debc00e83 100644 --- a/rtest/testdir/Suite.robot +++ b/rtest/testdir/Suite.robot @@ -5,7 +5,7 @@ Library String *** Test Cases *** Test Case 1 - Some local keyword with arguments + Some local keyword with arguments # comment No Operation Some keyword from resource file 2 Should Be Empty ${EMPTY} 5 diff --git a/rtest/testdir/__init__.robot b/rtest/testdir/__init__.robot index 01c63325e..7385616cc 100644 --- a/rtest/testdir/__init__.robot +++ b/rtest/testdir/__init__.robot @@ -1,7 +1,6 @@ *** Settings *** -Documentation This is suite directory documentation -Force Tags force +Documentation This is suite directory documentation +Force Tags force *** Variables *** -${SCALAR} 1 - +${SCALAR} 1 diff --git a/rtest/testdir/resources/resu.txt b/rtest/testdir/resources/resu.txt index cb815b2df..f152a25ac 100644 --- a/rtest/testdir/resources/resu.txt +++ b/rtest/testdir/resources/resu.txt @@ -1,7 +1,7 @@ *** Keywords *** Some keyword from resource file [Arguments] ${argument} - [Documentation] This is documentation + [Documentation] This is documentation changed [Timeout] 1 second No Operation Log Something diff --git a/src/robotide/application/CHANGELOG.html b/src/robotide/application/CHANGELOG.html index eceb5e283..6febf0395 100644 --- a/src/robotide/application/CHANGELOG.html +++ b/src/robotide/application/CHANGELOG.html @@ -1,6 +1,8 @@ Changelog

_Changelog


All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

_1.1. Fixed

  • +Fixed disappering Project Explorer tree elements, after editing directory elements (i.e. variable or keyword). +
  • Fixed blank Project Explorer panel when docking. Long time existing issue.
  • Fixed bad resizing of File Explorer content when opening Test Suites. diff --git a/src/robotide/application/releasenotes.py b/src/robotide/application/releasenotes.py index 0b67cbad5..c10f8caa1 100644 --- a/src/robotide/application/releasenotes.py +++ b/src/robotide/application/releasenotes.py @@ -175,6 +175,7 @@ def set_content(self, html_win, content):

New Features and Fixes Highlights

    +
  • Fixed disappering Project Explorer tree elements, after editing directory elements (i.e. variable or keyword).
  • Fixed blank Project Explorer panel when docking. Long time existing issue.
  • Fixed bad resizing of File Explorer content when opening Test Suites.
  • Improved spaces detection in test suites reader.
  • @@ -236,7 +237,7 @@ def set_content(self, html_win, content):
    python -m robotide.postinstall -install

    or

    ride_postinstall.py -install
    -

    RIDE {VERSION} was released on 01/August/2026.

    +

    RIDE {VERSION} was released on 07/August/2026.