Jump to content

Book management 2013/Progress

From Meta, a Wikimedia project coordination wiki

Monthly reports[edit]


I have been working on my project to improve support for book structures in MediaWiki, stemming from this Google Summer of Code proposal. The first half of the month focused mainly on design: I created a set of documents to plan the UX, various features, and study other projects' approaches to a similar problem. I created some mockups, as well as two live demos (a navigation bar and a draggable section reordering system). I have created a request for comment to get feedback from the various communities (developers as well as communities like Wikisource and Wikibooks). I am also working on a combined RfC which should ideally help coordinate the three Wikisource-related GSoC projects. In terms of actual coding, I'm working on the beginnings of an extension. It will first add a "dummy" navigation bar to pages; once that is complete, I will work towards populating the navigation bar with data from a JSON block.


Mockup of the editing interface for BookManagerv2

The goal for July was to complete the "reading interface" for BookManagerv2. We have considered the reading interface to be the navigation bars that are auto-generated for each section in a book (example), as well as the view frontend to the JSON blocks that store the book content (example). I've also spent some time this month working on other, broader bugs, such as allowing wiki admins to configure the namespaces in which the JSON is stored and in which the navigation bars appear. I'm pleased to say that the goal of completing the reading interface has more or less been met—not all of the patches have been reviewed, but hopefully they will be reviewed and merged in the next few days. The status of these patches is available here. The next three weeks will be devoted to creating the "editing interface": the form that generates the JSON blocks. Currently, the blocks have to be entered manually (example), which is not user-friendly. By adding a form like the one to the right, the whole process will become very simple.


The beginning of August was dedicated to creating a form to allow users to edit book metadata and sections. This form can be seen live at the Labs wiki. It is (mostly) dynamically generated from a schema, which designates which fields should be added, and how they should be validated. The section generation uses jQuery UI's sortable element, and allows sections to be added, removed, renamed, moved, and indented. The other focus of this month has been identifying which bugs are high priority—bugs that specifically need to be fixed before the extension can move on to security review, etc. I have done this, with help from Raylton, by marking high priority, unsolved bugs in bold in the bug priority list. I have been working on solving these, focusing first on the JSON validation bugs. In the next month, I will be working to close as many of these bugs as possible. With school beginning so soon, the amount of time I will have available to work on these bugs will be diminished, but I am hopeful that I will be able to close many of these bugs.

Final report[edit]

See final report blog post

Weekly reports[edit]

May 26 – June 1[edit]

  • Found out I was accepted to Google Summer of Code!
  • Talked to Raylton to work out details of how we will communicate and how I will share my code. We also agreed on some tasks to work on during the community bonding period. See Book management/Mentor's notes.
  • Updated my mediawiki.org userpage
  • Updated my project info on the Melange website
  • Began setting up a development environment (created a local wiki, installed BookManager extension)
  • Began a simple extension

June 2 – June 8[edit]

June 9 – June 15[edit]

June 16 – June 22[edit]

Beginning of the coding period!

  • Updated the navigation bar demo to include more metadata, adjusted the formatting
  • Began drafting an RfC to use as a discussion point for the MediaWiki, Wikisource, Wikibooks, and Wikidata communities (plus whomever else would like to discuss!)
  • Spoke with Raylton about creating a new extension instead of modifying the existing BookManager
  • Created the beginnings of a new extension

June 23 − June 29[edit]

June 30 – July 6[edit]

July 7 – July 13[edit]

  • Added an example JSON file to the extension, closing bug 50674 (patch, bug)
  • Figured out how to access the Labs wiki that Raylton had set up
  • Merged the JSON validation code to the Gerrit repo (patch)
  • Code cleanup
    • Removal of excess whitespace
    • Changing the lists in the dropdowns to use ordered/unordered lists instead of paragraph tags
  • Moved the image files used in the navbar to local files in the extension (patch)
  • Added localization files (patch)
  • Submitted a patch for review to populate the navbar fields from the JSON (patch)
    • This is currently live on the labs wiki for testing/demonstration. You can test it by looking at the set of dummy pages here: they are drawing metadata and sectioning information from here.
  • Created mockup of edit interface

July 14 – July 20[edit]

  • Submitted a patch to load the primary page CSS separately from the JavaScript (bug, patch) — still waiting on code review
  • Created an example JSON block and book page to demonstrate how large books appear in the navbar
  • Requested this extension be added as a Jenkins job (bug)
    • Added .jshintrc to allow Jenkins to perform the JSHint with the right settings (patch)
  • Ran PHPUnit, stylize.php, and checkSyntax.php on the existing code, submitted a patch to fix any nonconformities (patch)
  • Rebased and merged in patches that had been sitting around for a while and were blocking some further work (Bug 50957: Populate navbar from JSON block. and Whitespace cleanup, changing lists to use ordered list.)
  • Created Book management/Bug priority list with Raylton to strategize which bugs should take priority
  • Added functionality to show example navbars (bug, patch)
  • Merged patch to fix a PHPUnit failure (patch)
  • Uploaded a new patchset to the example navbar patch, to add l18n and reduce code duplication (merged patch)
  • Added patch to fix a bug where NS_MAIN would break on edge cases in the JSON (bug, patch)
  • Merged a CSS patch to re-add code I'd accidentally removed in a rebase (patch)
  • Added a patch to use $wgContentNamespaces instead of NS_MAIN when checking whether to add navbars (patch)
  • Limited the size of the chapter list, adding a scrollbar if it overflows (bug, patch)
    • To do: Autoscroll to the current page
  • Added caching for the JSON blocks (patch)

July 21 – July 27[edit]

  • Submitted patch that auto-generates tables of contents pages; eventually I hope to use this as the Javascript fallback (bug 50672)
  • Spoke with Raylton
    • Decided to use Book: pages, not Special pages, for the editing interface (at least for now)
    • Set a deadline of July 31 for stabilizing the reading interface
    • Spoke with User:Rtdwivedi to determine that she is working on semi-automatically adding <pages index> tags to Wikisource books
  • Marked a number of bugs as RESOLVED WONTFIX (see updated Book management/Bug priority)
  • Submitted new patchset to the memcached patch to address bug 51841
  • Worked with Raylton to create a list of bugs for the framework of the editing interface (see Book management/Bug priority#Editing interface)
  • Submitted patch to address bugs 50691 and 51258
  • Fixed and merged the memcached and CSS patches, closed the four related bugs (51257, 51841, 50691, and 51258)
  • Submitted and merged patch to fix text wrapping (bug 51196, patch)

July 28 – August 3[edit]

  • Published blog post on the status of the project
  • Submitted a patch to localize the publication date in the metadata, merged (bug, patch)
    • Working on a patch to core to add i18n messages for this ([1])
  • Submitted a patch to add variables to disable parts of the navbar, merged (bug, patch)
  • Extension now allows the namespaces in which the JSON is stored and the namespaces in which the navbar appears to be specified by the wiki admin (patch 1, patch 2)
  • Submitted a patch to add a view frontend to the JSON block pages (bug, patch)
  • Completed midterm evaluation of mentors
  • Wrote July report, linked from Summer of Code 2013
  • Filed some more bugs about the reading interface after speaking with mwalker
  • Worked with Raylton on updating the edit interface mockups

August 4 – August 10[edit]

BookManagerv2 JSON editor as it stood on 2013-08-09
  • Finished editing page mockups (at Book management/UX document)
  • Published email conversation from earlier on-wiki
  • Began working on the edit page code
  • Submitted patch with some of the preliminary code (patch). This isn't done, but I wanted to get some feedback as I worked.
  • As of August 9 (see image—I'd just demo it on the Labs wiki, but it appears to be down for some reason...):
    • Metadata can be added, removed, and edited, mostly
      • As of yet, haven't added support for adding multiple entries in a field (e.g. more than one author)
    • Sections can be removed, renamed, and reordered
      • Still need to allow users to add new sections
  • Added patchset 2 to JSON editor patch to allow sections to be renamed
  • Fixed a bug that was causing unwanted behavior and making 7 PHPunit tests fail (patch)
  • Added patchsets 3 and 4 to JSON editor patch to make the JS pass linting

August 11 – August 17[edit]

  • Continuing to work on the JSON editor (which is now, usually, live on the Labs wiki
    • New sections can be added
  • Added variables to enable/disable the JSON editor and JSON frontend
  • Added some documentation to mw:Extension:BookManagerv2
  • Filed quite a few new bugs after discussion with Raylton and Micru
  • Added patchset to add [edit|review] to dynamically-added sections
  • Added patchset to give more reasonable behavior when pressing "enter" upon editing a section name
  • Added patchset to set tabindex values for the form elements

August 18 – August 24[edit]

  • When no sections exist in a book, automatically open a "add new section" box when editing/creating the Book: page
  • Added patchset to fix a bug where a JavaScript exception was thrown on trying to add a section to a page that didn't have any
  • Separated and marked bugs on Book management/Bug priority. They are now separated into "errors" and "features". Bugs marked in bold are bugs that are still marked as open, and need to be closed before we can move on to security review, etc.
  • Abandoned patch to change default value of a setting variable, as it appears to be a conventional approach
  • Added patch to enable/disable navigation bars
  • Added patch to add links to the JSON page from the dropdowns
  • Working on getting the JSON editor patch ready to merge
  • Added "additionalProperties": false to the sections array in the JSON schema. I previously had thought that the JSON validator was erroneously allowing values that did not exist in the schema to be added to the array, but it turns out that it just needed to be told not to allow additional properties. (patch, comment on the bug)
  • JSON editor patch was merged
New date fields
  • Submitted patch to make the extension less restrictive. Previously, much of the schema was hardcoded in; now it's a good deal more flexible. This patch also has the side effect of formatting the date inputs much more nicely (see right for image, see mw:Extension:BookManagerv2 for documentation on this)
  • Submitted patches (1, 2, 3) to add titles to various links
  • Submitted and merged a patch to add inline documentation to the JSON editor (patch)

August 25 – August 31[edit]

  • The three link title patches were merged
  • Working on bugs 52416 and 52350
  • Submitted patch to implement section indentation
  • Submitted patch to fix a bug where removing newly-added sections wasn't actually doing so
  • Submitted patch for bugs 50959 and 52470, involving pulling the schema from a remote wiki

September 1 – September 7[edit]

  • Fixed some issues with the remote schema patch, which was then merged
  • Worked on bug 53189, to fix issue where long section names don't wrap well in the JSON editor

September 8 – September 14[edit]

  • Still working on bug 53189
  • Merged the section indentation patch
    • Submitted a patch to fix a few issues with this
  • Discussed a new way of doing indentation using child nodes with mwalker, though it's probably not feasible to implement this before the code freeze on September 16

September 15 – September 21[edit]

  • Merged a patch to prevent navigation bars from appearing in diff view
  • Working on final blog post
  • Merged a patch to update to new schema version
  • Spoke with Raylton about bug 53189
  • Filed bug 54304, as something seems to have broken with the JSON view frontend

After September 26[edit]