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

don't rehide filtered posts on interaction #4130

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions app/src/main/java/com/keylesspalace/tusky/db/TimelineDao.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import androidx.room.OnConflictStrategy.Companion.REPLACE
import androidx.room.Query
import androidx.room.TypeConverters
import com.google.gson.Gson
import com.keylesspalace.tusky.entity.FilterResult
import com.keylesspalace.tusky.entity.Status

@Dao
Expand Down Expand Up @@ -113,8 +112,7 @@ AND
muted = status.muted,
pinned = status.pinned ?: false,
card = gson.toJson(status.card),
language = status.language,
filtered = status.filtered
language = status.language
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, how does that solve the problem?

(How is "filtered" then stored?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filtered contains the filters that apply to the post. When the post is revealed, we set it to null. On interaction (boost, fav, etc) it would set the filters again. Not updating the filters here means the posts stays revealed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it also / still store the opened state once you have expanded something?

I tested this with:

  • Expand a filtered post
  • Fav it (ok, nothing bad happens)
  • Reload timeline: the post is again filtered (collapsed)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it probably should. But looks like that would require a larger refactoring 🫣

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should merge this as it improves the situation and include it in the 24 release, and I will do the refactor later.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lakoja in my opinion the post should recollapse on timeline reload, just not on Interaction. I for example have a filter for Doctor Who to avoid spoilers, and on more than one occasion I forgot on Saturday there's a new episode up and opened the filter thinking it refers to the last one I saw. I would very much want the filter to recollapse when I reload the timeline in panic trying to avoid reading the post I've accidentally revealed.
maybe that's too extreme a position (I know recollapsing on reload doesn't happen for CWs for example) but I'd argue it justified. but then again, it's all matter of opinion.

)
}

Expand All @@ -139,8 +137,7 @@ AND
muted = :muted,
pinned = :pinned,
card = :card,
language = :language,
filtered = :filtered
language = :language
WHERE timelineUserId = :accountId AND (serverId = :statusId OR reblogServerId = :statusId)"""
)
@TypeConverters(Converters::class)
Expand All @@ -166,8 +163,7 @@ AND
muted: Boolean?,
pinned: Boolean,
card: String?,
language: String?,
filtered: List<FilterResult>?
language: String?
)

@Query(
Expand Down