-
-
Notifications
You must be signed in to change notification settings - Fork 673
Improve the flow when uploading images #3118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This makes sense to me. I can update #2887 to use the uri of the thumbnail as the On a more general level, this flow doesn't support a loss of network and an upload timeout. The right implementation would have a little button that allows for retries in case of failure to upload. |
We need to do the thumbnail before sending it though 😄 For retries we don't need a button, there is no reason why we shouldn't be retrying this automatically. I noticed we are not doing that actively enough even for unsent messages. That will be a separate PR though. |
7331049
to
2f9e237
Compare
2f9e237
to
04273ca
Compare
Hmm. The big green box feels awfully loud to me -- almost like an error message. (Would you post a screenshot? Good for this kind of UI discussion.) Here's the original issue description:
and your reply:
I think an image-shaped and -sized placeholder with a spinner -- Zulip-green on neutral background, like most of our spinners -- would probably work well. Experimenting with it now, we do have a spinner: the usual outbox spinner shows up there just fine. So I'm actually a little curious just how users respond to the current UI -- is that spinner just too subtle? (It is pretty small.) Or is there another issue? Hmm, in fact: what we don't have a spinner for is downloading, and rendering, the image. Experimenting with this on your branch, I still have the experience that it feels a bit stuck and I briefly wonder if it's making progress, because that part is slow and the message just looks blank. (In fact the green box might barely make it on screen for a frame or two, then it's blank for hundreds of ms and then fills in gradually from the top over a second or so.) I think one thing that would improve the situation is if we can get the image to show as a gray box or something when it isn't downloaded yet -- then at least it would have clearly-defined boundaries in its own shape, so it's clear there is supposed to be an image there and things aren't just weirdly all blank. |
04273ca
to
60db5e9
Compare
@gnprice @borisyankov My two cents on this PR. I really like this and I think it will go well with #2887 which I'm cleaning up right now. I feel like we can add a simple condition class using JavaScript that determines whether an image is landscape or portrait. That way the "max" dimension could be set explicitly for both. Similar to whats described here |
We don't even need any tricks. We can use the actual dimensions of the uploading image and generate a placeholder with the same proportions. |
Sounds great! |
This action can be used (and will be used!) to provide a custom preview of the message before it is sent. The original `addToOutbox` generates the preview the way we have always did via `getContentPreview` and then calls this new function.
Add a basic upload indicator just saying 'Uploading...'. That is a significant improvement over the previous behavior which showed nothing!
Increases the maximum height of the images in the message list. From 30vh to 40vh (viewport height). That is more consistent with other mobile apps' image sizing and makes sure that a typical 4x3 photo will show as large as possible (touching the left and right end of the list)
This is consistent with all mobile apps I tested (FB Messenger, Slack, Hangouts). This makes the uploaded image more clean. We should strongly consider this to be the default behavior for the web app, with potentially adding the metadata in the rendered html that can be parsed and displayed if needed.
Use a placeholder resembing an image. It is sized similar to images (100% wide and at most 40vw high) and has the green Zulip color with the text 'Uploading...' inside. A potential better future version is to pick its color by averaging the uploaded image colors, or even better to show a thumbnail.
60db5e9
to
4b4916b
Compare
Closing as stale and superseded by #4590. |
Fixes #2684