Skip to content

Fix SelectFromList retrieving behaviour#2806

Merged
jmcouffin merged 3 commits intopyrevitlabs:developfrom
MohamedAsli:selectfromlist-fix
Sep 25, 2025
Merged

Fix SelectFromList retrieving behaviour#2806
jmcouffin merged 3 commits intopyrevitlabs:developfrom
MohamedAsli:selectfromlist-fix

Conversation

@MohamedAsli
Copy link
Copy Markdown
Contributor

Description

Fixes multiselect bug in SelectFromList where only selections from the currently active group were returned, losing selections from other groups.
This behavior seems unintended, as there's no logical reason for selections to be lost when switching between groups.

What I've changed:

  • Added _get_all_ctx() helper method to return items from all groups
  • Modified _get_options() to use _get_all_ctx() instead of _get_active_ctx() in multiselect mode
  • Preserves existing behavior for non-grouped contexts and single-select

No regressions detected as far as I tested


Checklist

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black
  • Changes are tested and verified to work as expected.

Related Issues

#2286

…ntexts (not only filtered or currently displayed group)
Copy link
Copy Markdown
Contributor

@devloai devloai bot left a comment

Choose a reason for hiding this comment

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

PR Summary:

Fixes multiselect bug in SelectFromList where only selections from the currently active group were returned, losing selections from other groups. Adds _get_all_ctx() helper method and modifies _get_options() to use it instead of _get_active_ctx() in multiselect mode.

Review Summary:

The fix correctly addresses the reported issue and the implementation is technically sound. However, this introduces a breaking change that contradicts explicit maintainer guidance from issue #2286, where @sanzoghenzo recommended implementing this via an optional parameter to maintain backward compatibility. The current approach changes default behavior for existing users.

Follow-up suggestions:

  • @devloai implement backward compatibility using an optional parameter as suggested by the maintainer
  • @devloai add the new parameter to class docstring and setup method

@MohamedAsli
Copy link
Copy Markdown
Contributor Author

MohamedAsli commented Sep 15, 2025

Got inspired by @onomou's snippet, with a minor difference :

we always should use _get_all_ctx() even if return_all == false, because this argument is only meant to return all items values even if they are unchecked, in order to get their respective states.

Copy link
Copy Markdown
Contributor

@sanzoghenzo sanzoghenzo left a comment

Choose a reason for hiding this comment

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

Devlo misunderstood things a little, here's my two cents...

@MohamedAsli
Copy link
Copy Markdown
Contributor Author

@jmcouffin should we merge this ?

@jmcouffin
Copy link
Copy Markdown
Contributor

jmcouffin commented Sep 22, 2025

@MohamedAsli If you resolved the latest comment from Andrea, yes

@MohamedAsli
Copy link
Copy Markdown
Contributor Author

Sorry for the late reply, I got sidetracked, then forgot about the remaining modification

@sanzoghenzo
Copy link
Copy Markdown
Contributor

My focus on pythyon 3.10+ collides with pyRevit 😅 We can ignore my last comment and proceed with the merge!

@MohamedAsli
Copy link
Copy Markdown
Contributor Author

Your comment came in just as I pushed my commit :)
We can include the generator anyway now that it's done

@MohamedAsli
Copy link
Copy Markdown
Contributor Author

@MohamedAsli If you resolved the latest comment from Andrea, yes

@jmcouffin We're good now, you can merge it whenever you have some bandwidth ;)

@jmcouffin jmcouffin merged commit 118db80 into pyrevitlabs:develop Sep 25, 2025
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25268+1757-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1336-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1431-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1436-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25269+1822-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25271+1719-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2003-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2012-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2017-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25272+2149-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 1, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25274+1734-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 4, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25277+1425-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 4, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25277+1427-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 6, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25279+2157-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 7, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25280+0218-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 7, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25280+1054-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 7, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25280+1057-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 9, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25282+1656-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25283+0140-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25286+1022-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25287+0905-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25287+1000-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25288+0613-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25293+0755-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25293+0828-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25293+1113-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25293+1234-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25295+0707-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25296+0824-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25296+0837-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25296+0923-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25300+1037-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25301+1412-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25301+1521-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25302+0921-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25302+0949-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25302+1503-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25307+1644-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25307+1935-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25307+2011-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25307+2045-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.3.0.25307+2237-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 4, 2025

📦 New work-in-progress (wip) builds are available for 5.3.0.25308+0721-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 4, 2025

📦 New public release are available for 5.3.0.25307+2146

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.

3 participants