ember-page-title icon indicating copy to clipboard operation
ember-page-title copied to clipboard

liquid-fire transitions

Open evoactivity opened this issue 8 years ago • 6 comments

Let's say I have two pages, one with the title foo and one with the title bar and I'm using liquid-fire for outlet animations.

If i transition from foo to bar while the animation is occuring the page title is updated to bar | foo once complete the title is updated to bar.

That is not the behaviour I'd expect, I'd expect either an instant switch to bar or leave it as foo until the transition completes and then switch to bar.

evoactivity avatar Jan 20 '17 21:01 evoactivity

@ef4 have any ideas how to do this?

tim-evans avatar Jan 23 '17 04:01 tim-evans

Both copies of the page-title helper will necessarily still be on the page during the animation. And it looks like the title concatenation is driven purely by timing. Those two things explain the behavior. I see two possible solutions.

  1. The more robust solution would be to make the title concatenation aware of the actual route structure. Since bar is not the child of foo it would never be correct to append them -- bar should just overwrite.

  2. The less robust solution would be to detect the presence of liquid-fire and use the waitUntilIdle method on the liquid-fire-transitions service to try to correct the timing.

Today I'm not aware of public API for doing solution number 1. The router service RFC (which is beginning to land behind a feature flag now on canary) includes a get-outlet-state template keyword that would solve the problem.

You could do solution 2 now without much trouble, but I do think it's less robust, since there may be any number of other things that could alter an app's timing.

ef4 avatar Jan 23 '17 15:01 ef4

Thanks @ef4, I think the way forward is to do the second solution as a stop-gap until the first solution is available through Ember's features

tim-evans avatar Jan 23 '17 15:01 tim-evans

@tim-evans Hi Tim, has there been any progress on this?

evoactivity avatar Aug 25 '17 14:08 evoactivity

I haven't done this yet, mostly since the router api has been quite stagnant.

tim-evans avatar Aug 25 '17 14:08 tim-evans

This is still an issue.

However liquid-fire does not seem to be actively developed. Last activity on master branch is from year ago. Not sure how much traction this needs, given that last update on issue was more than 3 years go.

Nevertheless option 2 mentioned 🔝 would work but is a leak of concerns.

Router service related additional template helpers etc. from original RFC https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md - are not available as well for option 1.

I am proposing an option for addons to be able signal when title should be updated, via registration. Similar to https://github.com/emberjs/ember-test-waiters - possibly more lightweight but idea is the same. This is not perfect but less linked to all possible conflicting addons compared to option 2.

raido avatar Oct 14 '20 20:10 raido