XSF Discussion - 2020-11-22


  1. Link Mauve

    Zash, https://github.com/xsf/xeps/pull/1010

  2. jonas’

    ohhh

  3. jonas’

    intriguing

  4. Link Mauve

    I probably missed some elements, and the examples are too bright in order to not have to modify the other CSS, but it’s a starting point.

  5. jonas’

    doesn’t seem to work with my fennec

  6. jonas’

    even though fennec itself is dark

  7. jonas’

    oh wait

  8. Link Mauve

    I only tested with my laptop’s Firefox, not my phone’s.

  9. jonas’

    my laptop firefox doesn’t know about dark mode at all -.-

  10. jonas’

    only via about:config methinks

  11. Link Mauve

    I configure mine from GTK’s settings.

  12. jonas’

    no GTK here

  13. Link Mauve

    echo '[Settings] gtk-application-prefer-dark-theme = true' >> ~/.config/gtk-3.0/settings.ini

  14. jonas’

    works on my laptop’s firefox if I force it to dark

  15. Link Mauve

    Oh, do you build it with Qt support?

  16. jonas’

    Link Mauve, no, but I don’t have any gtk tooling

  17. Link Mauve

    I didn’t know it still supported that.

  18. jonas’

    I use whatever debian does

  19. Link Mauve

    Debian most likely builds Firefox with GTK.

  20. jonas’

    sooo... on the platform which most natively supports dark mode (android), firefox (fennec) fails to respect it for websites, while it does for its own ui?

  21. jonas’

    hm, I find the syntax highlighting hard to read

  22. jonas’

    not sure this is an improvement

  23. Link Mauve

    I could make it fully white if you prefer.

  24. jonas’

    yes, that or fixing the stylesheet of the syntax highlighter

  25. Link Mauve

    Or figure out XML colours which go better on a dark background.

  26. Link Mauve

    jonas’, there.

  27. jonas’

    now they’re dark

  28. jonas’

    https://share.dreckshal.de/dpm/ZiGcUDzS8UZ3iGfpV-LiMoZHjhIvWmfvkGRZU8nyyAk.png

  29. Link Mauve

    Wut, did I forget to commit the prettify.css?

  30. jonas’

    oh

  31. jonas’

    sorry

  32. Link Mauve

    No I didn’t.

  33. jonas’

    I was under the impression you only changed xmpp.css

  34. jonas’

    I didn’t update prettify.css on my webserver

  35. jonas’

    much better

  36. jonas’

    this is great, thanks!

  37. Link Mauve

    :)

  38. jonas’

    pushed

  39. jonas’

    need to poke the docker stuff once it’s done, but lunch first

  40. Link Mauve

    I should have done that years ago…

  41. jonas’

    no, that would’ve been with the old CSS ;)

  42. jonas’

    huh

  43. jonas’

    the change didn’t make it into the docker image

  44. jonas’

    not sure why, need to look at it later, lunch first

  45. Link Mauve

    Enjoy. :)

  46. Zash

    Ooooh

  47. larma

    jonas’, I am not a big fan of Blurhash. I think it's not really well documented. https://github.com/woltapp/blurhash/blob/master/Algorithm.md is all you get. It uses custom, digit-based base 83 encoding, doesn't support alpha channel. And as far as I can see, it's not even heavily popular. Mastodon and Signal use it, and that's basically it. It just happen to be circulated within XMPP people for some reason and the word Blurhash is even used here as a synonym for "very small image scaled up in a blurry way" by some.

  48. jonas’

    larma, no, I specifically talk about blurhash

  49. jonas’

    by that I mean the entire package, because I looked at it and I consider it a reasonable and smart solution to the problem

  50. jonas’

    in contrast to taking an 8x8 JPEG/PNG and scaling that up with a bilinear filter

  51. jonas’

    I’m not sure how alpha channels would even work with such a technology, that needs more thought

  52. larma

    why do you think it's smart comparing to a simple bitmap? I wouldn't take jpeg or png because they have huge overhead for small size images

  53. larma

    classic pc bitmap, you now this old .bmp, is much better for very small images

  54. larma

    4x3 = 12 32-bit colors are just 48 byte, encode them using base64 and you get 64 ascii chars. Yes a 4x3 blurhash is "just" 28 ascii chars. But given the overall overhead we have in XMPP that's not a huge thing. Also as quality of blurhash isn't exactly comparable with 32-bit color, we can easily reduce this by half (using 16-bit colors) and reach a size that is pretty close.

  55. jonas’

    Link Mauve, there, it’s live (cc @ Zash)

  56. Zash

    Shiny, thanks Link Mauve

  57. Link Mauve

    Woohoo!

  58. larma

    jonas’, test image: http://larma.de/blur_sample_base.jpg 4x3 blurhash: http://larma.de/blur_sample_blurhash_4x3.jpg image scaled to 4x3, reduced color depth to 12-bit (no alpha) and then scaled up again, both scaling used cubic interpolation: http://larma.de/blur_sample_cubic_scaled_4x3.jpg

  59. Link Mauve

    Tbh I don’t recognise any feature of the original image in either of the 4×3.

  60. jonas’

    larma, can you use cubic in browsers?

  61. larma

    well, you can see a rough estimate of the color

  62. Link Mauve

    jonas’, you can use any algorithm with the <canvas> API.

  63. Zash

    Point is to have something to show until you download the actual image

  64. jonas’

    Link Mauve, sure

  65. larma

    The problem is that if you don't have alpha in the preview you can't correctly display it if the final image has alpha and you want to display it on background of varying color (which we need to consider in a heterogenous environment like public XMPP network). You certainly could add an alpha component to blurhash, but then you couldn't reuse existing implementations, making it probably harder to use (and not smaller in size) than just using bitmap data.

  66. jonas’

    larma, not wrong, but I wonder how that cubic interpolation of yours would look like with alpha

  67. larma

    I guess cubic interpolation isn't that good for images that typically have alpha. It works good for photos, not necessarily for graphics

  68. jonas’

    yep

  69. jonas’

    downscaling alpha also doesn’t work wel

  70. jonas’

    downscaling alpha also doesn’t work well

  71. larma

    but blurhash also doesn't work well for anything that is not photos, so that's a general issue for these kinds of things

  72. jonas’

    exactly

  73. jonas’

    but I guess one could pick a blurhash-y thing for JPEG input and a simple downscaled bitmap for non-JPEG input

  74. larma

    with alpha: http://larma.de/blur_cat_base.png image scaled to 4x4 (32-bit with alpha) and scaled up to original: http://larma.de/blur_cat_cubic_scaled_4x4.png

  75. jonas’

    hm, probably OK on a uniform coloured background

  76. jonas’

    hm, probably OK on a uniformly coloured background

  77. larma

    would probably have more effect on images where more than just a few pixels on the edges have transparency

  78. larma

    http://larma.de/blur_xmpp_base.png, http://larma.de/blur_xmpp_cubic_scaled_4x4.png

  79. larma

    in any case scaling down to very small images and reducing color depth and then scaling up again gives decent enough results, at least on the same level of blurhash, if you use some more advanced interpolation. If for some reason your platform does not allow you to do this, but you can do gaussian blur, an alternative would be to use no interpolation when scaling up and then apply gaussian blur (with radius set to scaling factor) on the few "very large pixels". Results should be similar.

  80. larma

    especially implementation work for everyone who can't use any of the existing encoder and decoders is going to be much less when being based on simple rgb bitmaps instead of complex encodings.

  81. jonas’

    sure

  82. jonas’

    makes sense

  83. Zash

    MattJ, jcbrand, either of you happen to have an updated XEP-0317: Hats somewhere in your TODOs?

  84. MattJ

    Yes

  85. MattJ

    edhelas also expressed an interest in it recently, maybe he'll beat me to it

  86. SamWhited

    I think a lot of distros (maybe Debian?) enable Firefox's anti-fingerprinting protections by default (which disables dark mode entirely)

  87. SamWhited

    For whomever was saying it wasn't working in Firefox.

  88. Zash

    Wasn't that Firefox mobile? Worksforme with Firefox on Debian

  89. SamWhited

    oh, fair, I just saw "doesn't work in Firefox" in the history and was taking a wild-ass guess. So grain of salt.

  90. moparisthebest

    Zash: https://addons.mozilla.org/en-US/firefox/addon/darkreader/ actually seems to work great on almost all sites

  91. mathieui

    moparisthebest, yes but is quite heavy

  92. mathieui

    (I mean if you don’t have a recent multicore machine you will struggle on anything but simple pages like linkmauve.fr)

  93. Link Mauve

    linkmauve.fr once again > *

  94. moparisthebest

    I haven't noticed any problems, I even use it on my android firefox

  95. Zash

    Good thing I broke my new laptop and only use a 9 year old thinkpad.

  96. Zash

    (stationary thinkpad, grown stuck to my desk)

  97. mathieui

    moparisthebest, I noticed on an i7-7700k with 16GB of ram

  98. eta can't reach linkmauve.fr

  99. Link Mauve

    :o

  100. eta

    Link Mauve, oh, you don't do port 80

  101. Link Mauve

    No, only port 443.

  102. Link Mauve

    It should be part of hsts preload though.

  103. eta

    huh, so it is

  104. eta

    (checking hstspreload.org)

  105. eta

    that reminds me, I need to fix HSTS on theta.eu.org

  106. Ge0rG

    HSTS preload. Whoever had that idea needs to be punished in horrible ways. I mean, yes, it works for something like the top 1000, but how are you supposed to bundle all the crypto nerds' homepages into all the browsers?

  107. moparisthebest

    seems to be working no?

  108. Ge0rG

    So I need to submit all my websites to make it break?

  109. moparisthebest

    submit them all, it'll be fine

  110. Zash

    inb4 Ge0rG submits <every uuid>.example

  111. Zash

    Aren't browsers also shipping CRLs embedded? And all sorts of stuff

  112. Zash

    Ge0rG: Looks like it's only 12MB uncompressed JSON https://github.com/chromium/chromium/blob/master/net/http/transport_security_state_static.json

  113. Ge0rG

    Zash: well yes, that's *before* I submitted all my domain names! 😁

  114. jonas’

    SamWhited, I have the issue on android, and it’s officially not supported according to MDN

  115. lovetox

    that there is a execute action and an execute attribute and both have defaults if absent

  116. lovetox

    is beyond confusin in 0050

  117. Zash

    yeah

  118. lovetox

    The action "execute" is equivalent to the action specified in the "execute" attribute. If the "execute" attribute is absent, it defaults to "next".

  119. lovetox

    that sentence is a real treat

  120. lovetox

    what default to next here

  121. lovetox

    the action or the attribute

  122. Zash

    You're telling me it's still confusing after this went trough council? :/

  123. lovetox

    actually no

  124. lovetox

    the way this is written, it must be the attribute that is meant

  125. Ge0rG

    It was even more confusing, and then there was a long discussion how to remove the confusion without changing any normative text

  126. lovetox

    it would be so much clearer if the execute action simply did not exist

  127. Zash

    I was thinking that execute = start

  128. lovetox

    execute = everything

  129. lovetox

    wait, is the execute action a real action element?

  130. lovetox

    its not in any of the examples

  131. Zash

    Isn't it the first step?

  132. Zash

    https://xmpp.org/extensions/xep-0050.html#execute-simple

  133. lovetox

    yes

  134. lovetox

    the question was, will i see in real life ever a <execute/> element

  135. Zash

    no

  136. lovetox

    no

  137. lovetox

    yeah, ok starts to make more sense slowly

  138. lovetox

    would be useless

  139. Zash

    action=execute → status=executing → { action=next|prev|complete } → status=completed

  140. lovetox

    ah so i can simply never send action=execute

  141. lovetox

    except for the first command

  142. Zash

    you MAY, or not. it's the only option at that point, so redundant

  143. lovetox

    ok that makes it simpler

  144. lovetox

    because from a gui standpoint, if i draw buttons next, prev, etc

  145. lovetox

    but when clicking on them i send "execute" suddenly

  146. Zash

    Link Mauve, p.box (Note: ...) has black text

  147. Lance

    you can send action=execute any time. but it's the "idk what i want, you decide for me" option. so the responder decides what actually happens

  148. Link Mauve

    Zash, do you want to fix it, or should I do it?

  149. Zash

    Link Mauve: Do *you* want to? I can, but not now.

  150. Lance

    i'd wouldn't send action=execute if a user actually clicked on a prev/next/complete button, just the explicit action the user chose

  151. Link Mauve

    Zash, I’m working on Jingle stuff.

  152. Link Mauve

    I can do it at some point too.

  153. lovetox

    yeah Lance thats what i also think

  154. Lance

    only time id consider using action=execute would for some automated exchange, where i just want to fast track though the default happy path the responder wants

  155. Lance

    but even then, ehhh

  156. lovetox

    oh wow just found this

  157. lovetox

    If the <actions/> possesses the "execute" attribute, that value is the default button or option. If the <actions/> does not possess the "execute" attribute, there is no default button or option.

  158. lovetox

    thats what i was actually searching

  159. lovetox

    so i just pick whatever the execute attr tells me and color my button

  160. lovetox

    and i never have to actually send execute or even care what it "defaults" to if its not htere

  161. Lance

    yeah, the whole execute attribute thing is entirely for UI guidance/hinting on the submitter side. if you're the responder and receive action=execute it just means you get to choose what happens instead of the submitter choosing

  162. Lance

    the ambiguity in the model comes from when the responder provides (or doesn't provide any) UI hints that match what it would choose

  163. Zash

    Ought to have been called "default", but oh well

  164. Lance

    err, UI hints that _do not match_ what it would choose

  165. lovetox

    i think the problem is that i trys to fill 2 jobs

  166. lovetox

    first provide a UI hint

  167. lovetox

    2. for this rare usecase where i just want to send "execute"

  168. lovetox

    i wonder how a xmpp lib fullfills both things

  169. lovetox

    because the xep says, execute defaults to "next"

  170. lovetox

    but obviously a xmpp lib should not fill the var with "next" otherwise the UI doesnt know that there was no default action and no UI hint should be given

  171. lovetox

    either way, after working this out now, i treat it only as UI hint client side

  172. lovetox

    and i dont default it to "next", because not set means no hint should be given