tatoeba2 icon indicating copy to clipboard operation
tatoeba2 copied to clipboard

Change "Latest contributions" to use sentence text as click target

Open githubshrek opened this issue 4 years ago • 6 comments

Currently the https://tatoeba.org/eng/contributions/latest page uses the "i" icon at the end of the sentence to link to the sentence page. I propose that we:

  • use the sentence text itself to do the link (using the same Tatoeba-green link colour and hover behaviour as the link to the user profile)
  • remove the "i" icon, which will then become redundant

image

This is the same concept as expressed in https://github.com/Tatoeba/tatoeba2/issues/2779 but explicitly making the change here on the "Latest contributions" page. Indeed, this would be a gentle way to introduce the idea of linking based on the sentence text.

I would also remove the then redundant "i" icon.

image

githubshrek avatar May 10 '21 09:05 githubshrek

I've implemented this locally and I think it works very well.

Home page:

image

Latest contributions page:

image

githubshrek avatar May 14 '21 06:05 githubshrek

For reference documentation (mine more than anyone else's), the following are the key files and changes to achieve this:

src/Template/Element/latest_contributions.ctp

This file is the shell around the Latest Contributions and did not need changing. (The shocking pink is just some local testing.) image

src/Template/Contributions/latest.ctp

Also part of the shell and did not need changing.

src/Template/Element/logs/log_text.ctp

This contains the sentence itself. It also contains the "infoLabel" (e.g. "added by admin, 9 days ago") image

src/Template/Element/logs/log_entry.ctp

This contains the "info" icon, which is no longer needed. image

webroot/css/layouts/elements.css

Changed here the text size of the sentence. The clickable sentence needed (I think) to appear bigger than the default size once it became the clickable target. Original size: image

Larger size image

githubshrek avatar May 14 '21 16:05 githubshrek

Thanks for your suggestion. While I get the UI benefits of using the sentence text as click target, having the whole text in green feels a bit odd to me. Sorry that I can’t really explain the reason, I just feel something’s wrong. It may be just about my sticky habits.

For reference documentation (mine more than anyone else's), the following are the key files and changes to achieve this

Consider pushing theses changes in your fork instead of using this issue as a memo.

jiru avatar May 19 '21 13:05 jiru

Consider pushing theses changes in your fork instead of using this issue as a memo.

Yes, I understand the theory. The main problem is that currently my development environment is not set up properly at all. I have got Imouto setup working with Vagrant, but I don't have a Windows command box which can access it, so my actual git work is going on in a totally different folder. That means that when I've made changes I am happy with in Imouto then I manually copy the files across to the folder with my git tracking! Yes, I know it's a mess, but it's one reason I'm also carefully documenting with screenshots the work I'm doing so that I don't lose track completely.

Let me add in my slight defence that as this is a very part time thing I have to make difficult choices as to where I spend my limited time on this. If I have, say a few hours to work on it this month, do I use that time to try and sort out my development environment, or do I use it to try and build the API and live with the environment mess. If this was my full time job, I would of course take the "OK, first, let me take as long as it takes to get the environment set up super sweet...".

githubshrek avatar May 19 '21 15:05 githubshrek

It’s okay :+1:

jiru avatar May 20 '21 13:05 jiru

Note that in the past the text of a sentence was a clickable link. However, I think it was thought that the "i" icon would be more intuitive for people and was changed. I think perhaps that at that time some people also had trouble when they tried to copy the sentence's text from the page. However, now we have a "copy" button next to each sentence to do this.

Unless there is a good reason to revert this, I think this issue could be closed.

ckjpn avatar Jul 01 '22 02:07 ckjpn