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

Add "a href" links to clickable areas for messages and profiles and chats #81

Open
JohnVeness opened this issue Mar 7, 2024 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@JohnVeness
Copy link
Contributor

This is a continuation of the issue I wrongly filed at Freegle/iznik-nuxt#416

You have kindly added "a href" links to the title of a message, which is great, but I think this could be expanded.

At the moment, a normal click or tap anywhere in the following area shows the message in an overlay popup:
image

With 037a76d a ctrl-click (or right-click or long-press and "open in new tab") on the following area opens the message in a new tab:

image

I think it would be better if a ctrl-click (etc.) anywhere in the larger area in the first image would open in a new tab, i.e. if all that area was inside the "a href", if that's possible. In other words, the same area that opens up the message in a popup should also be available to use to opening in a new tab if the user desires.

In the original issue, I also mentioned it would be good to "linkify" profiles too, so that ctrl-clicking on the following area:
image
would open a new tab to ilovefreegle.org/profile/xxxxxxxx.

While viewing a profile page, it would be good if a link could be added to the Message button (to a ilovefreegle.org/chats/xxxxxxx URL), so the user could ctrl-click (etc.) that too, to open in a new tab.

While viewing any ilovefreegle.org/chats page, it would be good if links could be added to each individual chat entry in the left-hand pane, so they could be ctrl-clicked (etc.) to open each chat in a new tab.

There's probably other examples that I've missed, but I hope you get the idea! I.e. anywhere that is normally clickable and opens a popup or which changes the URL, should have links on them so the user can open in a new tab if they desire.

Sorry if this is long-winded, hope this is OK.

@edwh
Copy link
Member

edwh commented Mar 7, 2024

I don't think it's simple to do that. In order to (easily) make right-click work to open something, it needs to be inside an a tag. But although it's now legal to put most things inside an a tag, you're not allowed to nest them. There are examples (like the group link in your screenshot above) which already use a tags which would likely break.

There are probably ways to make this work, e.g. a custom right-click menu, but I think it's too much effort for the likely use of this case. That's partly a decision about the time we have available for making changes, so if someone else wanted to implement it, I'd be happy to review and merge it.

Similar things apply in other cases, but it might be easy to do for some cases where there isn't a complex DOM structure. I can look at them if you pick one or two favourites.

@JohnVeness
Copy link
Contributor Author

Thanks for the reply. Yeah, I wondered if the linked group name might be a problem. I don't think a custom right-click menu is a good idea.

Personally, I'd be OK with the group name not being clickable when the messages are shown in a list as in the screenshots - i.e. the group link could only be clickable once the user is viewing the full message (whether in a popup or in a new tab).

@edwh
Copy link
Member

edwh commented Mar 7, 2024

Personally, I'd be OK with the group name not being clickable

Sure, but there might be other examples of this. So we'd have to search for them to make sure, and we'd also be vulnerable to bugs being introduced in future by inserting a tags at a lower level - which is the kind of thing someone might easily do. I've just checked and it doesn't cause any compilation errors in the dev environment, so those might not be things that we'd easily spot.

I do agree with the aim, but I think it's too expensive for me to implement given the constraints on my time and the likely usage. Sorry. I'll leave the issue open for a bit in case someone else wanders along and decides to look at it, though, or comes up with a cheap solution I've not thought of.

@JohnVeness
Copy link
Contributor Author

I understand :)

@edwh edwh added enhancement New feature or request help wanted Extra attention is needed labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants