Git Product home page Git Product logo

Comments (15)

lionleaf avatar lionleaf commented on June 18, 2024 2

This feature is now live on beta.dwitter.net! Check it out.

Implemented in this PR: dwitter-net/dwitter-frontend#81

I'll keep this issue open for a bit longer to allow for feedback and further discussion.

from dwitter.

sigvef avatar sigvef commented on June 18, 2024 1

I completely agree!

Incidentally, I was experimenting a bit with what that could look like in https://github.com/dwitter-net/dwitter-frontend (https://beta.dwitter.net), and this is what I came up with:

 

If there is interest I can package it up and start making some pull requests!

from dwitter.

KilledByAPixel avatar KilledByAPixel commented on June 18, 2024 1

I like the mockup! It would be great to have this as a feature, I'm sure seeing all this compressed code is confusing to novices.

from dwitter.

ThomasBrierley avatar ThomasBrierley commented on June 18, 2024 1

I like it.

Looking forward to the beta becoming the primary frontend.

from dwitter.

KilledByAPixel avatar KilledByAPixel commented on June 18, 2024

That would be cool! I've already hooked that up on http://dweetview.3d2k.com/ and http://dweetabase.3d2k.com/ for reference.

from dwitter.

ThomasBrierley avatar ThomasBrierley commented on June 18, 2024

The recent performance update actually does this internally, and it turned out to be pretty safe.
I think the only consideration is UX... if we do this automatically then it might seem a bit strange to newbies that some dweets are magically 194 characters. The possible ways to address this are either a secondary indication of some kind, or to make the decompression an explicit user action i.e a "decompress" button.

from dwitter.

lionleaf avatar lionleaf commented on June 18, 2024

I agree, this would be neat, but I worry about the UX. I much prefer that it's an explicit action, like a "decompress" button, as @ThomasBrierley mention.

Maybe it should come with an optional explainer pop up that explains how the compression works?

At that point do we add a "compress" button as well?

from dwitter.

ThomasBrierley avatar ThomasBrierley commented on June 18, 2024

Maybe it should come with an optional explainer pop up that explains how the compression works?
At that point do we add a "compress" button as well?

It's already quite hard to refrain from bumping up to 194 for me as a regular user, would a button make it too tempting and also too easy for newbies to appreciate the extra step involved?

Perhaps a link to a short explanation to read could act as a good "rite of passage"... maybe I am just in denial, it's true those extra 54 characters really open up the possibilities, but its still impressive when someone manages to cram something new and unique into 140 occasionally.

Option 3: Only add a decompress button, leave it as something to discover.

from dwitter.

lionleaf avatar lionleaf commented on June 18, 2024

If anyone is interested in taking on this, I'd be in favor of starting of with just a decompress button. Ideally subtle, and only visible when there is something to decompress. I think just replacing the code with the decompressed code might be ok?

Alternatively spit out the decompressed code below in a similar fashion to the "throw" trick

from dwitter.

ThomasBrierley avatar ThomasBrierley commented on June 18, 2024

I think we really do need to do something here, anything to make it clear what's under the encoding. I'll give this a go when I get an evening.

I believe presenting those outside of dwitter with a wall of unicode glyphs affects their appreciation and thus interest more than we realise. One of my colleagues initially thought the challenge was in encoding the unicode chars manually - which might sound silly, but you can imagine how offputting that sounds as a challenge.

from dwitter.

lionleaf avatar lionleaf commented on June 18, 2024

This is now live and functional. Closing issue :)

from dwitter.

KilledByAPixel avatar KilledByAPixel commented on June 18, 2024

Not sure why but compressing this dweet causes a crash (i assume because of non ascii characters)

https://dwitter.net/d/24278

In CapJS I added some extra stuff to replace any unicode characters so compression still works. Feel free free to use this as a starting point...

    // replace unicode characters
    const codeIn = [...codeMirrorEditor.getValue().trim()];
    let code = '';
    for (let character of codeIn)
    {
        const charCode = character.charCodeAt(0);
        if (charCode > 255)
            character = escape(character).replace(/%u/g,'\\u');
        code += character;
    }

from dwitter.

lionleaf avatar lionleaf commented on June 18, 2024

Yeah, @CiaccoDavide just fixed that but I haven't deployed it yet: dwitter-net/dwitter-frontend#100

That snipped might be helpful as well. Thanks!

from dwitter.

lionleaf avatar lionleaf commented on June 18, 2024

Deployed. Now it just gives you a warning which is more helpful than the old crash. But that particular dweet is still causing issues

from dwitter.

lionleaf avatar lionleaf commented on June 18, 2024

Continue discussion here: dwitter-net/dwitter-frontend#107

from dwitter.

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.