Skip to content

Mute visited conversation links on conversation lists - #5258

Merged
kidonng merged 7 commits into
mainfrom
mute-conversation-link
Jan 10, 2022
Merged

kidonng merged 7 commits into
mainfrom
mute-conversation-link

Conversation

@kidonng

@kidonng kidonng commented Jan 2, 2022 •

Copy link
Copy Markdown
Member

When CSS resets became popular, :visited was one of the useful browser's native styles that got doomed.

This PR brings back :visited style to conversation links on conversation lists by using a muted color. It helps people recognize whether you have went through a conversation or not.

Note: :visited style can already be seen on Discussions (e.g. https://github.com/fish-shell/fish-shell/discussions). Not sure if it's a feature or GitHub just forgot to style them though.

Test URLs

https://github.com/fish-shell/fish-shell/pulls

Screenshot

Before After

@kidonng
kidonng marked this pull request as draft January 2, 2022 13:38
@kidonng

kidonng commented Jan 2, 2022 •

Copy link
Copy Markdown
Member Author

Let me further explain the motivation behind this.

This PR is inspired by an feature seen on v2ex.com, where links to posts have the count of comments as their hashes (e.g. a post with 42 comments will have #reply42 as the hash of its link). The site also uses a dimmed color for :visited links.

The result is that when you visit a post, the link will be dimmed. But if there is any new comment, the comment number will change, so does the hash. The :visited selector (or to say browser) considers the hash as well, so the color of the link becomes normal again.

@cheap-glitch I see you voted down this. Are you concerned that more and more links will be muted as the user visits the conversations, making the feature less useful and more annoying? My intention would be that the different colors will serve as a indicator of whether you have read a conversation or not, and whether there's any new activity after you read them, without the hassle of subscriptions.

I will implement the exact feature later, but here's a gist:

for (const row of document.querySelectorAll('.js-issue-row')) {
    const count = row.querySelector('.octicon-comment + .text-small')?.textContent

    if (count) {
        row.querySelector('.h4').hash = 'rgh-comment-count-' + count
    }
}

As for the name of the feature: dim-visited-conversations but suggestions welcome.

@fregante

fregante commented Jan 2, 2022

Copy link
Copy Markdown
Member

Duplicate of #1206 😃

@yakov116

yakov116 commented Jan 2, 2022

Copy link
Copy Markdown
Member

@kidonng you know your on the right track if the king tried this too 😛

@cheap-glitch

Copy link
Copy Markdown
Contributor

@cheap-glitch I see you voted down this. Are you concerned that more and more links will be muted as the user visits the conversations, making the feature less useful

Yes basically. But with the hash technique it might be interesting, although it still won't react to events other than comments (e.g. an approving review). Still, I'm curious to try it and see how it plays in practice.

@kidonng

kidonng commented Jan 3, 2022 •

Copy link
Copy Markdown
Member Author

Duplicate of #1206 😃

🤯 I DIDN'T EXPECT THAT! I feel so lashed out. But the idea is more than some simple CSS declarations, see my previous comment.

The implementation will be only a few lines at most so it's not something that does little with much efforts.

Yes basically. But with the hash technique it might be interesting, although it still won't react to events other than comments (e.g. an approving review). Still, I'm curious to try it and see how it plays in practice.

I'm glad you (sort of) approve the idea at last.

Technically we could put anything into the hash, including open/close state, approvals etc.

@fregante

fregante commented Jan 4, 2022

Copy link
Copy Markdown
Member

@kidonng you know your on the right track if the king tried this too 😛

lol slow down, it was rejected by the land owner

I will implement the exact feature later, but here's a gist:

I don’t think it's worth it, after all you did not open that specific/important linked comment, so it's worth to follow the browser’s logic here.

This PR is ok for me obviously, but let's see 😅

@kidonng

kidonng commented Jan 4, 2022

Copy link
Copy Markdown
Member Author

after all you did not open that specific/important linked comment, so it's worth to follow the browser’s logic here.

That's an artificial hash, not the actual hash to some comment (and there's no way to get that info on the conversation list, which is the only place the feature would run).

Previous selector doesn't work on `isGlobalConversationList`
@kidonng
kidonng marked this pull request as ready for review January 7, 2022 16:28

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I still don't think the extra JS is worth it, especially because that's not the default browser behavior.

@kidonng

kidonng commented Jan 9, 2022 •

Copy link
Copy Markdown
Member Author

I still don't think the extra JS is worth it, especially because that's not the default browser behavior.

Fine, I will revert but the implementation (3925514) will stay in this PR's history, in case someone it's interested in the future.

@cheap-glitch

Copy link
Copy Markdown
Contributor

If it stays CSS-only then I'm -1 on this. I don't really see the point, it doesn't convey any meaningful information apart from "I opened this discussion at least once at some point". I may be missing something but I can't see why that'd be useful to know, except maybe when going through old conversations that aren't updated anymore.

And yes, I know it can easily be disabled via custom CSS, but imho it doesn't make sense as a default in the first place.

@kidonng

kidonng commented Jan 10, 2022

Copy link
Copy Markdown
Member Author

So... we both have our stands. I have been using the styles for some time, as a person who often digs into many conversations, and find it helpful while unlikely to be annoying.

Don't get me wrong, I still love hash idea and will try making it a user script.

It seems there's going to be a release recently so let's merge this and see. After all it's just a single CSS rule, very easy to override locally or via hotfix.

@kidonng
kidonng merged commit b1e8e4b into main Jan 10, 2022
@kidonng
kidonng deleted the mute-conversation-link branch January 10, 2022 10:29
@cheap-glitch

Copy link
Copy Markdown
Contributor

After all it's just a single CSS rule, very easy to override locally or via hotfix

Note: because of #4731, the override selector needs to be something like:

.js-issue-row .h4.h4:visited:not(:hover) {
	color: var(--color-fg-default) !important;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants