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

Made #channel link in /mentions jump to #channel split #2220

Merged
merged 7 commits into from Nov 28, 2020
Merged

Made #channel link in /mentions jump to #channel split #2220

merged 7 commits into from Nov 28, 2020

Conversation

zneix
Copy link
Collaborator

@zneix zneix commented Nov 24, 2020

Pull request checklist:

  • CHANGELOG.md was updated, if applicable

Description

The #channel part in /mentions tab is a link and as fourtf once said, it was supposed to take you to the channel and message that you were mentioned in - very similar to how it is done on Discord, but it wasn't working properly and even shown those bugged URL links on some environments (See #2087).

I looked at code from channel switcher and in a pretty similar way added it here. And while channel switcher opens up a new channel when the target channel is closed, I assumed that messages in /mentions come always from already open channels and there's no real need to make this function open a new channel because I assume that the split with a channel will still be open.

While switching current SplitContainer and the Split itself works flawlessly, I wasn't really able to implement scrolling to certain message - maybe I can look into that further in the future and send another PR with the solution, but for now this is better than nothing and also fixes an open issue.

GIF with demonstration https://cdn.zneix.eu/q8Hh5mh.png

Closes #2087
Closes #1126

@leon-richardt
Copy link
Collaborator

Now that we use this in multiple places, it might make sense to provide the openPages() functionality in some public interface.

(Not sure if appropriate for this PR but just something to keep in mind.)

@zneix
Copy link
Collaborator Author

zneix commented Nov 24, 2020

Not sure if appropriate for this PR

I think that's appropriate, since I've made use of this method and we might as well refactor that to some publicly available function because I bet it might be used somewhere else as well.
I will try something and if that's not okay, I can always revert it.

Update: I have another feature in mind which might also make use of openPages() and I will move it to some public interface then.

src/widgets/helper/ChannelView.cpp Outdated Show resolved Hide resolved
src/widgets/helper/ChannelView.cpp Outdated Show resolved Hide resolved
src/widgets/helper/ChannelView.cpp Outdated Show resolved Hide resolved
@pajlada pajlada changed the title Made #channel link in /mentions tab select split in which you were mentioned Made #channel link in /mentions jump to #channel split Nov 28, 2020
@pajlada pajlada merged commit 49fa9bf into Chatterino:master Nov 28, 2020
@zneix zneix deleted the jump-to-channel-on-mention-channel-link branch November 28, 2020 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants