refactor(ui/chat): align attachments picker layer naming

This commit is contained in:
ayn2op 2026-03-20 12:21:35 -04:00
parent 89639247a8
commit aae782fb3c
3 changed files with 9 additions and 8 deletions

View file

@ -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)
}

View file

@ -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)
}

View file

@ -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 {