d7ux

Those not following the implementation of concepts from http://d7ux.org/ here is a quick summary of the three main areas:

  • The header toolbar from http://www.d7ux.org/header/ is in Drupal 7 already (in the form of toolbar module). Icons are missing (still to be discussed, see http://drupal.org/node/13911#comment-1701664) and customizable shortcuts (http://drupal.org/node/511286) are still under discussion. You can override, revoke permissions and disable the header if you don't want to use/see it, but it is enabled in the default profile by design. There are also some other smaller follow up issues you can find and contribute to from http://drupal.org/node/484820
  • We are hard at work on the overlay. You should be able to use it without the admin theme and toolbar (or with a different admin theme and/or toolbar), but it is aware of the admin toolbar. There seems to be mostly some positioning issues to overcome here, see http://drupal.org/node/517688
  • We are working on the admin theme as well, which Young Hahn christened the Slate theme. The looks of the theme when not in the overlay is still to be refined, but themer reviews are showing good results. Again, this would be the default admin theme for Drupal 7 but will be configurable. See http://drupal.org/node/484860

There are lots of things going on improving user experience even in relatively large scales additionally to these three, but given how close the code freeze is, I am trying to get attention to these three, and especially the overlay and the admin theme, so we can get them in sooner then later.

By now, the Drupal contributed repository grew so big that there are likely multiple solutions to the same problems there. Maybe these solutions solve the tasks with different angles, have slightly different features, but at their core, they aim at solving the same issue. So it is getting harder for site builders to pick the modules they want to use (and drupal.org is planned to offer more tools in helping with the selection). When it comes to core inclusion though, one needs to very clearly define the requirements and meet core goals, such as lean and mean implementation, maintainability and reusability.

With Mark Boulton's and Leisa Reichelt's suggestion to have most of the Drupal administration interface show up in an overlay on top of the public facing webpage, we are again at such technology crossroads. Drupal 6 at least has two contributed modules to implement a similar-looking solution: Popups API and Modal Frame API. Both got their pros when I researched for possible overlay implementations, and frankly, when there are already two modules implemented for the same complex task, why would we start from scratch?

The goals for the core overlay (purposely not called a modal dialog) is to take up most of the window with a dim background on the original page content. The overlay would have a close button on its right side and possibly tabs on top to switch to different subpages (loaded via Ajax or will already be on the same page, but hidden). We don't need the overlay to be moveable or resizable. We don't need to show multiples at once, since it only makes sense to show one. However, the overlay should work well with the header so that when an option is selected, it keeps being active in the header, and the header should work so one can pick another area to work on without first closing the overlay.

This is how the overlay would look:

With different tabs or without tabs but otherwise consistent look elsewhere:

For easier evaluation of how we can meet these goals, I've ported both above mentioned modules to Drupal 7 and implemented Drupal 7 user experience "skins" for them. In the case of Popups module, it was a skin which the module already supports via an internal API, with Modal Frame API, it was an actual glue module which mapped elements marked up for being displayed in the overlay to a style similar to what Mark and Leisa suggests. Neither of them is pixel perfect to what is to be done, but the initial goal was to have D7 versions to evaluate and discuss the implementation internals, so we can fix up styling once we picked either one or a third way.

You can find my Popups module port patch at http://drupal.org/node/466732#comment-1681554 and the Modal Frame API port patch at http://drupal.org/node/491224#comment-1703366 but to make all these easier to test with the D7UX header in progress, all this code is available with the glue modules and custom skins in the D7UX code repository. You can try out both by installing with the d7ux install profile and then either turning on the "Popups API" module or the "D7UX overlay look" module. Make sure to only have one of them enabled at once and let Drupal install their dependencies. Switch between the two implementations by switching between the two modules.

Overlay implemented via popus module:

Overlay implemented via modal frame API module (the close button is not yet themed to look like on the mockups, but think of that as a minor detail):

Let's go beyond the UI and compare the modules:

  Popups API Modal Frame API
Started December 2007 May 2009
Maintainer starbow: http://drupal.org/user/33290 markus_petrux: http://drupal.org/user/39593
Contents Popups API, popups admin (admin mapper) and popups test modules (for human testing), skins Modal Frame API, Example glue module for testing
Based on Lots of custom code based on jQuery Small amount of custom code based on jQuery UI and jQuery
Codebase Light on PHP code, heavy on JS Light on both PHP and JS code, jQuery UI makes up for it
Overlay rendering Ajax request for a JSON object which contains the rendered content of the page, JS and CSS files to be loaded for the page and Drupal messages Ajax request for a fully rendered HTML page which is themed by the Modal Frame API module to only include the main region and some wrapper code.
Overlay display Merges rendered overlay into main HTML document; merges in CSS and JS files (possible ID collision) iframe element added to the page (no requirement for CSS and JS merging)
Stacked popups Supported, only one visible at a time Not supported
Dirty forms (unsaved edited form warnings) support Supported via custom code Supported via http://drupal.org/project/dirtyforms
Form submission in popups Reloads originating page (via Ajax or full reload) or runs custom callback Overrides form submit redirection and closes overlay

We are obviously at crossroads with picking our ways. The Popups module approach already has numerous core patches which were suggested earlier, while Modal Frame API leverages jQuery UI to lessen custom code burden and iframes to avoid colissions in merging HTML documents, which might be more attractive.

What did I miss in my comparison? Did I miss another alternative? What do you think a core solution should look like? jQuery UI to core? Just a targeted custom implementation for our own needs? IFrames or HTML merging? JSON output or overlay specific theming? These are general conceptual questions, so I choose to write a blog post to try and start a conversation instead of using the issue queue, which would be useful for more targeted questions. However, answers to some of the questions infer answers to others. What do you think?

Seeing how Young Hahn, David Rothstein, Paul Lovvik, Charlie Gordon, Daniel F. Kudwien, myself and others work on parts of the Drupal 7 user experience implementation already, it is getting harder to apply all the patches, keep up with their development and get them integrated to work together with various efforts.

So to ease our work, I've sat down and set up a third party code repository for the D7UX effort. Using a third party repository for core development is not anything new. For example, the Fields API work used a third party repository and the Drupal 6 internationalization work also did that. When multiple people work on projects which need integration and multiple patches to apply at once, it is easier to experiment in a third party repository and roll core patches from there. Once core patches are accepted or declined, and code freeze comes, we stop using this repository, since it's purpose is going to be over.

The D7UX repository is hosted on Google Code at http://code.google.com/p/d7ux/ (thanks for Google's support for Open Source development) and is already used by Young Hahn and myself with others to hopefully follow. You can check out the work anonymously based on instructions from http://code.google.com/p/d7ux/source/checkout

Currently, it hosts the header patch created by Young and two alternative versions for the overlay implementation by myself (blog post coming up). It also includes a D7UX install profile for testing. Our work is planned to be integrated in Drupal core itself, so this install profile is a temporary measure to keep the number of our core patches low, but let people quickly try out our work. We manage a list of the patches we applied at http://code.google.com/p/d7ux/source/browse/trunk/patches/patches.txt

Both Young and myself are administrators of the repository, and we are open to collaborators, so reach to us if you'd like to collaborate.