Mobile: opening an attachment names the file after the link text instead of the imeta filename
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 90/100
調査の方向性
mobile/lib/features/channels/message_content.dart の _buildLink から始め、次に mobile/lib/features/channels/message_media.dart の ImetaEntry.filename を調べます。mobile/test/features/channels/message_content_test.dart にある「opens local file links through an authenticated download」の近くの widget テストを実行します。imeta filename を持つラベル付き添付ファイルがそのファイル名で開かれ、imeta filename のないリンクはリンクテキストを維持すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
On mobile, tapping a file attachment link downloads the file and opens it under the link text instead of the attachment's imeta filename. When the label is prose rather than a file name, the opened or saved file loses its real name and extension.
Where
mobile/lib/features/channels/message_content.dart, in _buildLink: the authenticated download is opened with the link text as the file name:
await ref.read(openDownloadedFileProvider)(
url,
auth.headersFor(url),
text,
);
_buildLink already receives the matching ImetaEntry? imeta, and ImetaEntry (mobile/lib/features/channels/message_media.dart) parses filename. It just isn't used here.
Steps to reproduce
- Send a message with a non-media attachment whose link label is not the file name, e.g. content
[Quarterly report](https://<relay>/media/<sha256>.pdf)withimetacontainingfilename q3-report.pdf. - Tap the link on mobile.
Expected: the file opens as q3-report.pdf.
Actual: it is opened under Quarterly report, without the .pdf extension, so the system viewer may not recognize it.
Suggested fix
Prefer the imeta filename and fall back to the link text:
imeta?.filename ?? text,
A widget test next to opens local file links through an authenticated download in mobile/test/features/channels/message_content_test.dart can pin it, with a labelled link plus an imeta tag carrying filename.
- 主要言語
- Rust
- スター
- 35.6k
- フォーク
- 4.7k
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 188
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
block/buzz のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
Desktop: private project home channels show no lock icon in the sidebar対応中かも @Bartok9 が 6 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
block/buzz#7880 · コメント 2 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
メンテナーはふだん 1 日以内に返信
-
Markdown Preview Fonts Don't Show Selected Option対応中かも @RadhiRasho が今日担当しました。 オープンstate:needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 61/100
zed-industries/zed#65300 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信