diff --git a/components/publish/PublishAttachment.vue b/components/publish/PublishAttachment.vue
index 89aea8e9..e70ffe9c 100644
--- a/components/publish/PublishAttachment.vue
+++ b/components/publish/PublishAttachment.vue
@@ -15,6 +15,9 @@ const emit = defineEmits<{
(evt: 'setDescription', description: string): void
}>()
+// from https://github.com/mastodon/mastodon/blob/dfa984/app/models/media_attachment.rb#L40
+const maxDescriptionLength = 1500
+
const isEditDialogOpen = ref(false)
const description = ref(props.attachment.description ?? '')
const toggleApply = () => {
@@ -55,7 +58,10 @@ const toggleApply = () => {
-
diff --git a/components/publish/PublishCharacterCounter.vue b/components/publish/PublishCharacterCounter.vue
new file mode 100644
index 00000000..c9006424
--- /dev/null
+++ b/components/publish/PublishCharacterCounter.vue
@@ -0,0 +1,12 @@
+
+
+
+
+ {{ length ?? 0 }}/{{ max }}
+
+
diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue
index ea723803..9f8a13dd 100644
--- a/components/publish/PublishWidget.vue
+++ b/components/publish/PublishWidget.vue
@@ -97,6 +97,10 @@ const characterCount = $computed(() => {
return length
})
+const isExceedingCharacterLimit = $computed(() => {
+ return characterCount > characterLimit.value
+})
+
const postLanguageDisplay = $computed(() => languagesNameList.find(i => i.code === (draft.params.language || preferredLanguage))?.nativeName)
async function handlePaste(evt: ClipboardEvent) {
@@ -292,9 +296,7 @@ defineExpose({
-
- {{ characterCount ?? 0 }}/{{ characterLimit }}
-
+
@@ -337,12 +339,12 @@ defineExpose({
-
+