Skip to content

書き出し時、スプラッシュ画像が UUID 名のまま出力される(slug 名にしてほしい) #110

Description

@kochizufan

事象

書き出したアプリで、スプラッシュ画像が内部保存名(UUID)のまま出力される。

書き出し結果:

img/e987a508-0229-4137-a324-89f8c1703ebc.png

index.html からも UUID のまま参照される:

<meta property="og:image" content="https://s.maplat.jp/r/hiroshimamap/img/e987a508-0229-4137-a324-89f8c1703ebc.png">

該当箇所

electron/services/AppExportService.ts:563-569 — 内部名をそのままコピー先のファイル名にしている。

const splash = String(document.appSettings?.splash || '');
if (splash) {
  const from = path.join(this.saveFolder, 'img', splash);
  if (await fs.pathExists(from)) {
    await fs.copy(from, path.join(outDir, 'img', splash));
  } else {
    warnings.push('appedit.export.missing_splash');
  }
}

695-696 で app JSON にも内部名がそのまま入る。

const splash = String(document.appSettings?.splash || '');
if (splash) out.splash = splash;

求めること

書き出し時は slug 由来の名前に変換してほしい。

内部保存が UUID なのは slug 変更に強くするためで妥当だが、書き出し成果物は公開物であり、UUID のファイル名は次の点で不都合がある。

  • og:image の URL に UUID が出る(SNS シェア時に人目に触れる)
  • 書き出しディレクトリを人が見たときに何の画像か分からない
  • PWA 側は既に pwa/{slug}/ と slug 名で出ているため、成果物内で命名が不揃い

img/{slug}.png(あるいは img/{slug}_splash.png)のような形が望ましい。

補足

これは内部保存を UUID に統一する話(#109)と矛盾しない。内部は UUID 正準、書き出し時に slug へ解決という形にすれば両立する。POI の icon 参照が package export 時にのみ具体パスへ解決される設計(POI-117)と同じ考え方が使える。

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions