GithubHelp home page GithubHelp logo

Easier @mentions about oasis HOT 17 CLOSED

fraction avatar fraction commented on May 8, 2024
Easier @mentions

from oasis.

Comments (17)

cinnamon-bun avatar cinnamon-bun commented on May 8, 2024 3
[main textbox]
[@user dropdown here]   [button to add mention]

This could reload the page so the server could append the @user link at the end of the post-in-progress. Then the user can copy-paste it to move it around inside their post.

Or maybe with CSS wizardry we can show the @user link code for the user to copy-paste into the post:

[main textbox]
[@user dropdown]   copy and paste this user code: [code for @user appears here]

from oasis.

soapdog avatar soapdog commented on May 8, 2024 1

My advise is to fill a <datalist> with the names and ids of friends and following: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist

If you really want a dropdown, then it can be divided into sections using <optgroup> to organize the dropdown: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup

from oasis.

christianbundy avatar christianbundy commented on May 8, 2024 1

Thanks @soapdog!

I think <datalist> is perfect, it just means we need a "add another recipient" button that refreshes the page to add a second datalist, since we can't currently do multiple. I found this, which suggests that Chrome and Opera will let you do multiple if you set type="email", but we don't want that.

from oasis.

cinnamon-bun avatar cinnamon-bun commented on May 8, 2024 1
  • To make impersonation attacks harder, let's sort your direct friends first in the list and make them visually distinguishable from the rest.

  • We'll have to include the list of users and IDs in the HTML of most pages instead of loading them on demand. It could be very long. Maybe limit it to 1 or 2 hops, plus the people who show up on the currently viewed page?

from oasis.

christianbundy avatar christianbundy commented on May 8, 2024 1

I love that idea, I never would've thought of that!

I'm thinking something like:

  • People in this thread
    • jedahan
    • soapdog
    • cinnamon-bun
  • People that you follow
    • alice
    • bob
    • carol
  • People followed by people you follow
    • dave
    • emma
    • frank

Just inserting the text at the bottom would be so easy, and I'd imagine we could do the same thing for blob uploads too (!).

from oasis.

jedahan avatar jedahan commented on May 8, 2024

Multiselect checkboxes styled as profile avatars could work real nicely. Lots of different sorting methods could be tried. Might even be able to “insert” the text within the messaging using some css styling hacks :)

from oasis.

jedahan avatar jedahan commented on May 8, 2024

https://w3bits.com/css-floating-labels/ for an example of making some label look like it’s in the textarea a little bit

from oasis.

christianbundy avatar christianbundy commented on May 8, 2024

I totally agree. Anything is better than what we have now. :~)

That link looks great. I've been struggling with the separate goals of make form inputs match the theme and make form inputs familiar and easy to recognize, and it hasn't always gone well. For example, I think the theme chooser is confusing, and when I watched a friend use it he selected "set theme" because it's impossible to tell that the <select> is a dropdown menu. If we remove appearance: none then it shows the familiar button with an arrow, but there's no way to change the button/arrow colors.

from oasis.

jedahan avatar jedahan commented on May 8, 2024

If you can clearly state design goals like that, I know a css wizard at work who could help :)

from oasis.

christianbundy avatar christianbundy commented on May 8, 2024

(Note for whoever implements this: my guess is that the "add a recipient button" will probably require the same code for post previews, since you're basically refreshing the page with a form button.)

from oasis.

soapdog avatar soapdog commented on May 8, 2024

TBH, I think I'm gonna use <datalist> on patchfox as well... so much easier.

from oasis.

christianbundy avatar christianbundy commented on May 8, 2024

Blaze the trail!

One thing I'm still unsure how to solve: @mentions in the middle of a sentence. It's easy to maintain a list of recipients with a <datalist> and throw those at the top of the post or something, but I'm not sure how to do mid-sentence shenanigans.

from oasis.

jedahan avatar jedahan commented on May 8, 2024

I wonder if theres a css target psuedo-selector that allows regex. This sounds like an awful idea.

from oasis.

jedahan avatar jedahan commented on May 8, 2024

total hack for zero-js searching:

<style>
input:invalid + ul {
  display: none;
}
</style>

<input id=searched required pattern=".*@.*">
</input>

<ul>
  <li> @micro
  <li> @christianbundy 
</ul>

from oasis.

jedahan avatar jedahan commented on May 8, 2024

https://jsfiddle.net/mpa61wyo/

from oasis.

jedahan avatar jedahan commented on May 8, 2024

okay, last weird experiment

<style>
input:invalid + ul, #micro, #eli, #clear {
  display: none;
}
#micro:target, #eli:target {
  display: block;
}
#eli:target ~ #clear, #micro:target ~ #clear {
  display: block;
}

</style>

<div> sending to....
<span id=micro>[@micro](@wsOe...)</span>
<span id=eli>[@eli](@lolol...)</span>
<a href="#" id="clear">x</a>
</div>

<input id=searched required pattern=".*@.*">
</input>

<ul>
  <li> <a href="#micro"> @micro </a>
  <li> <a href="#eli"> @eli </a>
</ul>

https://jsfiddle.net/k7urL0h1/

from oasis.

cinnamon-bun avatar cinnamon-bun commented on May 8, 2024

Other ideas:

  • If user includes a plaintext @mention in their post, replace it with a markdown link [@mention](@abcde) when generating a preview of their post. This won't work with usernames that have spaces. We might have to include widgets on the preview page to help disambiguate the auto-links.
  • If user puts a full link to an Oasis user page http://localhost:3000/author/%40... also replace it with a markdown @mention link

from oasis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.