-
Notifications
You must be signed in to change notification settings - Fork 43
pat-forward: understand the trigger auto option #643
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
Conversation
@pilz Why this has the hold merge label? |
It has triggered a diffuse fear in the design department and requires some talking first. I have put the hold label to signal that until I get a little time to talk to you about it. |
@Ale can you write me a few lines why this is needed/which problem we solve with it? Thanks! |
I think the ticket description already shows a valid use case, anyway I prepared a video that should show how cool is to have something like that: |
The problem it solves is to trigger updates of parts of the page without getting crazy storing state parameters somewhere (hidden inputs, query strings, etc...). |
This is actually extremely similar to pat-inject trigger:autoload. Pat-inject is there to load some content when a user clicks somewhere. Pat-forward is meant to forward a (click) event to another element somewhere on the page when the user clicks. Why is this so helpful? Because in situations where we have the super complex sidebar with filters and search, changes to the content may affect the sidebar (Renaming a title, closing a task…). So on (auto-)save we must also refresh the sidebar. But then the sidebar might be in a complex state where the user has selected a custom grouping and used a search term. All that would be lost if we would just reload the content. We also must pass in all the parameters of the sidebar. But they live in a separate form. Formulating such a request to save the content item becomes highly complex. Currently we don't do it. So the user completes a task and in the sidebar, the task still shows as open, until the user reloads the page. Not nice… What if we could just trigger a submit of the sidebar search form when the user toggles the workflow state to done? That would totally be enough. We just simulate the fix that the user now performs manually. We trigger a refresh of the sidebar component. This Pull Request allows us exactly that for pat-forward what we already successfully use for pat-inject.
And upon injection finish, this snipped would trigger the form in the sidebar in its current state and for the user it would magically update correctly. The code impact is minimal, we just add the trigger option. Nothing existing is changed. |
@cornae could you take a look, this is hot! |
This is a very simple and non-intrusive extension. We have still not resolved the discussion why this is necessary because the topic is very complex to discuss and requires us to dissect the currrent injections in place. I want to set up two variations of prototype pages, one with an amended injection and one with a pat-forward trigger auto solution so that we can move the discussion from theory to practice. |
Is this already deployed? I failed to find a mention of the trigger property in the documentation. Or is this on purpose because it's experimental? |
This is useful to trigger an injection after something is injected.
Example of use cases I want to solve with this change:
I do not want to pass all the search parameters during the content creation.
So, after injecting the document I trigger through pat-forward the injection of the sidebar by triggering the search button.