From aae782fb3c693b426c8624e93eb347f277879334 Mon Sep 17 00:00:00 2001 From: ayn2op Date: Fri, 20 Mar 2026 12:21:35 -0400 Subject: [PATCH] refactor(ui/chat): align attachments picker layer naming --- internal/ui/chat/attachments_picker.go | 2 +- internal/ui/chat/messages_list.go | 4 ++-- internal/ui/chat/model.go | 11 ++++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/ui/chat/attachments_picker.go b/internal/ui/chat/attachments_picker.go index fa9db98..0f0c088 100644 --- a/internal/ui/chat/attachments_picker.go +++ b/internal/ui/chat/attachments_picker.go @@ -46,7 +46,7 @@ func (ap *attachmentsPicker) SetItems(items []attachmentItem) { } func (ap *attachmentsPicker) close() { - ap.chatView.RemoveLayer(attachmentsListLayerName) + ap.chatView.RemoveLayer(attachmentsPickerLayerName) ap.chatView.app.SetFocus(ap.chatView.messagesList) } diff --git a/internal/ui/chat/messages_list.go b/internal/ui/chat/messages_list.go index fe49e57..a30d055 100644 --- a/internal/ui/chat/messages_list.go +++ b/internal/ui/chat/messages_list.go @@ -1171,12 +1171,12 @@ func (ml *messagesList) showAttachmentsList(urls []string, attachments []discord ml.chatView. AddLayer( ui.Centered(ml.attachmentsPicker, ml.cfg.Picker.Width, ml.cfg.Picker.Height), - layers.WithName(attachmentsListLayerName), + layers.WithName(attachmentsPickerLayerName), layers.WithResize(true), layers.WithVisible(true), layers.WithOverlay(), ). - SendToFront(attachmentsListLayerName) + SendToFront(attachmentsPickerLayerName) ml.chatView.app.SetFocus(ml.attachmentsPicker) } diff --git a/internal/ui/chat/model.go b/internal/ui/chat/model.go index 9c3f47a..9a949d7 100644 --- a/internal/ui/chat/model.go +++ b/internal/ui/chat/model.go @@ -29,11 +29,12 @@ import ( const typingDuration = 10 * time.Second const ( - flexLayerName = "flex" - mentionsListLayerName = "mentionsList" - attachmentsListLayerName = "attachmentsList" - confirmModalLayerName = "confirmModal" - channelsPickerLayerName = "channelsPicker" + flexLayerName = "flex" + mentionsListLayerName = "mentionsList" + confirmModalLayerName = "confirmModal" + + channelsPickerLayerName = "channelsPicker" + attachmentsPickerLayerName = "attachmentsPicker" ) type Model struct {