Skip to content

feat(sw): PWA Web Share Targetでファイルを受け付けるように#16323

Open
tamaina wants to merge 15 commits intomisskey-dev:developfrom
tamaina:sw-file
Open

feat(sw): PWA Web Share Targetでファイルを受け付けるように#16323
tamaina wants to merge 15 commits intomisskey-dev:developfrom
tamaina:sw-file

Conversation

@tamaina
Copy link
Copy Markdown
Contributor

@tamaina tamaina commented Jul 25, 2025

Resolve #8880
Resolve #14193

What

  • manifest.jsonのshare_targetを諸々変更
  • sw.tsのfetchイベントハンドラで/sw/shareへの処理を追加
    • ファイル(files)をidb-keyvalのshare-files-tempに保存する
    • /shareにリダイレクト
  • /shareで、idb-keyvalのshare-files-tempを読んでPostFormのinitialLocalFilesに渡す
  • /shareはハッシュパラメータも受け取るように
  • /shareはクエリ/ハッシュパラメータのfileにDataURIを指定することでファイルを受け取れるように
  • /shareにヘッダーアクションでメニューとして「閉じる」「Misskeyへ」を追加
  • PostFormPropsinitialLocalFilesを追加
  • MkPostForm.vueprops.initialLocalFilesがあったらuploader.addFilesするように

Why

Additional info (optional)

p1.a9z.devで動作中
iOSでは非対応?

PWAを再インストールしないと画像をシェアできないかも

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 25, 2025

Codecov Report

❌ Patch coverage is 4.83871% with 59 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.03%. Comparing base (e98252a) to head (cb6e2be).
⚠️ Report is 1353 commits behind head on develop.

Files with missing lines Patch % Lines
packages/frontend/src/pages/share.vue 0.00% 50 Missing ⚠️
...ages/backend/src/server/web/ClientServerService.ts 0.00% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #16323      +/-   ##
===========================================
+ Coverage    42.56%   46.03%   +3.46%     
===========================================
  Files         1685     1762      +77     
  Lines       170650   181687   +11037     
  Branches      4223     5397    +1174     
===========================================
+ Hits         72643    83638   +10995     
- Misses       97546    98004     +458     
+ Partials       461       45     -416     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 25, 2025

このPRによるapi.jsonの差分
差分はありません。
Get diff files from Workflow Page

@tamaina tamaina marked this pull request as ready for review July 25, 2025 17:18
@syuilo
Copy link
Copy Markdown
Member

syuilo commented Aug 1, 2025

useUploader関数をFileUploaderクラスに書き換えはこっちで再実装するかも

@tamaina
Copy link
Copy Markdown
Contributor Author

tamaina commented Aug 1, 2025

useUploader関数をFileUploaderクラスに書き換えはこっちで再実装するかも

戻した

@bil-ash
Copy link
Copy Markdown

bil-ash commented Aug 31, 2025

@syuilo @tamaina Any problem with this PR? I am eagerly waiting for this to get merged since last 1 month.

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

Labels

packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR packages/sw

Projects

Development

Successfully merging this pull request may close these issues.

shareページにhash経由で小さな画像データを渡せるようにする Accept files in PWA Web Share Target

3 participants