Skip to content

Commit ec48ea0

Browse files
AchoArnoldCopilot
andcommitted
feat: display short attachment names in thread view and fix typo
- Show only /{index}/{filename} instead of full URL for received attachments - Fix 'succesfully' typo in message_service.go Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 14af0a1 commit ec48ea0

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

api/pkg/services/message_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ func (service *MessageService) ReceiveMessage(ctx context.Context, params *Messa
331331
msg := fmt.Sprintf("cannot dispatch event type [%s] and id [%s]", event.Type(), event.ID())
332332
return nil, service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg))
333333
}
334-
ctxLogger.Info(fmt.Sprintf("event [%s] dispatched succesfully", event.ID()))
334+
ctxLogger.Info(fmt.Sprintf("event [%s] dispatched successfully", event.ID()))
335335

336336
return service.storeReceivedMessage(ctx, eventPayload)
337337
}

web/pages/threads/_id/index.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
<v-icon x-small class="text--secondary mt-1">{{
187187
mdiPaperclip
188188
}}</v-icon>
189-
{{ attachment }}
189+
{{ formatAttachmentName(attachment) }}
190190
</a>
191191
</v-card-text>
192192
</v-card>
@@ -460,6 +460,14 @@ export default Vue.extend({
460460
},
461461
462462
methods: {
463+
formatAttachmentName(url: string): string {
464+
const parts = url.split('/')
465+
if (parts.length >= 2) {
466+
return '/' + parts.slice(-2).join('/')
467+
}
468+
return url
469+
},
470+
463471
isPending(message: Message): boolean {
464472
return ['sending', 'pending', 'scheduled'].includes(message.status)
465473
},

0 commit comments

Comments
 (0)