decent
decent copied to clipboard
Tab-complete
In message input, for:
- Channel/server references
#channelby channels on current server+server.com#channelby fetching channels on remote server+server.comby looking at known servers (i.e. present in server list)
- Mentions
@usernameby users on server (blocked by #55)
...anything else?
UX
I propose:
- User hits
tabin the message input - Look for tab-completable text
- Use input.selectionStart to see where the caret is
- Or, just go from the end
- Work backwards from there
- Fetch potential completions (e.g. actors.channels.channels for
#channel) - Find best start-substring match (talking point: what do we do with ambiguity?)
- Complete and move cursor to end of match
what do we do with ambiguity?
I say we just abort - on Discord the tab-complete dropdown kinda lags the entire UI out, and I'd like to avoid that.
Ping @PullJosh @towerofnix?
I say we just abort - on Discord the tab-complete dropdown kinda lags the entire UI out, and I'd like to avoid that.
@heyitsmeuralex Sounds good to me. Maybe show the first three (or so) matches before aborting.
Maybe show the first three (or so) matches
How? Design-wise, I mean.
If the actual processing of tab-completion doesn't take long (i.e. if the rendering of the DOM elements is what causes lag), I'd suggest just finding all completions, sorting alphabetically, and showing the first three.
This seems at least a little similar to how Discord does it actually? On a large (many members) server:

Discord limits the number of users rendered. I have no idea how it's sorted (e.g. "Axi" appears after "Taylor", so it's not (just?) alphabetical). Point is - it's not that many elements being shown, and, frankly, Discord's tab-complete doesn't lag me at all.
Prioritizing online users may be a good idea.
That tab complete on Discord looks noticeably different to how I remember it - perhaps they updated/optimized it :tada:
Hitting tab on just @ is a good question though. Should we even complete it?
I'm leaning towards "yes" :)
Prioritize users who are online, then sort alphabetically. I think that's enough?
No! Prioritize users who are online, but then sort by who posted most recently in the current channel. ;)
@PullJosh Of course! That makes a lot more sense. In fact, oh, duh. :+1:
Discord, and most other chat things, work by showing the people who sent the last chat messages first.
e.g.
alex we should add tab completion florrie oh yeah, duh xn--cr8h how should we do it? florrie idk pulljosh i can do frontend!
@ would show pulljosh, then florrie, then xn--cr8h.
oops, ninja'd by @PullJosh 📦