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

3771 mark post as reply #3778

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Lakoja
Copy link
Collaborator

@Lakoja Lakoja commented Jun 29, 2023

Fixes #3771 / partly addresses #1469

grafik

This shows in a timeline the status info "In reply to < username>" just like the existing "< username> boosted" above a status.

This is a more or less low-hanging fruit as the information is available and the web gui does this (but see review comments here for details).

This is NOT the requested "Show thread" functionality - which would still need to be discussed; i.e. every reply makes a thread?

@@ -207,8 +207,8 @@ fun TimelineStatusWithAccount.toViewData(gson: Gson, isDetailed: Boolean = false
id = status.serverId,
url = null, // no url for reblogs
account = this.reblogAccount!!.toAccount(gson),
inReplyToId = null,
inReplyToAccountId = null,
inReplyToId = status.inReplyToId,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Would be consistent (a boost can also be a reply).

Copy link
Collaborator

Choose a reason for hiding this comment

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

But the boost itself is not the reply, right? The actionable status is the reply

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What is boosted ("status") can be a reply (too).

This info is "unused".

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I see now, this is here as a hack to populate the inreplyto timeline account of the concrete statusviewdata when it's a boost of a reply.
…but as you say, we're not displaying that information, so it could be reverted to avoid confusing the issue (although the status/actionable thing is already confusing)

app/src/main/res/drawable/ic_reply_24dp.xml Outdated Show resolved Hide resolved
Copy link
Contributor

@nikclayton nikclayton left a comment

Choose a reason for hiding this comment

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

A couple of low-hanging things I spotted. Later today I'll check this out locally and take a proper look.

@nikclayton
Copy link
Contributor

I haven't tested this yet, but I've just observed the following:

  1. item_status.xml (and related layouts) have a R.id.status_info view at the top, which is where the "X boosted" message goes.
  2. StatusBaseViewHolder.java has a setIsReply method that's called whenever the status is a reply

So, in StatusViewHolder.java, wouldn't it be simpler to just do this:

protected void setIsReply(boolean isReply) {
    super setIsReply(isReply);
    if (isReply) {
        statusInfo.text = getString(R.string.post_replied_format, ...)
    }
}

?

Also, what should happen if the status was a reply, and it was reblogged? https://chaos.social/@jollysea/110668273086228868 is an example post that is a reply that was reblogged by @mcclure.

  1. The "X boosted" message is more important
  2. The "In reply to Y" message is more important
  3. The message should be "X boosted this reply to Y"
  4. Show two lines of text

Note that that status above is an interesting edge case for this, because it's mcc reblogging a reply to her own post, so although option 3 might be generally good, it would lead to "mcc boosted this reply to mcc". Which might be more mcc than a single line can handle :-)

@Lakoja
Copy link
Collaborator Author

Lakoja commented Jul 10, 2023

So, in StatusViewHolder.java, wouldn't it be simpler to just do this:

protected void setIsReply(boolean isReply) {
    super setIsReply(isReply);
    if (isReply) {
        statusInfo.text = getString(R.string.post_replied_format, ...)
    }
}

?

Instead of what?
At least all the changes before and in (now) setStatusInfoText() would be necessary as they also deal with emojis and a maybe different name.
And at least at the moment the setIsReply() only deals with two different reply cases. The reblog information is orthogonal.

@Lakoja
Copy link
Collaborator Author

Lakoja commented Jul 10, 2023

Also, what should happen if the status was a reply, and it was reblogged? https://chaos.social/@jollysea/110668273086228868 is an example post that is a reply that was reblogged by @mcclure.

3. The message should be "X boosted this reply to Y"

I kind of like option 3.
However that might be too much information? (and will often be too long, names tend to be long...)
2 lines will also be too much, I think.

At the moment (in my code) reblog is more important than reply. So an "if ... else if" logic.

@@ -17,7 +17,7 @@
android:layout_marginStart="14dp"
android:layout_marginTop="@dimen/status_reblogged_bar_padding_top"
android:layout_marginEnd="14dp"
android:drawableStart="@drawable/ic_reblog_18dp"
android:drawableStart="@drawable/ic_reblog_24dp"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this switching to the bigger icon? It causes the effective left margin of the text to change.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, you could copy ic_reply_24dp.xml to ic_reply_18dp.xml`, and then use that for replies.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The size is determined by the component (height of TextView).

Already before: The text behind the drawable is not alligned with the name or the content below. This does not change here.

So I could leave it as 18 but that would not change it graphically.

@nikclayton
Copy link
Contributor

@Lakoja Can you take a look at Lakoja#4, and see if you want to merge that in to this PR? I figured that was easier than more back-and-forth.

You'll want to merge develop in to this PR first to minimse the diffs.

Some quick screenshots:

It shows reply and boost, with a bullet between them

image

image


If the account isn't known, but mentioned, it uses the @-form of the user name

image


Long lines are truncated / ellipsised

image


I'm not 100% convinced that moving the left margin over is a good idea, but as you can see from the screenshots, sometimes the line does get quite long.

WDYT?

@Lakoja
Copy link
Collaborator Author

Lakoja commented Jul 29, 2023

Some quick screenshots:

WDYT?

I find the lines with two information quite hard to parse visually.
(thus) I still wouldn't present two informations there.

@nikclayton
Copy link
Contributor

nikclayton commented Jul 30, 2023

Some quick screenshots:

WDYT?

I find the lines with two information quite hard to parse visually. (thus) I still wouldn't present two informations there.

I think that might be a problem, because with this PR we're trying to use the statusInfo to show two difference pieces of information.

Currently the statusInfo answers the "Why am I seeing this in my timeline?" question. It tells the user "You are seeing this because someone you follow has boosted it".

This PR extends that to also answer the "Can I tap on this post to read a thread?" question.

I'm not sure that only ever showing one bit of information is a good idea, because it means that users will not be able to rely on the information in the statusInfo -- what's shown will vary, and it will be difficult for users to figure out why it's varying.

By which I mean that some replies -- replies from people that the user follows -- will be marked as replies, and the user will know they can tap the post to see the thread.

But other replies -- replies from people they don't follow that have been boosted by someone they do -- will not be marked as replies.

[I know the "reply" icon at the bottom of the post will change as well, but as we see from the bug reports, this is also something that users don't always notice]

If we flip that example around, and decide that showing that it's part of a thread is more important than showing that it's a boost, then we get the problem that a user can see "user-i-dont-follow replied to ..." in the statusInfo, and not know why this post is appearing in their timeline.

The first screenshot in my previous comment is an example of that. I don't follow rain, but I do follow Norm.

Both of those seem like a recipe for user confusion.

I think we can collapse some of the information down. For example, if someone boosts their own post there's no need to show their display name again.

And we could experiment with putting some of the information elsewhere. I'm not sure a two-line statusInfo is a good idea, but maybe the "reply" icon could appear next to the display name of the poster (i.e., the displayname that appears to the right of the avatar)? That would leave the statusInfo for boosts (and later, hashtags).

But... that would mean the left-edge of the display names would jump around a bit as the user scrolls through their timeline.

[Edit: Putting a reply icon next to the display name is a bad idea -- users could easily add an emoji to their display name that looks like a reply icon (or other), which would be very confusing.]

I'll try some mockups and see what happens.

@nikclayton
Copy link
Contributor

Here's the latest variant (I'm still waiting for a self-boost to cross my timeline).

Replying to themselves

image

@nikclayton
Copy link
Contributor

Some of #3883 is relevant to this as well. There's one, possibly two additional values that can be included in the status_info, but they're mutually exclusive with the others (I think). They are:

  • "Sent you a direct message"
  • "Replied to your direct message"

or similar. Possibly with "direct message" in that text in bold, or bold tusky_red, or something like that, to make it even more distinctive.

@Lakoja Lakoja requested a review from Tak October 3, 2023 15:05
Copy link
Collaborator

@Tak Tak left a comment

Choose a reason for hiding this comment

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

Doesn't this need a database migration for TimelineAccountEntity?

@@ -207,8 +207,8 @@ fun TimelineStatusWithAccount.toViewData(gson: Gson, isDetailed: Boolean = false
id = status.serverId,
url = null, // no url for reblogs
account = this.reblogAccount!!.toAccount(gson),
inReplyToId = null,
inReplyToAccountId = null,
inReplyToId = status.inReplyToId,
Copy link
Collaborator

Choose a reason for hiding this comment

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

But the boost itself is not the reply, right? The actionable status is the reply

boolean sensitive = !TextUtils.isEmpty(status.getActionable().getSpoilerText());
boolean expanded = status.isExpanded();

setupCollapsedState(sensitive, expanded, status, listener);

Status reblogging = status.getRebloggingStatus();
if (reblogging == null || status.getFilterAction() == Filter.Action.WARN) {
boolean isReply = status.getStatus().getInReplyToId() != null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't you need to use status.getActionable here, and on line 90?

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 was searching for some time for the right location with the right information.
"actionable" was not it if I remember correctly.

It is working and plausible at the moment.

(Would need to look deep(er) into the code if you want me to be 100% certain about this.)

Copy link
Collaborator

Choose a reason for hiding this comment

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

You're right, the inreplyto timeline account is only available on status, but without the timeline type mapper change, the correct thing to check for the inreplyto id is the actionable status. (And if status.getActionable().getInReplyToId() is nonnull, then status.getInReplyToAccount() will be as well.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What is the meaning of "actionable" in current code?

I see that it only has a value if "reblog" is true (Status.kt:59), so the thinking is probably "the item the action was taken for"?

(The "reply stuff" I have aligned more with the extsting "inReplyToAccountId".)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, my understanding is that the "outer" status is the boost itself, and the actionable status is the status that was boosted

@Lakoja
Copy link
Collaborator Author

Lakoja commented Oct 5, 2023

Doesn't this need a database migration for TimelineAccountEntity?

There is no change there?

All info here is present (in rare cases the "replied to account info" might be missing and then the name is not show).

@mcclure
Copy link
Collaborator

mcclure commented Oct 6, 2023

What does this patch do if a post is BOTH a reply AND an RT?

@Tak
Copy link
Collaborator

Tak commented Oct 6, 2023

The current PR code displays this when a reply is boosted

Screenshot 2023-10-06 at 11 12 35 AM

@Tak
Copy link
Collaborator

Tak commented Oct 6, 2023

Oh, it looks super weird in the thread view - is that intentional?

@Tak
Copy link
Collaborator

Tak commented Oct 6, 2023

I guess this change should be applied to the notification timeline as well? (Maybe in a second pass after the refactor lands?)

@Lakoja
Copy link
Collaborator Author

Lakoja commented Oct 6, 2023

Oh, it looks super weird in the thread view - is that intentional?

No.
(Super weird: it shows "Replied" above every status.)

I fixed it by not showing the status info in the thread view.

But I guess the introduced flag should/could be part of "StatusDisplayOptions" object?

@Lakoja
Copy link
Collaborator Author

Lakoja commented Oct 6, 2023

I guess this change should be applied to the notification timeline as well? (Maybe in a second pass after the refactor lands?)

Yes, probably and yes.

@@ -120,6 +120,7 @@ glide-compiler = { module = "com.github.bumptech.glide:ksp", version.ref = "glid
glide-core = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
glide-okhttp3-integration = { module = "com.github.bumptech.glide:okhttp3-integration", version.ref = "glide" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
kapt = { module = "androidx.room:room-compiler", version.ref = "androidx-room" }
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure why this is needed now (starting today)?

If I don't have this there will be a build error that the (automatically generated) AppDatabase_Impl does not implement all needed dao factory methods.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This should not be necessary as we migrated Room to ksp. If you get an error, try a clean build.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

@Lakoja Lakoja force-pushed the 3771-mark-post-as-reply branch 2 times, most recently from 4e1ac16 to 202968f Compare April 25, 2024 19:14
@Lakoja Lakoja requested a review from Tak April 25, 2024 19:14
@Tak
Copy link
Collaborator

Tak commented Apr 26, 2024

imo the changes look ok, but it will have to be rebased again after #4026 lands (after the 25.0 release) 😐
I'm really sorry that this has been in stasis for almost a year

@connyduck
Copy link
Collaborator

Should we in turn get rid of the double arrow on the reply button that currently indicates replies? It wouldn't be necessary anymore.

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.

Show that a post is part of a thread
5 participants