Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dynamic selection #256

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

Fix dynamic selection #256

wants to merge 14 commits into from

Conversation

lapp0
Copy link
Collaborator

@lapp0 lapp0 commented Dec 29, 2021

Selecting an item in a DynamicAttrsOf or DynamicListOf changes the navlist to a StaticAttrsOf. This is incorrect behavior, the selected attributes type shouldn't be considered when determining the navlist class, the attribute containing the navlist should determine the navlist class.

Single/Double click: fixes #173

  • Single click to show selected items fields, double click to show item in navlist

Dynamic Navlist Mutation

  • Ensure swap_options and refresh are called for DynamicListOf.up_clicked and down_clicked.
  • In option tree, ensure if one child is a list index, all are list indices
  • In option tree, ensure if children are list indices, they are automatically sorted.
  • ensure swaps show up in diff
    • accomplished by fixing OptionTree.rename_attribute

Bugs:

  • It was found that EitherType(OneOfType()) is broken because the FieldWidget cannot find EitherType.choices. Ensure choices can be discovered.
  • insert_items dead code needs to be removed

Documentation

  • update architecture.org

Further PRs (before v0.2 release):

  • Rework DynamicListOf and DynamicAttrsOf so it follows an update-StateModel -> refresh navlist procedure to isolate the source of state to one place. This applies to all operations.
  • Don't edit on double click, edit on f2
  • Apply max_renderable_field_widgets so the universe of fields aren't rendered.

itemWasSingleClicked = QtCore.pyqtSignal()
itemWasDoubleClicked = QtCore.pyqtSignal()

DOUBLE_CLICK_TIMEOUT = 200 # ms
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

300

@@ -351,6 +351,9 @@ def child_type(self):
else:
raise TypeError("Attempted to get child types, but no Either.subtypes allow children.", self)

def get_child_type(self, type_cls):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

get_child_of_type

@@ -45,7 +45,8 @@ def rename_option(self, old_option, option):
self._record_update(update)

def swap_options(self, option0, option1):
placeholder = str(uuid.uuid4())
# TODO: fix this hack, only using <name> because it isn't shown in OptionTree.children
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fix in #260

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.

In navlist, single click to show fieldsview, double click to navigate to that option
1 participant