sam
(Sam Saffron)
Outubro 28, 2019, 6:35am
1
This drives me crazy almost daily.
I upload a retina screenshot
Immediately reach the mouse to the preview area to get the “resize controls” and size it down
The controls are not there on hover
I move mouse away
Then I reach back to the preview area again and the controls are there
Overall I am not even a fan of having “resize controls” a hover-only thing.
I can think of 2 options here of improving this
We can fix the bug so, upload -> hover, shows controls right away.
We can just display the “resize controls” unconditionally (maybe a bit more subtly)
Personally I prefer (2) but was wondering what @codinghorror and @awesomerobot and the community think here?
11 curtidas
I don’t see this. Is it a latency thing?
1 curtida
sam
(Sam Saffron)
Outubro 28, 2019, 6:52am
3
Extremely likely, 100% reproducible in Firefox in Australia against meta.
4 curtidas
Stephen
(Stephen)
Outubro 28, 2019, 8:02am
4
So the fix is relocation?
10 curtidas
Adding my vote for option 2. This is an extremely handy feature but I think it’s quite easy to miss if you don’t know about it.
3 curtidas
Johani
(Joe)
Outubro 28, 2019, 10:41am
6
I see no harm in showing the resizing controls in the preview unconditionally for three reasons:
The first is that we only “hide” them with opacity
https://github.com/discourse/discourse/blob/master/app/assets/stylesheets/common/d-editor.scss#L198
which means they still occupy some space even when they’re invisible. The wrapper is absolutely positioned, but we add some padding to .image-wrapper
The second is that the feature would then work on mobile as well, which it currently doesn’t for me even though it’s supposed to work
https://github.com/discourse/discourse/blob/a8a76198b146d06ce6793d0e0514a8ca93bc993c/app/assets/javascripts/discourse/components/composer-editor.js.es6#L1081-L1083
The third is that it would increase the discoverability of the feature.
Short of that, what we can do is make it so that the controls for all images are visible when you hover the preview panel, not individual images. As well as fix the issue on mobile (which might only be limited to my devices)
If we make the controls unconditionally visible, we can also spend a bit of time on making them look nicer.
15 curtidas
Yeah I’d prefer these to be always visible and an overlay on top of the image so the spacing doesn’t appear to be larger in the composer vs the actual post.
One reason why we didn’t originally do this is because you’d see the controls flicker terribly as you typed. I think there were some changes made that reduced the flicker, but the controls are still removed from the DOM entirely once you start typing… once that gets sorted out absolutely go ahead and restyle them so they’re always appearing @johani !
8 curtidas
sam
(Sam Saffron)
Outubro 29, 2019, 4:55am
8
I am not seeing any flickering when I remove the opacity, so I guess we sorted the issue out?
I fixed (1) per:
https://github.com/discourse/discourse/commit/001c593155e8e6a53715cd9485c7c594e4999a23
But I still feel the meat here is that the issue is not properly discoverable and depends on hover.
@Johani maybe do a theme component for styling this now (since you can do pure CSS to get whatever you want) be sure to test this on a very very short image. Then install the component on dev and meta so we can live with it for a bit and decide if we prefer this or not?
8 curtidas
Yeah I think a debounce was added at some point? Now that you fixed that first issue everything looks fine.
3 curtidas
Uau, não acredito que 2019 foi há um ano inteiro
main ← ux-image-preview-controls
opened 10:07PM - 14 Jun 24 UTC
This makes it so the image resize/alt-text controls in the composer editor are a… lways visible on desktop, instead of relying on hover (they're already always visible in the mobile preview).
This makes the controls more discoverable, and if we position them over the image, it means we end up with a preview that has spacing much closer to the cooked result.
We planned on doing this long ago, but lost sight of it: https://meta.discourse.org/t/make-it-more-obvious-an-image-is-resizable-when-uploading-an-image/132030
Before:

After:

and cooked spacing...
Preview before:

Preview after:

Actual spacing in cooked post:

For tiny images... more of the image is obscured this way, but there's a slight transparency so it's still somewhat visible:
Before:

After:

Other states like grid and editing:


3 curtidas
chapoi
Outubro 7, 2024, 5:51am
11
Eu, pessoalmente, não sou a favor dessa mudança. Torna tudo muito mais movimentado. Havia algum problema real com a descoberta de redimensionamento?
1 curtida