-
Notifications
You must be signed in to change notification settings - Fork 642
Blur Images #616
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
base: main
Are you sure you want to change the base?
Blur Images #616
Conversation
# Conflicts: # app/src/main/assets/nostr_relays.csv
# Conflicts: # app/src/main/assets/nostr_relays.csv
# Conflicts: # app/src/main/assets/nostr_relays.csv
Introduces a new `spoiler` Composable `Modifier` to hide content. The effect includes: - A blur animation. - An animated noise overlay with a dim background. - A ripple effect on reveal, triggered by a user tap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e5c42d50e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| val currentIndex = imagePaths.indexOf(path) | ||
| onImageClick?.invoke(path, imagePaths, currentIndex) | ||
| } | ||
| .spoiler(isOn = isSpoilerVisible) { isSpoilerVisible = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disable click before spoiler reveal in sending branch
When the sender’s image is still uploading (progressFraction < 1), this branch keeps clickable always enabled even while isSpoilerVisible defaults to true, so a single tap both dismisses the spoiler and opens the full‑screen viewer, bypassing the blur. In the fully‑revealed branch you explicitly disable clicks while the spoiler is on, so this inconsistency means spoilered images can be opened immediately for partially delivered messages.
Useful? React with 👍 / 👎.
| if (isOn != lastIsOn) { | ||
| if (!isOn) { | ||
| revealState = RevealState.Revealing(System.currentTimeMillis(), touchPosition) | ||
| } else { | ||
| revealState = RevealState.Hidden |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stop spoiler animation once reveal completes
After isOn flips to false, the state is set to RevealState.Revealing but is never transitioned to RevealState.Revealed, so the modifier keeps running the infinite transition and draw pass indefinitely even when the content is fully revealed. On chats with many images this keeps recompositions and shader updates active long after reveal, which is a performance drain that won’t self‑terminate.
Useful? React with 👍 / 👎.
|
uses the general blur radius blurRadius (as in the S+ branch), fewer recalculations, |
Screen_recording_20260115_122047.mp4
Checklist
he relevant keyword (e.g., "Closes: #xy") in the description (see https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)