tattle-made / Uli

Software and Resources for Mitigating Online Gender Based Violence in India
https://uli.tattle.co.in
GNU General Public License v3.0
40 stars 29 forks source link

Integrate inject slur with metadata code in browser extension. #607

Closed aatmanvaidya closed 2 months ago

aatmanvaidya commented 3 months ago

We track all the work on integrating the decided approach in the browser extension here.

aatmanvaidya commented 3 months ago

@hardik-pratap-singh can you reply to this issue, will assign it to you

hardik-pratap-singh commented 3 months ago

Yes, please assign this issue to me @aatmanvaidya

aatmanvaidya commented 3 months ago

@dennyabrain had two questions for you

  1. How should the metadata for slur's word's be fetched? from a json/csv file or we make GET requests to the database?
  2. We discussed this early on - that the slur replacement feature show slur metadata feature are mutually exclusive and when slur replacement is happening we won't show the slur metadata and vice versa. My questions is - in the preferences page should there be a separate checkbox for Enable Slur Metadata or will it be understood that when slur replacement is off, show slur metadata turns on. I think we should have a separate checkbox, because that allows the user to turn both the features off if needed.
dennyabrain commented 3 months ago

@aatmanvaidya

  1. So the metadata should be fetched via a GET request to the server. On the server side, for now it doesnt have to fetch the data from the database. It can just fetch from a static .csv or .json file. Once we have it all working, we can modify the function to fetch from the database.
  2. Lets have a checklist for both. Lets keep it configurable for now. The preference page is becoming a bit big, but fixing/redesigning that can be a future issue.
hardik-pratap-singh commented 3 months ago

Hello @dennyabrain @aatmanvaidya !! I have been working on integrating our functions with the plugin

Updates :-

1) Currently, our functions for show slur metadata will run when slurReplacement feature is turned off by the user. 2) For the time being, our functions are present in transform-general.js and a master function processNewlyAddedNodesGeneral2 is created (for better understanding) which is calling the other functions sequentially. It can be renamed later as per our mutual discussion.

First Version of Uli with Show Slur Metadata feature :-

Screencast from 23-08-24 12:02:37 AM IST.webm

dennyabrain commented 3 months ago

@hardik-pratap-singh this is looking great :) I noticed that on the google search result page, the popup gets clipped by other elements. Do you think its possible to fix it?

@aatmanvaidya You take a call on whether doing this is feasible in the DMP project duration. Can we replace the svg icon with something like this? Where the slur word has a fill with feather blur behind it.

Frame 5(1)

I think this is visually less jarring. @hardik-pratap-singh you can tell aatman the feasibility of doing this in the time we have. I know this is a last minute request, so don't feel the pressure to deliver this. We can always take this up as an improvement issue later on.

hardik-pratap-singh commented 3 months ago

Thanks @dennyabrain for your inputs.

1) I am looking into the designing of the popup. We are injecting span tags into the DOM and it is taking the style of its parent element, issue is happening because of that only. 2) Will look for this highlight feature.

hardik-pratap-singh commented 3 months ago

Hello @dennyabrain @aatmanvaidya ! As discussed above, Enable Slur Metadata checklist is integrated and working as expected.

I have attached a demo video for your reference Screencast from 24-08-24 11:00:04 AM IST.webm

Please let me know your inputs for the same.

aatmanvaidya commented 3 months ago

Hi @hardik-pratap-singh ,

this looks great! whenever you get time, do raise a PR, I can start reviewing it independently.

hardik-pratap-singh commented 2 months ago

Slur Metadata Functionality:

Enable_Slur_Metadata_Ver_1.webm

PTAL @dennyabrain @aatmanvaidya

aatmanvaidya commented 2 months ago

resolved in https://github.com/tattle-made/Uli/pull/615