From 095ce2865d51164078321097360c5bb0539287fd Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 16 Jan 2026 11:31:31 +0200 Subject: [PATCH] fix: update save prompt copy when editing existing draft When editing an existing draft (vs creating a new one), use "Save changes" instead of "Save draft" in the save/discard prompts. This provides clearer context to the user about what action they're taking. Add isEditingDraft prop to DraftsButton and ComposerTopBar, and update both prompts (in DraftsButton and Composer) with conditional copy based on whether we're editing an existing draft. Co-Authored-By: Claude Opus 4.5 --- src/view/com/composer/Composer.tsx | 22 +++++++++++++---- src/view/com/composer/drafts/DraftsButton.tsx | 24 ++++++++++++++----- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index bc02167517..eaa775c1ed 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -845,7 +845,8 @@ export const ComposePost = ({ onSaveDraft={saveCurrentDraft} onDiscard={handleClearComposer} isEmpty={isComposerEmpty} - isDirty={composerState.isDirty}> + isDirty={composerState.isDirty} + isEditingDraft={!!composerState.draftId}> {missingAltError && } - Save draft?{' '} + {composerState.draftId ? ( + Save changes? + ) : ( + Save draft? + )} - {_(msg`You can save this draft to continue later.`)} + {composerState.draftId + ? _(msg`You have unsaved changes to this draft.`) + : _(msg`You can save this draft to continue later.`)} @@ -1142,6 +1153,7 @@ function ComposerTopBar({ onDiscard, isEmpty, isDirty, + isEditingDraft, topBarAnimatedStyle, children, }: { @@ -1158,6 +1170,7 @@ function ComposerTopBar({ onDiscard: () => void isEmpty: boolean isDirty: boolean + isEditingDraft: boolean topBarAnimatedStyle: StyleProp children?: React.ReactNode }) { @@ -1192,6 +1205,7 @@ function ComposerTopBar({ onDiscard={onDiscard} isEmpty={isEmpty} isDirty={isDirty} + isEditingDraft={isEditingDraft} /> )} {isPublishing ? ( diff --git a/src/view/com/composer/drafts/DraftsButton.tsx b/src/view/com/composer/drafts/DraftsButton.tsx index 3cf21d4200..9f3563b6e0 100644 --- a/src/view/com/composer/drafts/DraftsButton.tsx +++ b/src/view/com/composer/drafts/DraftsButton.tsx @@ -14,12 +14,14 @@ export function DraftsButton({ onDiscard, isEmpty, isDirty, + isEditingDraft, }: { onSelectDraft: (draft: DraftSummary) => void onSaveDraft: () => Promise onDiscard: () => void isEmpty: boolean isDirty: boolean + isEditingDraft: boolean }) { const {_} = useLingui() const draftsDialogControl = Dialog.useDialogControl() @@ -69,17 +71,27 @@ export function DraftsButton({ - Save current draft? + {isEditingDraft ? ( + Save changes? + ) : ( + Save draft? + )} - - You have unsaved changes. Would you like to save them before viewing - your drafts? - + {isEditingDraft ? ( + + You have unsaved changes. Would you like to save them before + viewing your drafts? + + ) : ( + + Would you like to save this as a draft before viewing your drafts? + + )}