fix: hide stories floating ring - #72
Merged
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR ensures that when the "Disable Stories" option is enabled, the stories ring is not drawn around profile avatars by short‑circuiting the avatar-with-story drawing logic based on the configuration flag. Flow diagram for avatar story ring drawing with DisableStories flagflowchart TD
A[drawAvatarWithStory] --> B[set params.showProgress]
B --> C{NaConfig.getDisableStories.Bool}
C -->|true| D[setImageCoords originalAvatarRect]
D --> E[scale avatar without story ring]
C -->|false| F{params.currentState == STATE_EMPTY
&& params.progressToSate == 1f}
F -->|true| D
F -->|false| G[continue story ring drawing logic]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Consider adding parentheses or extracting a boolean to clarify the new condition
NaConfig.INSTANCE.getDisableStories().Bool() || params.currentState == STATE_EMPTY && params.progressToSate == 1f, since the current precedence may be confusing and easy to misinterpret during maintenance. - If disabling stories should also prevent setting up or animating
params.showProgressand related state, you might want to early-return or gate the earlier logic with the samegetDisableStories()check to avoid unnecessary state updates when stories are disabled.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding parentheses or extracting a boolean to clarify the new condition `NaConfig.INSTANCE.getDisableStories().Bool() || params.currentState == STATE_EMPTY && params.progressToSate == 1f`, since the current precedence may be confusing and easy to misinterpret during maintenance.
- If disabling stories should also prevent setting up or animating `params.showProgress` and related state, you might want to early-return or gate the earlier logic with the same `getDisableStories()` check to avoid unnecessary state updates when stories are disabled.
## Individual Comments
### Comment 1
<location path="TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesUtilities.java" line_range="194-196" />
<code_context>
}
params.showProgress = showProgress;
- if (params.currentState == STATE_EMPTY && params.progressToSate == 1f) {
+ if (NaConfig.INSTANCE.getDisableStories().Bool() || params.currentState == STATE_EMPTY && params.progressToSate == 1f) {
avatarImage.setImageCoords(params.originalAvatarRect);
canvas.save();
</code_context>
<issue_to_address>
**suggestion:** Clarify boolean condition with explicit parentheses to avoid precedence confusion.
Right now the condition depends on `&&` binding more tightly than `||`, so it effectively evaluates as `disableStories || (currentState == STATE_EMPTY && progressToSate == 1f)`. Adding parentheses around the second part makes this explicit and more robust to future changes:
```java
if (NaConfig.INSTANCE.getDisableStories().Bool() || (params.currentState == STATE_EMPTY && params.progressToSate == 1f)) {
...
}
```
```suggestion
params.showProgress = showProgress;
if (NaConfig.INSTANCE.getDisableStories().Bool() || (params.currentState == STATE_EMPTY && params.progressToSate == 1f)) {
avatarImage.setImageCoords(params.originalAvatarRect);
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
omg-xtao
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
if Disable Stories is enabled it won't hide the floating ring in profile pictures, this PR would solve the issue.
Summary by Sourcery
Bug Fixes: