commons-app / apps-android-commons

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons
https://commons-app.github.io/
Apache License 2.0
984 stars 1.18k forks source link

Feedback about a Wikidata item: Does not exist, Is at other location, other problem #2425

Closed nicolas-raoul closed 1 week ago

nicolas-raoul commented 5 years ago

I suggest adding a "discussion" action to the bottom panel that opens when you select a pin in the "Nearby" activity:

adb-screenshot

It would open an activity that could look like this:

Write something about the "GS1 Japan" item. It will be publicly visible.
☐ "GS1 Japan" does not exist anymore, no picture can ever be taken of it.
☑ "GS1 Japan" is at a different place (please specify the correct place below, if possible tell us the correct latitude/longitude).
☐ Other problem or information (please explain below).
--------------------------------------------------------------
| It has moved to across the street blabla.                  |
|                                                            |
--------------------------------------------------------------
                                                  |Send|
Current talk page:
blablabla
blablabla

The edit should be made with a particular edit tag, so that we can keep track of this feedback and impact the changes:

Implementing this would also solve issue #965.

Phase 2 (only after the feature above is implemented): Allow users to write a memo about the item even when offline. This would allow off-the-grid photographers with a DSLR to write down a picture filename, and later match it when they get back home.

vanshikaarora commented 5 years ago

That sounds like a good idea @nicolas-raoul. There were few points in my mind How are we going to utilise the memo added by a user? Is it like clicking on the pin will give us the details added by all the user's with a feature to add your a memo from the user's side?

nicolas-raoul commented 5 years ago

@vanshikaarora Yes, added notes will be visible by all. I forgot to say the the phase 1 notes should be added to the item's talk page. For example, here is the talk page of the item "SQUARE BUILDING", a building which has been demolished in 2007: https://www.wikidata.org/wiki/Talk:Q11311478

== Does not exist anymore ==
"SQUARE BUILDING" does not exist anymore, no picture can ever be taken of it.
~~~~
vanshikaarora commented 5 years ago

Just one more question, please. These notes will be verified by us wikimedia(for relevance) before publishing or all of them would be published?

nicolas-raoul commented 5 years ago

They can be published immediately :-) In the wiki world, we assume good will, and let anyone edit stuff. Especially talk pages.

By the way, I see what you mean by "us wikimedia", but I just want to mention that even though our app is an official Wikimedia Foundation (WMF) app, only very few of us (only Vojtech I think) are members of the Wikimedia Foundation, and we historically considered the app to be an independent effort, so we don't speak in the name of Wikimedia.

misaochan commented 5 years ago

Hmmm, I am not sure about this. The bottom panel is already quite full, adding one more item seems to make it quite cluttered. I guess the main reason why I am hesitant is that having this extra item seems to only save the user 1 tap. Since they can just go to the Wikidata item and then tap the "Discussion" tab in their browser. Granted, wiki editing in the mobile browser is a bit clunky.

Maybe we could consider a different way to implement this action in the UI. For instance, a small/discreet "Report error" text button somewhere?

nicolas-raoul commented 5 years ago

How about making the icons bar movable like the tools bar in the app "Photo Editor"? And removing the inactive icons rather than greying them out. For instance, the "Commons category" icon is grey most of the time.

On Mon, Feb 11, 2019, 01:02 Josephine Lim <notifications@github.com wrote:

Hmmm, I am not sure about this. The bottom panel is already quite full, adding one more item seems to make it quite cluttered. I guess the main reason why I am hesitant is that having this extra item seems to only save the user 1 tap. Since they can just go to the Wikidata item and then tap the "Discussion" tab in their browser. Granted, wiki editing in the mobile browser is a bit clunky.

Maybe we could consider a different way to implement this action in the UI. For instance, a small/discreet "Report error" text button somewhere?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/commons-app/apps-android-commons/issues/2425#issuecomment-462146329, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGFBprIBtRQSekIe7nRKvINDXyr3WxQks5vMEKmgaJpZM4amzeE .

On Mon, Feb 11, 2019, 01:02 Josephine Lim <notifications@github.com wrote:

Hmmm, I am not sure about this. The bottom panel is already quite full, adding one more item seems to make it quite cluttered. I guess the main reason why I am hesitant is that having this extra item seems to only save the user 1 tap. Since they can just go to the Wikidata item and then tap the "Discussion" tab in their browser. Granted, wiki editing in the mobile browser is a bit clunky.

Maybe we could consider a different way to implement this action in the UI. For instance, a small/discreet "Report error" text button somewhere?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/commons-app/apps-android-commons/issues/2425#issuecomment-462146329, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGFBprIBtRQSekIe7nRKvINDXyr3WxQks5vMEKmgaJpZM4amzeE .

misaochan commented 5 years ago

Removing inactive icons would be fantastic. :) Haven't tried the Photo Editor app yet.

vanshikaarora commented 5 years ago

And removing the inactive icons rather than greying them out.

That sounds like a great idea. I can work on this

misaochan commented 5 years ago

Thanks @vanshikaarora ! I think we don't have a separate issue for that yet, would you mind creating the issue (and stating that you are going to work on it in your post)?

vanshikaarora commented 5 years ago

Thanks @vanshikaarora ! I think we don't have a separate issue for that yet, would you mind creating the issue (and stating that you are going to work on it in your post)?

Sure I'll do that :)

vanshikaarora commented 5 years ago

The edit should be made with a particular edit tag, so that we can keep track of this feedback and impact the changes: Add the "closed" property to items that do not exist anymore Modify the latitude/longitude of items that are at a different place I volunteer to do that work, as I expect the workload to be bearable.

@nicolas-raoul I am ready to work on this Issue. But before I begin I would like to know how are retrieving/sending these feedback's. Is there an API for it?

nicolas-raoul commented 5 years ago

@vanshikaarora Thanks!

As you have see, you will need to read and write to a Wikidata item's talk page such as https://www.wikidata.org/wiki/Talk:Q11311478 Yes, there is an API. For the read part, actually something rather similar is being implemented right now for media talk pages: https://github.com/commons-app/apps-android-commons/compare/master...sp2710:fix%231850?expand=1#diff-22835e29a24ad4eec8642964effa110cR76 I suspect the API for Wikidata item talk pages is very similar.

vanshikaarora commented 5 years ago

@nicolas-raoul I have gone through the API's available here. And I have found that we can create a new description entity for each of these talks. Here was an API that I have found useful.

nicolas-raoul commented 5 years ago

"description" is a different thing, we should not edit it.

We must use edit with title being "Talk:" + the item QID

nicolas-raoul commented 5 years ago

To display the current content of the talk page, https://commons.wikimedia.org/w/api.php?action=help&modules=flow-parsoid-utils (also with title being "Talk:" + the item QID) seems like a good solution.

vanshikaarora commented 5 years ago

To display the current content of the talk page, https://commons.wikimedia.org/w/api.php?action=help&modules=flow-parsoid-utils (also with title being "Talk:" + the item QID) seems like a good solution.

Ok I'll use this API @nicolas-raoul

Here is the work-list for me. That will be available in the next PR:

Is there anything that you would like to add or suggest especially the UI part?

nicolas-raoul commented 5 years ago

Writing down this work-list is a great initiative!

The content sounds good, for the API I think we have 3 use cases:

vanshikaarora commented 5 years ago

Append content to a talk page that already has some content

@nicolas-raoul Is this available currently?

nicolas-raoul commented 5 years ago

I don't think so, you will probably have to read the content from the server, then concatenate, then send to the server 🙂

vanshikaarora commented 5 years ago

@nicolas-raoul I have parsed the API using

public String readFeedback(String source) throws IOException {
        public String readFeedback(String source) throws IOException {
        return api.action("flow-parsoid-utils")
                .param("from", "html")
                .param("to", "wikitext")
                .param("content", source)
                .param("title", "Talk")
                .get()
                .getString("/api/flow-parsoid-utils/@content");
    }
    }

And got the following response

Indian Institute of Technology (Indian School of Mines), Dhanbad

Currently the source passed as a parameter is returned as a response.

Is this intended?

nicolas-raoul commented 5 years ago

You can get the wikitext of the talk page like this:

https://www.wikidata.org/w/api.php?action=query&prop=revisions&rvprop=content&titles=Talk:Q11311478

Then either just display it like this (easiest), or put as as the source of your request above (and replace Talk with Talk:Q11311478

vanshikaarora commented 5 years ago

Then either just display it like this (easiest)

@nicolas-raoul Do you mean using a WebView here?

vanshikaarora commented 5 years ago

@nicolas-raoul The above link gives a query like

"query": {
        "pages": {
            "61503095": {
                "pageid": 61503095,
                "ns": 1,
                "title": "Talk:Q11311478",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "== Does not exist anymore ==\n\"SQUARE BUILDING\" does not exist anymore, no picture can ever be taken of it.\n\n[[User:Syced|Syced]] ([[User talk:Syced|<span class=\"signature-talk\">{{int:Talkpagelinktext}}</span>]]) 15:02, 9 February 2019 (UTC)"
                    }
                ]
            }
        }
    }

While I was executing the API there wasn't any node like "revisions" instead the API response looked like

<?xml version="1.0" encoding="UTF-8"?><api batchcomplete=""><query><pages><page _idx="-1" ns="1" title="Talk:Q11311478" missing=""/></pages></query></api>

Intsead of "revisions" it returned an empty node "missing". Am I parsing the API correctly here?

api.action("query")
        .param("prop", "revisions")
        .param("rvprop", "content")
        .param("titles", "Talk:Q11311478")
        .get().getNode("api/query/pages/page/@missing");
nicolas-raoul commented 5 years ago

What do you get with

api.action("query")
        .param("prop", "revisions")
        .param("rvprop", "content")
        .param("titles", "Talk:Q11311478")
        .get();

?

vanshikaarora commented 5 years ago

@nicolas-raoul It returns an object of type CustomApiResult

nicolas-raoul commented 5 years ago

Does your IDE allow you to see what is inside this object?

maskaravivek commented 5 years ago

What do you get with

api.action("query")
        .param("prop", "revisions")
        .param("rvprop", "content")
        .param("titles", "Talk:Q11311478")
        .get();

?

When I tried calling this API I got the following response:

https://www.wikidata.org/w/api.php?action=query&prop=revisions&rvprop=content&titles=Talk:Q11311478&format=json&rvslots=main

{
  "batchcomplete": "",
  "query": {
    "pages": {
      "61503095": {
        "pageid": 61503095,
        "ns": 1,
        "title": "Talk:Q11311478",
        "revisions": [
          {
            "slots": {
              "main": {
                "contentmodel": "wikitext",
                "contentformat": "text/x-wiki",
                "*": "== Does not exist anymore ==\n\"SQUARE BUILDING\" does not exist anymore, no picture can ever be taken of it.\n\n[[User:Syced|Syced]] ([[User talk:Syced|<span class=\"signature-talk\">{{int:Talkpagelinktext}}</span>]]) 15:02, 9 February 2019 (UTC)"
              }
            }
          }
        ]
      }
    }
  }
}
vanshikaarora commented 5 years ago

@maskaravivek on using

api.action("query")
        .param("prop", "revisions")
        .param("rvprop", "content")
        .param("titles", "Talk:Q11311478")
        .get();

The following is shown in logs

<?xml version="1.0" encoding="UTF-8"?><api batchcomplete=""><query><pages><page _idx="-1" ns="1" title="Talk:Q11311478" missing=""/></pages></query></api>
maskaravivek commented 5 years ago

I also used the rvslots param set to main

vanshikaarora commented 5 years ago

I also used the rvslots param set to main

@maskaravivek Even then the response was same for me :(

maskaravivek commented 5 years ago

@maskaravivek on using


api.action("query")
        .param("prop", "revisions")
        .param("rvprop", "content")
        .param("titles", "Talk:Q11311478")
        .get();

You need to use wikidataApi instead of api

vanshikaarora commented 5 years ago

Thanks @maskaravivek Using this I successfully got the result :)

wikidataApi.action("query")
                .param("prop", "revisions")
                .param("rvprop", "content")
                .param("rvslots","main")
                .param("titles", "Talk:Q11311478")
                .get().getString("api")
nicolas-raoul commented 5 years ago

About the UI: How about the one I proposed in the first post above? It does not need to be polished as it is not a place people will see often :-)

shashankiitbhu commented 3 months ago

Hi @nicolas-raoul I would like to work on this task, can you assign this to me

kanahia1 commented 1 month ago

Hello @nicolas-raoul, Can I also start working over this one ?

nicolas-raoul commented 1 month ago

@kanahia1 Sure, if you want, thanks! 🙂

kanahia1 commented 1 month ago

Hey everyone I was working with API to edit/create page. Each time I used to do a request to edit/create page I receive an error.

{"error":{"code":"badtoken","info":"Invalid CSRF token.","*":"See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/&gt; for notice of API deprecations and breaking changes."},"servedby":"mw-api-ext.eqiad.main-6549748955-888mz"}

I used CSRFTokenClient for getting a token, here's an token for example 96edc6ad015770382d9a24bbc4312ed9664c4d98+\

nicolas-raoul commented 1 month ago

I remember seeing such an issue in the past, you may want to search among closed issues.

kanahia1 commented 1 month ago

Sure and Thanks :-)

kanahia1 commented 1 month ago

I tried logging in/out as suggested https://github.com/commons-app/apps-android-commons/pull/2340#issuecomment-457909158 but not worked. Will look more into it.