# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 15
# self = https://watcher.sour.is/conv/qkqefka
@ullarah Didn't we talk about at some point a way to set the maximum height of te panels with some UX way to read the rest? 🤔 Is that still on the cards or a bad ideas? 🤔
@ullarah Didn't we talk about at some point a way to set the maximum height of te panels with some UX way to read the rest? 🤔 Is that still on the cards or a bad ideas? 🤔
@prologic if we detect number of characters per twt and slice that into two sections we can create a ‘read more’ accordion. Of course we’ll also have it as a user configurable option 👌

Fo example sake, excuse my pseudocode! 😂

if twt > len(pod.maxtwt) then
    twtPart := slice(twt, pod.maxtwt)
    if len(index twtPart) > 20 then
        display twt as normal since it’s not worth splitting a twt for less words.
    else
        split twt into ‘read more’ section
    end
end


Hopefully that’s easy enough to understand where I’m going with that hahaha
@prologic if we detect number of characters per twt and slice that into two sections we can create a ‘read more’ accordion. Of course we’ll also have it as a user configurable option 👌

Fo example sake, excuse my pseudocode! 😂

if twt > len(pod.maxtwt) then
    twtPart := slice(twt, pod.maxtwt)
    if len(index twtPart[1]) > 100 then
        display twt as normal since it’s not worth splitting a twt for less characters.
    else
        split twt into ‘read more’ section
    end
end


Hopefully that’s easy enough to understand where I’m going with that hahaha
@ullarah works for me! A tricky bitmight be if it splits within a codeblock so markdown can't parse
@ullarah works for me! A tricky bitmight be if it splits within a codeblock so markdown can't parse
this would work. and your example makes sense. could parameterize the length integer but have a validator that keeps it within and lower and upper boundary
@xuu good point regarding markdown. possibly could defect common markdown tags and break by default above it.
@xuu it’ll probably be the same for all markdown really. Hmm, that’s quite the conundrum!
@ullarah Can't we do this at the "presentation" level via CSS itself? 🤔 I'd rather not to it in the backend if we can, it _feels_ error prone.
@ullarah Can't we do this at the "presentation" level via CSS itself? 🤔 I'd rather not to it in the backend if we can, it _feels_ error prone.
@prologic well what do you know! CSS-Tricks: Read More Fade

I’ll check it out when I can! 👍
@ullarah I _knew_ it 😂
@ullarah I _knew_ it 😂
@ullarah I check twtxt just now but it seems the way to go, the js code in the article feels a bit excessive to me.

A simple class added to the post that have more than X lines should be enough.

And by just nullifying the max-height with none or initial should do the job, or even better having a read-more class that add the max-height and show the button, it would be even cleaner.