Update error toast when user tries to drop open file into chat window
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 84/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- frontend
調査の方向性
application/single_app/static/js/chat/chat-input-actions.js を開き、特に uploadFileToConversation とそのエラー処理に注目して、ドラッグ&ドロップによるアップロードの経路を追跡してください。クリップのアイコンからのアップロード動作と比較し、読み取れないファイルや外部からロックされているファイルをドロップしたときに、具体的で対処可能な toast が表示される一方、通常のアップロードは引き続き正常に完了することを確認してください。
索引モデルが issue の本文から書いたものです。
説明
When a user tries to drop a file that's open in another app into the chat window, a vague error toast pops up in the upper right that doesn't provide enough information.
Trying to upload the same file via the paperclip icon provides much more helpful error:
Suggested fix - make changes similar to the below to application/single_app/static/js/chat/chat-input-actions.js to give the user a clearer message about what went wrong.)
More helpful error message:
New async function
const fileName = String(file?.name || "selected file").trim() || "selected file";
try {
await file.slice(0, Math.min(file.size, 1)).arrayBuffer();
} catch (error) {
throw new Error(
`The browser could not read "${fileName}". Close the file in other apps then try again.`
);
}
}
Updated uploadFileToConversation function:
export async function uploadFileToConversation(file) {
let uploadingIndicatorEl = null;
try {
await ensureUploadFileIsReadable(file);
const groupUploadContext = await resolveGroupUploadContext();
uploadingIndicatorEl = showFileUploadingMessage();
// Update the file button to show "Uploading..." state
const fileBtn = document.getElementById("choose-file-btn");
if (fileBtn) {
const fileBtnText = fileBtn.querySelector(".file-btn-text");
if (fileBtnText) {
fileBtnText.textContent = "Uploading...";
}
}
const formData = new FormData();
formData.append("file", file);
formData.append("conversation_id", currentConversationId);
if (groupUploadContext) {
formData.append("group_upload_target_id", groupUploadContext.selectedGroupId);
groupUploadContext.groupIds.forEach((groupId) => {
formData.append("upload_scope_group_ids", groupId);
});
}
let response;
try {
response = await fetch("/upload", {
method: "POST",
body: formData,
});
} catch (error) {
if (error instanceof TypeError) {
const fileName = String(file?.name || "selected file").trim() || "selected file";
throw new Error(
`The browser could not upload "${fileName}". The file may be open in another app, unavailable from cloud storage, or the network connection may have been interrupted. Ensure the file is closed and then try again.`
);
}
throw error;
}
hideFileUploadingMessage(uploadingIndicatorEl);
uploadingIndicatorEl = null;
const data = await response.json();
if (!response.ok) {
console.error("Upload failed:", data.error || "Unknown error");
throw new Error(data.error || "Upload failed");
}
if (data.conversation_id) {
const uploadedConversationId = data.conversation_id;
currentConversationId = uploadedConversationId;
window.currentConversationId = uploadedConversationId;
// If a title was returned and it's different from "New Conversation",
// update the conversation title in the UI
if (data.title && data.title !== "New Conversation") {
const currentConversationTitleEl = document.getElementById("current-conversation-title");
if (currentConversationTitleEl) {
currentConversationTitleEl.textContent = data.title;
}
}
const isCollaborationUpload = Boolean(
data.is_collaboration_upload
|| window.chatCollaboration?.isCollaborationConversation?.(uploadedConversationId)
);
const loadMessagesPromise = isCollaborationUpload && window.chatCollaboration?.activateConversation
? window.chatCollaboration.activateConversation(uploadedConversationId)
: loadMessages(uploadedConversationId);
if (data.workspace_document_id) {
registerConversationTaskDocument({
...(data.workspace_document || {}),
id: data.workspace_document_id,
conversation_id: uploadedConversationId,
scope: data.workspace_scope,
status: data.workspace_document?.status || 'Queued for processing',
percentage_complete: data.workspace_document?.percentage_complete || 0,
ready: false,
});
activateUserWorkspaceContextForChatUpload();
Promise.resolve(loadMessagesPromise).finally(() => {
watchChatWorkspaceUploadDocument(data.workspace_document_id, {
autoSelect: true,
workspaceScope: data.workspace_scope,
groupId: data.workspace_document?.group_id || data.group_upload_target?.id || null,
});
});
}
loadConversations();
} else {
console.error("No conversation_id returned from server.");
showToast("Error: No conversation ID returned from server.", "danger");
}
resetFileButton();
} catch (error) {
console.error("Error:", error);
if (!error.isUploadSelectionCancelled) {
showToast("Error uploading file: " + error.message, "danger");
}
resetFileButton();
if (uploadingIndicatorEl) {
hideFileUploadingMessage(uploadingIndicatorEl);
}
}
}
- 主要言語
- Python
- スター
- 155
- フォーク
- 116
- 平均マージ
- 5時間 3分
- マージ済み PR(30日)
- 206
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/simplechat のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoft/simplechat#1370 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
microsoft/simplechat#1770 ·
メンテナーはふだん 1 日以内に返信
-
Harden deployer private networking and add optional AMPLS for Commercial and Government対応中かも @paullizer が 2 日前に担当しました。 オープンbug enhancement P1 security_improvement
microsoft/simplechat#1765 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
V2 bootstrap takes ~5s: optimize /api/v2/bootstrap backend and first paint対応中かも @paullizer が 8 日前に担当しました。 オープンenhancement P1 python
microsoft/simplechat#1725 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Serve the new UI at the main URLs, move the legacy UI under /legacy, and let admins control interface access対応中かも @paullizer が 8 日前に担当しました。 オープンCreated By Copilot enhancement P1
microsoft/simplechat#1723 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
microsoft/simplechat の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
lidofinance/diffyscan#239 ·
メンテナーはふだん 1 日以内に返信
-
docs: the dev-setup table and AGENTS.md name the reviewed_by guard that CI's Changelog job runsオープンarea: tools documentation good first issue ready for a contributor
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
eyalgolan/statecraft-israel#873 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
GET rooms API returns 500 due to nonexistent Room.is_active attribute対応中かも @Mars-60 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 5 日以内に返信
-
Harmony OPeNDAP SubSetter (HOSS) Geographic production rssmif16d 7 XYZ_PROV
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
nasa/harmony-autotester#341 ·