ember-cli / ember-page-title

Page title management for Ember.js Apps
https://ember-cli.github.io/ember-page-title/
Other
188 stars 57 forks source link

liquid-fire transitions #55

Closed evoactivity closed 1 year ago

evoactivity commented 7 years ago

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.

tim-evans commented 7 years ago

@ef4 have any ideas how to do this?

ef4 commented 7 years ago

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.

tim-evans commented 7 years ago

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

evoactivity commented 7 years ago

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

tim-evans commented 7 years ago

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

raido commented 3 years ago

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.