UX: add placeholder title for drafts (#30747)

Adds a placeholder title for drafts that don't have a saved title.
This commit is contained in:
David Battersby
2025-01-14 01:24:12 +04:00
committed by GitHub
parent 461dcf44d0
commit f9a000ff9f
2 changed files with 6 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ import { tracked } from "@glimmer/tracking";
import { fn } from "@ember/helper";
import { action } from "@ember/object";
import { service } from "@ember/service";
import { or } from "truth-helpers";
import DButton from "discourse/components/d-button";
import DropdownMenu from "discourse/components/dropdown-menu";
import DiscourseURL from "discourse/lib/url";
@@ -85,7 +86,10 @@ export default class TopicDraftsDropdown extends Component {
<DButton
@action={{fn this.resumeDraft draft}}
@icon={{if draft.topic_id "reply" "layer-group"}}
@translatedLabel={{draft.title}}
@translatedLabel={{or
draft.title
(i18n "drafts.dropdown.untitled")
}}
class="btn-secondary"
/>
</dropdown.item>

View File

@@ -499,6 +499,7 @@ en:
no_value: "Resume editing"
dropdown:
title: "Open the latest drafts menu"
untitled: "Untitled draft"
view_all: "view all"
other_drafts:
one: "+%{count} other draft"