Files
raucao d846735b1e Crossfade the wallpaper only on intentional changes
Use a new bundled image for both the welcome screen and the dashboard
fallback, and crossfade into the first feed photo only when arriving from
the welcome screen or when the wallpaper changes after the first paint (a
live rotation or a manual pick). A plain open shows the resolved photo
outright, with no transition.

- wallpaper.gjs: three layers (bundled base, last settled photo, current
  photo). The current photo fades in on load and the previous one stays
  beneath for a crossfade; the photo layer renders only from the cached
  displayUrl, so a change fades instead of flashing the bundled base.
  Reduced motion settles instantly.
- photos.js: keep the last-known-good wallpaper on a cache miss or fetch
  error; add a one-shot timer that rotates at the day/week boundary while
  the dashboard stays open; expose animateEntry for the welcome entry.
- routes/index.js: set photos.animateEntry from the transition origin. A
  strict-mode route template's `this` is not the controller, so a
  controller property never reached the component.
- config/nostr.js: alias the welcome and fallback URLs to one image.

Tests and docs updated.
2026-11-10 15:18:13 +04:00

29 lines
959 B
JavaScript

import Route from '@ember/routing/route';
import { service } from '@ember/service';
// The dashboard is only reachable once a name is known. When none is stored we
// send the user to the welcome flow instead.
export default class IndexRoute extends Route {
@service user;
@service router;
@service photos;
async beforeModel(transition) {
// Arriving from onboarding, the wallpaper crossfades from the welcome image
// into the first photo; a plain open shows the photo outright. Set on the
// service because a strict-mode route template's `this` is not the
// controller, so a controller property would not reach the component.
this.photos.animateEntry = transition.from?.name === 'welcome';
await this.user.ready;
if (!this.user.hasName) {
this.router.replaceWith('welcome');
return;
}
// Keep the dashboard current without blocking the first paint.
this.photos.refreshInBackground();
}
}