Add arrow key nav to channel list

This commit is contained in:
2025-08-21 13:45:13 +02:00
parent fa1cbdf97e
commit f2ac7d7209
4 changed files with 188 additions and 16 deletions

View File

@@ -309,6 +309,11 @@ const selectChannel = async (channelId: number) => {
}
scrollToBottom()
// Auto-focus message input when switching channels
nextTick(() => {
messageInput.value?.focus()
})
}
const handleSendMessage = async (content: string) => {
@@ -452,7 +457,12 @@ onMounted(async () => {
await selectChannel(appStore.channels[0].id)
}
// 6. Set up periodic sync for unsent messages
// 6. Auto-focus message input on page load
nextTick(() => {
messageInput.value?.focus()
})
// 7. Set up periodic sync for unsent messages
const syncInterval = setInterval(async () => {
if (appStore.unsentMessages.length > 0) {
try {