Skip to content

Commit 5a12b06

Browse files
committed
feat: Improve the user experience for custom emoji buttons and selection sheets
- Modified so the custom emoji selection window does not cover the editor - Prevent the custom emoji selection window from closing while scrolling - While custom emojis are being sorted, the button remains visible but cannot be touched.
1 parent 5840899 commit 5a12b06

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

Packages/StatusKit/Sources/StatusKit/Editor/Components/AccessoryView.swift

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -158,23 +158,25 @@ extension StatusEditor {
158158
}
159159
.disabled(!canAddNewSEVM)
160160

161-
if !viewModel.customEmojiContainer.isEmpty {
162-
Button {
163-
isCustomEmojisSheetDisplay = true
164-
} label: {
165-
// This is a workaround for an apparent bug in the `face.smiling` SF Symbol.
166-
// See https://github.com/Dimillian/IceCubesApp/issues/1193
167-
let customEmojiSheetIconName =
168-
colorScheme == .light ? "face.smiling" : "face.smiling.inverse"
169-
Image(systemName: customEmojiSheetIconName)
170-
.frame(width: 25, height: 25)
171-
.contentShape(Rectangle())
172-
}
173-
.accessibilityLabel("accessibility.editor.button.custom-emojis")
174-
.sheet(isPresented: $isCustomEmojisSheetDisplay) {
175-
CustomEmojisView(viewModel: focusedSEVM)
176-
.environment(theme)
177-
}
161+
Button {
162+
isCustomEmojisSheetDisplay = true
163+
} label: {
164+
// This is a workaround for an apparent bug in the `face.smiling` SF Symbol.
165+
// See https://github.com/Dimillian/IceCubesApp/issues/1193
166+
let customEmojiSheetIconName =
167+
colorScheme == .light ? "face.smiling" : "face.smiling.inverse"
168+
Image(systemName: customEmojiSheetIconName)
169+
.frame(width: 25, height: 25)
170+
.contentShape(Rectangle())
171+
}
172+
.accessibilityLabel("accessibility.editor.button.custom-emojis")
173+
.disabled(viewModel.customEmojiContainer.isEmpty)
174+
.sheet(isPresented: $isCustomEmojisSheetDisplay) {
175+
CustomEmojisView(viewModel: focusedSEVM)
176+
.environment(theme)
177+
.presentationDragIndicator(.hidden)
178+
.presentationDetents([.medium])
179+
.interactiveDismissDisabled()
178180
}
179181

180182
if #available(iOS 26, *), Assistant.isAvailable {

0 commit comments

Comments
 (0)