Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

give us feedback of when our messages are sending #191

Open
intexisty opened this issue Oct 26, 2019 · 2 comments
Open

give us feedback of when our messages are sending #191

intexisty opened this issue Oct 26, 2019 · 2 comments
Labels
chat-view-revamp Stuff adressed by a chat-view revamp enhancement New feature or request

Comments

@intexisty
Copy link
Contributor

What do you want

I would like a way of seeing if our messages are actively trying to send. The native discord client does this by graying out the message and changing its color to white.

Why

It would be useful feedback to know that cordless hasn't just crashed and it's actively trying to send our messages.

Implementation hints

a throbber after the message
throbber
spinner
screenshot-2
spinners

@Bios-Marcel Bios-Marcel added the enhancement New feature or request label Oct 26, 2019
@intexisty
Copy link
Contributor Author

{
    "dots": {
        "interval": 80,
        "frames": [
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            "",
            ""
        ]
    }
}```

@Bios-Marcel
Copy link
Owner

Dumb implementation for testing:

	go func() {
		dots := [...]string{"⠋",
			"⠙",
			"⠹",
			"⠸",
			"⠼",
			"⠴",
			"⠦",
			"⠧",
			"⠇",
			"⠏"}
		for {
			<-ticker.C
			chatView.Lock()
		OUTER_LOOP:
			for _, message := range chatView.data {
				for index, dot := range dots {
					if index != len(dots)-1 {
						if strings.HasSuffix(message.Content, dot) {
							message.Content = strings.TrimSuffix(message.Content, dot) + dots[index+1]
							chatView.formattedMessages[message.ID] = chatView.formatMessage(message)
							continue OUTER_LOOP
						}
					} else {
						message.Content = strings.TrimSuffix(message.Content, dot)
					}
				}

				message.Content = message.Content + dots[0]
				chatView.formattedMessages[message.ID] = chatView.formatMessage(message)
			}
			window.QueueUpdateDrawSynchronized(func() {
				chatView.Reprint()
			})
			chatView.Unlock()
		}
	}()

@Bios-Marcel Bios-Marcel added the chat-view-revamp Stuff adressed by a chat-view revamp label Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
chat-view-revamp Stuff adressed by a chat-view revamp enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants