coauthor icon indicating copy to clipboard operation
coauthor copied to clipboard

<hide>/<details> messages

Open sualehasif opened this issue 5 years ago • 11 comments

It would be nice to be able to hide specific parts of the message while writing a response. This encourages clarity and hide pictures/ long and bashy proofs of lemmas inside the message and focus on the key ideas outside. This also makes browsing easier. Ideally you can also recursively put hide tags inside of hide tags. That allows alot of flexibility in how this is used.

(I am not sure but it may also help loading the webpage faster if we don't render the hidden images/ messages until the user clicks the unhide button)

Example pictures/screenshots from artofproblemsolving.com attached below.

sualehasif avatar Jun 18 '19 18:06 sualehasif

The claims hidden: Screen Shot 2019-06-18 at 11 50 50 AM

One of the claims expanded: Screen Shot 2019-06-18 at 11 51 13 AM

sualehasif avatar Jun 18 '19 18:06 sualehasif

Would standard html <details>...</details> tag work?

cben avatar Jun 23 '19 09:06 cben

No, after a short check it seems like these don't work.

sualehasif avatar Jun 24 '19 06:06 sualehasif

<details> tag seems like a good way to go. These are probably not currently supported because they're not in the HTML sanitize whitelist, but that is easy to fix.

edemaine avatar Jun 24 '19 16:06 edemaine

Bump

diomidov avatar Jul 27 '19 02:07 diomidov

OK, I just deployed a quick fix to allow

<details><summary>Short form</summary>Lots and lots of text</details>

which renders like this:

Short formLots and lots of text

I'm not a huge fan of the syntax, but at least it's standard! I can't seem to find a Markdown equivalent, and I'm guessing LaTeX doesn't have one, though we could make one..

Perhaps more interesting would be to customize the formatting to make it look more ... Coauthory. Let me know your suggestions.

edemaine avatar Jul 27 '19 03:07 edemaine

Hmm... How about something like this? I stole the styles from .panel-primary and .panel-heading and added some padding. image

diomidov avatar Jul 27 '19 05:07 diomidov

Nice idea to use panel formatting! I'm pushing a change that's based on (a compact version of) .panel-default, which we don't use elsewhere in Coauthor, but is in a similar style, and helps distinguish messages from these "submessages". Also switched the default triangle behavior to (compact versions of) the usual +/- buttons.

image

edemaine avatar Jul 27 '19 15:07 edemaine

Paragraph breaks don't work inside <details> in markdown mode: https://coauthor.csail.mit.edu/coauthor-dev/m/Fu6MrosTqQ7jE4uFo

diomidov avatar Aug 23 '19 18:08 diomidov

Another request we've heard is to not collapse already open <details> in a message while it's getting edited and rerendered. This is tricky: we'd need some way to detect the "same" <details> from one version of the message to the next, and restore the state.

I think it would help to at least have all <details> open in the preview when actively editing a message, as you probably want to see what you're doing in there. (This may have actually been the original request.)

edemaine avatar Jun 04 '21 00:06 edemaine

Ideally I'd want the <details> to be open iff the cursor is inside <details> in the source code. But this would require #212.

diomidov avatar Jun 04 '21 00:06 diomidov