decent icon indicating copy to clipboard operation
decent copied to clipboard

Tab-complete

Open bates64 opened this issue 7 years ago • 10 comments
trafficstars

In message input, for:

  • Channel/server references
    • #channel by channels on current server
    • +server.com#channel by fetching channels on remote server
    • +server.com by looking at known servers (i.e. present in server list)
  • Mentions
    • @username by users on server (blocked by #55)

...anything else?


UX

I propose:

  1. User hits tab in the message input
  2. Look for tab-completable text
  • Use input.selectionStart to see where the caret is
  • Or, just go from the end
  • Work backwards from there
  1. Fetch potential completions (e.g. actors.channels.channels for #channel)
  2. Find best start-substring match (talking point: what do we do with ambiguity?)
  3. Complete and move cursor to end of match

bates64 avatar Dec 05 '17 11:12 bates64

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?

bates64 avatar Dec 05 '17 11:12 bates64

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.

towerofnix avatar Dec 10 '17 18:12 towerofnix

Maybe show the first three (or so) matches

How? Design-wise, I mean.

bates64 avatar Dec 10 '17 18:12 bates64

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:

dropdown

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.

towerofnix avatar Dec 10 '17 18:12 towerofnix

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?

bates64 avatar Dec 10 '17 18:12 bates64

I'm leaning towards "yes" :)

Prioritize users who are online, then sort alphabetically. I think that's enough?

towerofnix avatar Dec 10 '17 18:12 towerofnix

No! Prioritize users who are online, but then sort by who posted most recently in the current channel. ;)

PullJosh avatar Dec 10 '17 18:12 PullJosh

@PullJosh Of course! That makes a lot more sense. In fact, oh, duh. :+1:

towerofnix avatar Dec 10 '17 20:12 towerofnix

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.

TheInitializer avatar Dec 11 '17 02:12 TheInitializer

oops, ninja'd by @PullJosh 📦

TheInitializer avatar Dec 11 '17 02:12 TheInitializer