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

Allow right click to inspect project #13309

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

meel-hd
Copy link
Contributor

@meel-hd meel-hd commented Dec 16, 2024

Proposed changes

Allow right click to inspect project in watched projects list in profile settings.

Note: it was suggest to use middle click, but it has weird behavior and cross browser compatibility issues. Simply I went with right click instead. As it is not used.

This allows right click in /accounts/profile/#notifications in the watched project list. So users can open a project and inspect it before follwing it or not, as was suggested in issue #12434

close #12434

Checklist

  • Lint and unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation to describe my feature.
  • I have squashed my commits into logic units.
  • I have described the changes in the commit messages.

Other information

This allows right click in /accounts/profile/#notifications in the watched project list. So users can open a project and inspect it before follwing it or not, as was suggested in issue WeblateOrg#12434
@meel-hd meel-hd requested a review from nijel December 16, 2024 16:45
@nijel
Copy link
Member

nijel commented Dec 17, 2024

@comradekingu wanted the list to behave as regular links to that mouse middle click would open the link in new tab (built-in browser behavior). This, instead, adds a custom behavior to right-click, what nobody will find and will be confusing (as it also replaces the current window).

@meel-hd
Copy link
Contributor Author

meel-hd commented Dec 17, 2024

I think that will be confusing. The element isn't a link and the main action isn't opening it. So adding a behavior usually associated with links I think isn't a good idea. That being said, the right click isn't that bad of an option (if we added text informing users about it below). And about opening in a new tab I think yeah that's right. I'll do that.

@meel-hd
Copy link
Contributor Author

meel-hd commented Dec 17, 2024

@nijel the previous commit 2e88565 still uses right click. But adding middle click if it is the final choice should be fairly easy. We just need to make sure it is the right choice.

@nijel
Copy link
Member

nijel commented Dec 19, 2024

This is not about implementing custom functionality. The goal should be to make these things behave as links so that generic browser behavior for links works (besides normal click which will toggle the option in the select as now).

@meel-hd
Copy link
Contributor Author

meel-hd commented Dec 20, 2024

I understand. I'll go with that

They behave exactly like a normal link (right/mid-clickable), but noraml click is used to select and unselect.
- Added  to sanitize the  before inserting it into the  attribute.
- Prevents unsafe HTML/JavaScript injection in URLs and mitigates potential DOM-based XSS attacks.
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.

Mid-clickable expanded language lists
2 participants