⚓ T309490 Add book search functionality to mainspace books in Wikisource
Page Menu
Phabricator
Create Task
Maniphest
T309490
Add book search functionality to mainspace books in Wikisource
Open, Needs Triage
Public
Feature
Actions
Edit Task
Edit Related Tasks...
Create Subtask
Edit Parent Tasks
Edit Subtasks
Merge Duplicates In
Close As Duplicate
Edit Related Objects...
Edit Commits
Edit Mocks
Mute Notifications
Protect as security issue
Assigned To
None
Authored By
Soda
May 30 2022, 7:51 AM
2022-05-30 07:51:09 (UTC+0)
Tags
All-and-every-Wikisource
(Backlog)
ProofreadPage
(Backlog)
MW-1.39-notes (1.39.0-wmf.21; 2022-07-18)
Patch-Needs-Improvement
Referenced Files
None
Subscribers
Aklapper
Samwilson
Soda
Xover
Description
refer to
Search in Books proposal in Community Wishlist 2022
The plan is to start of with implementing a basic OOUI search form in the indicator section with a popup that allows users to configure specific options (such as regex, search as text search, search by Index, search by book).
We can explore adding more options and exposing more complex search options later.
Details
Related Changes in Gerrit:
Subject
Repo
Branch
Lines +/-
Add book search to Wikisource mainspace pages
mediawiki/extensions/Wikisource
master
+125
-3
Replace proofreadpage_source_href with prpSourceIndexPage and build source link client side.
mediawiki/extensions/ProofreadPage
master
+22
-10
Customize query in gerrit
Related Objects
Mentions
Mentioned In
T309797: Engineering Wish Formal Investigation
Mentioned Here
T53980: Source tab not showing up in the Translation namespace
Event Timeline
Soda
created this task.
May 30 2022, 7:51 AM
2022-05-30 07:51:09 (UTC+0)
Restricted Application
added a subscriber:
Aklapper
View Herald Transcript
May 30 2022, 7:51 AM
2022-05-30 07:51:10 (UTC+0)
Aklapper
renamed this task from
Add book search functionality to manispace books in Wikisource
to
Add book search functionality to mainspace books in Wikisource
May 30 2022, 9:36 AM
2022-05-30 09:36:57 (UTC+0)
gerritbot
added a comment.
May 30 2022, 11:29 AM
2022-05-30 11:29:19 (UTC+0)
Comment Actions
Change 801372 had a related patch set uploaded (by Sohom Datta; author: Sohom Datta):
[mediawiki/extensions/ProofreadPage@master] Replace proofreadpage_source_href with prpSourceIndexPage and build source link client side.
gerritbot
added a project:
Patch-For-Review
May 30 2022, 11:29 AM
2022-05-30 11:29:20 (UTC+0)
gerritbot
added a comment.
May 30 2022, 1:29 PM
2022-05-30 13:29:56 (UTC+0)
Comment Actions
Change 801392 had a related patch set uploaded (by Sohom Datta; author: Sohom Datta):
[mediawiki/extensions/Wikisource@master] Add book search to Wikisource mainspace pages
dmaza
mentioned this in
T309797: Engineering Wish Formal Investigation
Jun 21 2022, 1:46 PM
2022-06-21 13:46:33 (UTC+0)
gerritbot
added a comment.
Jun 30 2022, 3:08 AM
2022-06-30 03:08:05 (UTC+0)
Comment Actions
Change 801372
merged
by jenkins-bot:
[mediawiki/extensions/ProofreadPage@master] Replace proofreadpage_source_href with prpSourceIndexPage and build source link client side.
Soda
added a comment.
Jun 30 2022, 3:08 PM
2022-06-30 15:08:26 (UTC+0)
Comment Actions
In
T309490#8038938
@gerritbot
wrote:
Change 801372
merged
by jenkins-bot:
[mediawiki/extensions/ProofreadPage@master] Replace proofreadpage_source_href with prpSourceIndexPage and build source link client side.
This change removes the
proofreadpage_source_href
JS variable from
mw.config
and replaces it with a new variable
prpSourceIndexPage
proofreadpage_source_href
used to contain the HTML link to the source Index: page for a mainspace page. However, to access the actual Index Page name, a userscript/JS feature would have to parse the HTML to extract the data.
prpSourceIndexPage
will contain only the name of the associated source Index: page eliminating the need for any HTML parsing. If any userscripts use this feature, they should migrate to using
prpSourceIndexPage
Xover
subscribed.
Jul 5 2022, 7:46 AM
2022-07-05 07:46:41 (UTC+0)
Comment Actions
In
T309490#8040690
@Soda
wrote:
This change removes the
proofreadpage_source_href
JS variable from
mw.config
and replaces it with a new variable
prpSourceIndexPage
This leaves no sane migration path since it creates a bright-line cutoff; which is unnecessary since these are two separate variables. Either both should be left in indefinitely, or they should co-exist for some reasonable amount of time so scripts can be migrated smoothly.
Whether to leave the existing variable indefinitely or temporarily depends on whether any scripts actually use the "HTMLness" of it for anything. Like you I suspect most scripts just transform it back into a page name, but it's absolutely not unthinkable that some script somewhere actually wants the HTMLy version for some reason.
Xover
added a comment.
Jul 5 2022, 8:43 AM
2022-07-05 08:43:12 (UTC+0)
Comment Actions
Incidentally, this change seems to have some sort of bearing on
T53980
(from 2013!), though I'm not sure of in what way yet (makes it easier? harder? fixes it as an incidental effect? makes on-wiki workarounds easier?).
Soda
added a comment.
Jul 5 2022, 9:11 AM
2022-07-05 09:11:10 (UTC+0)
Comment Actions
In
T309490#8050780
@Xover
wrote:
Incidentally, this change seems to have some sort of bearing on
T53980
(from 2013!), though I'm not sure of in what way yet (makes it easier? harder? fixes it as an incidental effect? makes on-wiki workarounds easier?).
I don't think this change will affect the Translation: namespace at all, since we filter only main namespace pages before we add these variables/information.
In
T309490#8050462
@Xover
wrote:
In
T309490#8040690
@Soda
wrote:
This change removes the
proofreadpage_source_href
JS variable from
mw.config
and replaces it with a new variable
prpSourceIndexPage
This leaves no sane migration path since it creates a bright-line cutoff; which is unnecessary since these are two separate variables. Either both should be left in indefinitely, or they should co-exist for some reasonable amount of time so scripts can be migrated smoothly.
Whether to leave the existing variable indefinitely or temporarily depends on whether any scripts actually use the "HTMLness" of it for anything. Like you I suspect most scripts just transform it back into a page name, but it's absolutely not unthinkable that some script somewhere actually wants the HTMLy version for some reason.
It should be fairly easy to reconstruct a HTML link from
prpSourceIndexPage
. We use the following code for a JS module in ProofreadPage to handle this scenario:
var
urlLink
if
mw
config
get
'prpSourceIndexPage'
urlLink
mw
html
element
'a'
href
mw
util
getUrl
mw
config
get
'prpSourceIndexPage'
),
title
mw
msg
'proofreadpage_source_message'
},
mw
msg
'proofreadpage_source'
);
else
urlLink
mw
config
get
'proofreadpage_source_href'
);
// use urlLink to do something
Xover
added a comment.
Jul 5 2022, 9:14 AM
2022-07-05 09:14:28 (UTC+0)
Comment Actions
Ok, I've checked all usages on enWS (and noWS, incidentally) and apart from user scripts for inactive users, there is only one remaining instance. I've notified the user, but I suspect the script isn't actually in use currently (it hasn't been modified since 2011). In other words, enWS should be fine when the train rolls around tomorrow. But I'm still a little worried about the other projects.
Xover
added a comment.
Jul 5 2022, 9:27 AM
2022-07-05 09:27:27 (UTC+0)
Comment Actions
In
T309490#8050892
@Soda
wrote:
I don't think this change will affect the Translation: namespace at all, since we filter only main namespace pages before we add these variables/information.
Hmm. But why? The config var is potentially relevant in all namespaces (getting the Index: from the Page: namespace would seem a common enough need), and as per
T53980
the Translation: namespace is a content namespace entirely equivalent to ns:0.
Xover
added a project:
ProofreadPage
Jul 5 2022, 9:38 AM
2022-07-05 09:38:14 (UTC+0)
Soda
added a comment.
Jul 5 2022, 11:37 AM
2022-07-05 11:37:23 (UTC+0)
Comment Actions
In
T309490#8050894
@Xover
wrote:
Ok, I've checked all usages on enWS (and noWS, incidentally) and apart from user scripts for inactive users, there is only one remaining instance. I've notified the user, but I suspect the script isn't actually in use currently (it hasn't been modified since 2011). In other words, enWS should be fine when the train rolls around tomorrow. But I'm still a little worried about the other projects.
Global search appears to be down right now, but almost all uses of the variable on-wiki are with the PageNumbers.js script (which appears to be tagged as historical + some userscripts)
In
T309490#8050919
@Xover
wrote:
In
T309490#8050892
@Soda
wrote:
I don't think this change will affect the Translation: namespace at all, since we filter only main namespace pages before we add these variables/information.
Hmm. But why? The config var is potentially relevant in all namespaces (getting the Index: from the Page: namespace would seem a common enough need), and as per
T53980
the Translation: namespace is a content namespace entirely equivalent to ns:0.
We do add a lot of variables to the Page: namespace in other code paths of ProofreadPage. For the Page: namespace,
prpIndexTitle
is the variable you want to use to get the Index: page (there are a bunch of other ones as well I don't know if they are documented on-wiki). Wrt to the Translation: namespace, I'm not very sure why the source link and values are not added, but it seems like it should be a pretty easy fix.
Xover
added a comment.
Jul 6 2022, 9:10 AM
2022-07-06 09:10:43 (UTC+0)
Comment Actions
In
T309490#8051246
@Soda
wrote:
… For the Page: namespace,
prpIndexTitle
is the variable you want to use to get the Index: page …
Then why use a different config var name in mainspace?
ReleaseTaggerBot
added a project:
MW-1.39-notes (1.39.0-wmf.21; 2022-07-18)
Jul 11 2022, 10:01 PM
2022-07-11 22:01:50 (UTC+0)
Pppery
edited projects, added
Patch-Needs-Improvement
; removed
Patch-For-Review
Apr 9 2023, 8:07 PM
2023-04-09 20:07:08 (UTC+0)
Log In to Comment
Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct.
Wikimedia Foundation
Code of Conduct
Disclaimer
CC-BY-SA
GPL
Credits