Skip to content
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

Allow Hiding Images #1483

Open
wants to merge 2 commits into
base: v0.4
Choose a base branch
from
Open

Allow Hiding Images #1483

wants to merge 2 commits into from

Conversation

psycotica0
Copy link
Contributor

When we get an image we can display, rather than just putting the image in we now nest it inside an expander, which allows it to be hidden.

Now if someone has sent you an image you don't want to see anymore, you can make that choice for yourself. Maybe the image was spam, maybe someone was messing with you, or maybe it made perfect sense in context but you're just tired of seeing it in the backscroll. In any case, you hide it and it stays in the history and can be expanded at any time in the future, but it's hidden until then.

This state is preserved across conversation changes and restarts, so leaving a conversation and coming back will still not show the image.

To preserve this the state is changed to a "collapsed" state. It's a little weird to use the file transfer state for this, but it doesn't really make sense to have a collapsed image in any other state than completed, so I didn't want it to be a new boolean column. Actually, it's weird to put this one the transfer at all, but it seems like this table is considered the source of this UI, and there isn't really another place to information about the image other than the transfer object.

We can change this later if we decide it was a bad idea.

Here's what it looks like:
image

The gesture and overlay handlers both had lambdas, which appear to hold
"this" open, which prevented this from getting cleaned up when the
widget was removed from the tree.

Currently the level above this is always FileWidget, and FileWidget is
hard-coded to call "dispose" manually, but if this widget gets put into
another Widget that isn't special, it leaks.

This fixes this.
When we get an image we can display, rather than just putting the image
in we now nest it inside an expander, which allows it to be hidden.

Now if someone has sent you an image you don't want to see anymore, you
can make that choice for yourself. Maybe the image was spam, maybe
someone was messing with you, or maybe it made perfect sense in context
but you're just tired of seeing it in the backscroll. In any case, you
hide it and it stays in the history and can be expanded at any time in
the future, but it's hidden until then.

This state is preserved across conversation changes and restarts, so
leaving a conversation and coming back will still not show the image.

To preserve this the state is changed to a "collapsed" state. It's a
little weird to use the file transfer state for this, but it doesn't
really make sense to have a collapsed image in any other state than
completed, so I didn't want it to be a new boolean column. Actually,
it's weird to put this one the transfer at all, but it seems like this
table is considered the source of this UI, and there isn't really
another place to information about the image other than the transfer
object.

We can change this later if we decide it was a bad idea.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant