Skip to content

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

Open
tamaina wants to merge 19 commits into
misskey-dev:developfrom
tamaina:sw-file
Open

feat(sw): PWA Web Share Targetでファイルを受け付けるように#16323
tamaina wants to merge 19 commits into
misskey-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 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 24.89%. Comparing base (2b016d6) to head (0a184e8).

Files with missing lines Patch % Lines
packages/frontend/src/components/MkPostForm.vue 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #16323      +/-   ##
===========================================
- Coverage    24.89%   24.89%   -0.01%     
===========================================
  Files         1160     1160              
  Lines        39553    39555       +2     
  Branches     11016    11013       -3     
===========================================
  Hits          9846     9846              
- Misses       23806    23807       +1     
- Partials      5901     5902       +1     

☔ 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.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

Backend memory usage comparison

Before GC

Metric base (MB) head (MB) Diff (MB) Diff (%)
VmRSS 306.69 MB 304.84 MB -1.85 MB -0.60%
VmHWM 306.69 MB 304.84 MB -1.85 MB -0.60%
VmSize 23172.34 MB 23171.29 MB -1.05 MB 0%
VmData 1372.47 MB 1371.29 MB -1.17 MB -0.08%

After GC

Metric base (MB) head (MB) Diff (MB) Diff (%)
VmRSS 306.76 MB 305.95 MB -0.81 MB -0.26%
VmHWM 306.76 MB 305.95 MB -0.81 MB -0.26%
VmSize 23172.67 MB 23172.37 MB -0.30 MB 0%
VmData 1372.80 MB 1372.38 MB -0.42 MB -0.03%

After Request

Metric base (MB) head (MB) Diff (MB) Diff (%)
VmRSS 307.25 MB 306.35 MB -0.89 MB -0.29%
VmHWM 307.25 MB 306.35 MB -0.89 MB -0.29%
VmSize 23172.84 MB 23172.37 MB -0.46 MB 0%
VmData 1372.97 MB 1372.38 MB -0.59 MB -0.04%

See workflow logs for details

@syuilo
Copy link
Copy Markdown
Member

syuilo commented May 30, 2026

対応デバイス持ってないのだけども実際に動作してる感じかしら

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 size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Development

Successfully merging this pull request may close these issues.

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

5 participants