Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added expand/collapse functionalities to relationship formwidget #1374

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

Open
damsfx wants to merge 9 commits into wintercms:develop
base: develop
Choose a base branch
Loading
from damsfx:collapsing-relation-formwidget

Conversation

@damsfx
Copy link
Contributor

@damsfx damsfx commented Jun 24, 2025

This allow relation model with nested tree trait to display a expandable/collapsable list of checkboxes.

relation_with_tree

The field config allow two new options :

  • displayTree: (bool) display the related model as a tree structure
  • quickTreeActions: (bool) show tree quick actions (expand all nodes, collapse all nodes and expand only selected nodes)

bennothommo, willouch, jaxwilko, and WebVPF reacted with heart emoji
Copy link
Member

@damsfx ooo, I like this. And in Snowboard too! 😍

Couple of quick comments/questions:

  • How performant is it with a whole heap of items (like, say, 100s of items)?
  • Could the animation be a touch faster? Might be just on the border of being a bit too slow to feel "snappy".

Copy link
Contributor Author

damsfx commented Jun 27, 2025
edited
Loading

@bennothommo

And in Snowboard too! 😍

Definitely yes!
The more I practice, the more I love it! It's good to be back in a vanilla javascript environment.

Despite this, a function written in jQuery is still called to update the scroll bar. :o(

How performant is it with a whole heap of items (like, say, 100s of items)?

The tree structure used for my tests and visible in the animation above contains 550 nodes spread over 4 levels of depth.
I can always do a test with more nodes.

Could the animation be a touch faster? Might be just on the border of being a bit too slow to feel "snappy".

For sure.

LukeTowers reacted with heart emoji

Copy link
Contributor Author

damsfx commented Jun 27, 2025

@bennothommo

Latest update :

  • Use promise to adjust srcollbar after expand/collaspe node(s)
  • CloseAll() close only opened nodes instead of all nodes
  • Reduce animation timmings
  • Use CSS animation end to trigger scrollbar update

Copy link
Member

@damsfx don't be too concerned if you need to fall back on jQuery to do something in the Backend. A lot of the Backend still uses it and the goal of Snowboard was to remove the dependency of jQuery for the CMS side in particular.

damsfx reacted with thumbs up emoji

Copy link
Member

@bennothommo are you happy with this as it is?

@damsfx is there a related docs PR?

@LukeTowers LukeTowers added needs review Issues/PRs that require a review from a maintainer needs docs Issues/PRs that require changes to the documentation to be completed labels Jul 16, 2025
Copy link
Contributor Author

damsfx commented Jul 16, 2025

@damsfx is there a related docs PR?

Not yet, but I can add a pending PR for this.

LukeTowers reacted with heart emoji

Copy link
Contributor Author

damsfx commented Jul 18, 2025
edited
Loading

@damsfx is there a related docs PR?

@LukeTowers Done : wintercms/docs#243

damsfx added a commit to Hounddd/wn-enhancedrelation-plugin that referenced this pull request Aug 8, 2025
Copy link
Contributor Author

damsfx commented Sep 5, 2025

@bennothommo I know your time is precious, but if you have 5 mins to take a look and give me a little feedback if you see any improvements to be made.
Thank you for your time.

Copy link
Member

@damsfx sorry for the delay. Looks great, and the timing of the animation is much better.

Only issue I can see now is that it appears that some plugins and themes were added in your most recent commit:
90fbd40

Could you make sure these are not included in your branch? Once that's done, @LukeTowers should be able to merge if he's happy with it.

@bennothommo bennothommo removed the needs review Issues/PRs that require a review from a maintainer label Sep 9, 2025
Copy link
Member

@bennothommo bennothommo left a comment

Choose a reason for hiding this comment

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

Approved, pending removal of plugins and themes in recent commit

Copy link
Contributor Author

damsfx commented Sep 9, 2025
edited
Loading

pending removal of plugins and themes in recent commit

😱🙄 Oh, I was really distracted!
Thanks for reminding me.

Done !

bennothommo reacted with heart emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@LukeTowers LukeTowers LukeTowers left review comments

@bennothommo bennothommo bennothommo approved these changes

Assignees

No one assigned

Labels

needs docs Issues/PRs that require changes to the documentation to be completed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /