<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
    <title>flow|state</title>
    
    
    <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/" />
    <id>tag:typepad.com,2003:weblog-182620</id>
    <updated>2012-05-22T08:00:00-07:00</updated>
    <subtitle>UI design craft</subtitle>
    <generator uri="http://www.typepad.com/">TypePad</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/flowstate" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="flowstate" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://hubbub.api.typepad.com/" /><entry>
        <title>Update</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/05/update.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/05/update.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e2016305b4ffa4970d</id>
        <published>2012-05-22T08:00:00-07:00</published>
        <updated>2012-05-21T17:22:50-07:00</updated>
        <summary>For the past two months or so, I’ve left off from my weekly blogging habit here to focus on some behind-the-scenes aspect of QuickUI. I post about those updates on the separate QuickUI blog. That blog is more technically-oriented, but...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>For the past two months or so, I’ve left off from my weekly blogging habit here to focus on some behind-the-scenes aspect of QuickUI. I post about those updates on the separate QuickUI blog. That blog is more technically-oriented, but I though it was worth sharing a roundup of those posts here:</p>
<ul>
<li>I’ve made a number of improvements to the QuickUI runtime, including a <a href="http://blog.quickui.org/2012/05/15/quickui-0-9-a-significant-update/">significant version update</a>. One interesting new feature is support for creating UI in CoffeeScript (in addition to plain JavaScript). </li>
<li>A developer asked for sample application code showing how to use QuickUI as the “View” in an application with an MVC (Model-View-Controller) architecture. That’s a great idea, and to date I haven’t had such a sample I could offer. Cozi’s <a href="http://www.cozi.com/Meal-Planner.htm">Meal Planner</a> is actually a Model-View-Presenter that uses QuickUI for the View, but the source for that application is proprietary. It’ll be useful to have an interesting MVC/MVP sample application that shows off how to use QuickUI; I’ll post back here when I have something worth looking at. Thanks for the suggestion, Chris! </li>
<li>I continue to be interested in making sure the emerging Web Components spec is well-suited to the scenarios routinely faced by UI designers and developers, and have articulated a vision for <a href="http://blog.quickui.org/2012/04/16/a-vision-for-coevolving-quickui-and-the-emerging-web-components-standard/">how QuickUI and Web Components could co-evolve</a>. This has included some time <a href="http://blog.quickui.org/2012/04/27/how-quickui-controls-use-code-to-specialize-the-handling-of-their-content-in-ways-that-might-not-be-supported-by-web-components/">analyzing the QuickUI Catalog controls</a> in light of the Web Components spec. On that note, I’m looking forward to a meeting with the spec’s author, Dimitri Glazkov, later this week. </li>
<li>A designer friend suggested creating a new QuickUI screencast. The few QuickUI screencasts I’ve done in the past are now out-of-date, and my ideas about how to explain the value of component-based UI development have evolved, so it’s a good time for a new one. </li>
<li>Along those lines, I’ve invested some time improving the framework documentation, including an <a href="http://quickui.org/docs/rendering.html">overview of how QuickUI controls render themselves</a>.</li>
<li>I also continue to improve the <a href="http://quickui.org/catalog">QuickUI Catalog</a> controls, although at a slower pace. The above work on the fundamentals and explaining them is taking precedence for the time being. </li>
</ul>
<p>Thanks to those who have shared suggestions with me — they’re very helpful. If you take a look at any of the above and have feedback, please let me know.</p>
<ul>
</ul><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/HeVG1Jhrl1A" height="1" width="1" /></div></content>



    </entry>
    <entry>
        <title>From MacPaint to FiftyThree's Paper: Someday all our apps will be this great</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/04/someday-all-our-apps-will-be-this-great.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/04/someday-all-our-apps-will-be-this-great.html" thr:count="4" thr:updated="2012-05-29T23:15:58-07:00" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e2016303a546e1970d</id>
        <published>2012-04-05T05:00:00-07:00</published>
        <updated>2012-04-05T11:03:16-07:00</updated>
        <summary>Imagine, for a moment, that you’re living way back in the early 1980s, maybe 1984. You have access to a computer, and on that computer, you use a top-end DOS app like Lotus 1-2-3: Then, one day, you see a...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>Imagine, for a moment, that you’re living way back in the early 1980s, maybe 1984. You have access to a computer, and on that computer, you use a top-end DOS app like Lotus 1-2-3:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e2016303a5443f970d-pi"><img alt="Lotus 1-2-3" border="0" height="384" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e99b1982970c-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Lotus 1-2-3" width="512" /></a></p>
<p> </p>
<p>Then, one day, you see a marketing campaign for a new computer. Your eye catches on this image:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20167649a0044970b-pi"><img alt="MacPaint" border="0" height="358" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e2016303a54464970d-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="MacPaint" width="518" /></a></p>
<p> </p>
<p>Your mind is <em>completely blown</em>. The user interface for this application, which you learn is called MacPaint, seems utterly unlike any application you’ve ever seen. In fact, the entire premise of this image speaks to a proposition that’s never before even occurred to you: <em>a computer can be used to create art</em>.</p>
<p style="text-align: center;"><span style="color: #737373;">• • •</span></p>
<p>Looking back, it’s hard to convey now how stunning both this image and that proposition were at the time. When the original Macintosh was released, this was probably the first vaguely art-like computer-rendered illustration most people had ever seen. Before that moment, when (or if) the average person thought about a computer, they considered it a tool for crunching numbers or typing documents.</p>
<p>In retrospect, this Japanese woodcut was probably the most sophisticated illustration most people ever saw on an original Macintosh. As groundbreaking as the application was, it was simply impossible for the average user, even a fairly artistic person, to create something of this quality with a mouse. Drawing with a mouse in MacPaint was said to be, “like drawing with a bar of soap”. If you tried to create something like the above yourself, the results were laughable. You could indeed create interesting works in MacPaint, but only by relying on text, lines, polygons, and those paint bucket textures along the bottom. That is, you got the most interesting results with tools that were well-suited to software implementation and which produced effects you couldn’t easily achieve on paper.</p>
<p>The designer behind this image, <a href="http://kare.com/">Susan Kare</a>, discussed it in an <a href="http://library.stanford.edu/mac/primary/interviews/kare/trans.html">interview</a>:</p>
<blockquote>
<p>With the Japanese lady, [Apple developer] Bill Atkinson was experimenting with scanning, and Steve [Jobs] brought in an actual woodcut that he had bought: it was big and colorful, and that was one of the first things that we scanned. And I took the scan, which was kind of rough, and refined it to make the final illustration. It looks so crude now — in terms of scanning technology — but it seemed amazing at the time that you could get a “real” image into your computer.</p>
</blockquote>
<p>The fact that this image started from a scan was both a surprise and something of a disappointment. Ah, no wonder we never saw illustrations like this — fundamentally, this was marketing! Not to detract from the groundbreaking impact of this work, but this image was clearly meant to suggest to users that they could <em>create </em>art freehand, using only the tools in MacPaint.</p>
<p>Nevertheless, MacPaint represented a watershed in application user interfaces that had broad impact far beyond its users or market. When such an event occurs, it’s possible to look at the app and say something remarkable: <em>Someday all<strong> </strong>our apps will be this great</em>.</p>
<p>The only reason the MacPaint woodblock image is no longer jaw-dropping to us today is because, within a relatively short time, nearly every application acquired a user interface that in many ways looked and worked as as well as (or, eventually, better than) the interface in MacPaint. Apps simply had to improve to stay competitive, and users everywhere reaped the benefits.</p>
<p style="text-align: center;"><span style="color: #737373;">• • •</span></p>
<p>Such a moment has now happened again — or at any rate, it has now happened again to me. The moment came when I saw a post on <a href="http://beautifulpixels.com/ipad/paper-bring-out-the-creative-genius-in-you/" target="_self">Beautiful Pixels</a> about <a href="http://www.fiftythree.com/paper">Paper</a>, an app by a company called FiftyThree:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20167649a00b6970b-pi"><img alt="Paper" border="0" height="450" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e2016303a5450a970d-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Paper" width="600" /></a></p>
<p> </p>
<p>Paper is beautiful, and I find it a joy to use. Like MacPaint before it, I think Paper represents a new watershed in user interfaces.</p>
<p>Earlier I’d tried <a href="http://itunes.apple.com/us/app/adobe-ideas/id364617858?mt=8">Adobe Ideas</a>, a vaguely similar sketch pad app. It’s a fairly typical touch-enabled iPad application, and follows many (but not all) iPad conventions. Judging by app store reviews of Adobe Ideas, some of its users love it, and find it very useful. I myself was underwhelmed. Adobe Ideas feels utilitarian, like a dead thing. Using it to create a sketch feels like work. After a few attempts, I stopped using Adobe Ideas.</p>
<p>Paper, in contrast, feels like something tangible and alive. It’s delightfully <em>fun.</em> Since I installed Paper, I look forward to using it every day. Paper’s interface is beautiful at every level. Zooming out from a drawing (above) shows a sketchbook (below left) containing multiple drawings, and zooming out further shows your collection of sketchbooks (below right):</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e2016303a545e6970d-pi"><img alt="Paper Sketchbook" border="0" height="221" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20167649a0194970b-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Paper Sketchbook" width="295" /></a>  <a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20167649a025f970b-pi"><img alt="Paper Sketchbooks" border="0" height="221" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20167649a0278970b-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Paper Sketchbooks" width="295" /></a></p>
<p> </p>
<p>A stunning amount of detail has gone into every aspect of Paper’s design. Just a sampling of the tiny details I’ve noticed:</p>
<ul>
<li>The “paper” background of a sketch isn’t pure white; it’s very slightly off-white. This lets the pure white ink and paint appear extra bright.</li>
<li>If you’re in the middle of drawing and drag your finger (or stylus) over the tool palette, the palette automatically drops out of the way so you can continue your line into the space the palette had just been occupying.</li>
<li>You can paint with white watercolor to lighten things. While Paper carefully models the physics of real inks and paints, in various places it breaks with those limitations to let you do things which useful but not possible in the real world. This seems to be done judiciously; the drawing tools still feel very much like their physical analogues.</li>
<li>The tools respond to the speed of your movement — but not always the same way. The pen gets thinner the faster you go, which makes physical sense, but the calligraphy pen gets <em>thicker</em> when you go fast. This is another case in which the physical metaphor has been judiciously broken. I’m not sure of the precise rationale behind these differences, but the result feels right.</li>
<li>As you flip through a sketchbook, not only do the pages animate in 3D, their shadows do as well. Paper is built on the OpenGL 3D library, but it probably still was a lot of work to get these effects to look this good and this smooth.</li>
</ul>
<p>Surprisingly, Paper actually delivers on the original MacPaint premise: <em>you can create beautiful art. </em>I’m no artist, but I was able to quickly sketch the still life with fruit shown above, and the cat in the smaller image. It turns out you can add watercolors to pretty much any pen or pencil drawing in Paper and get something that looks pretty good. My children think so too — yesterday evening I had to read the Kindle edition of <em><a href="http://amzn.to/HVMAcr">Angelmaker</a></em> on my phone because I couldn’t pry the iPad away from my four year-old.</p>
<p>(Aside: Paper is free, but you’ll have to pay to get the watercolors. You should just bite the bullet and buy all the tools — you will in the end, anyway. I think Paper’s pricing model is as clever as their interface design.)</p>
<p>As amazing as the artistic results are, I don’t think they represent Paper’s greatest accomplishment. At the highest level, I think the best thing Paper has really done is <em>let you feel like an artist. </em>I haven’t regularly sketched anything since Drawing 101 in college, and now I find I’ve bought an iPad stylus so I can do more with Paper.</p>
<p>FiftyThree carries this message throughout out the Paper app, as well as through their site and brand. Everything about this product is designed to lead you to believe, “I am the kind of cool latter-day renaissance person who carries around a Moleskine notebook because my free aesthetic soul may encounter a beautiful scene I want to render as art. I am <em>that</em> awesome.” This is, in fact, the very image in the Paper promotional video: a guy wandering around New York City sketching stuff. The video is shot from first-person perspective. That guy is <em>you</em>.</p>
<p>I think the term “user experience design” is often overblown puffery — when I get to observe someone working through an app design problem, they’re usually focused on the feature set and interface. I rarely witness someone actually thinking directly about the <em>experience</em> their user will have. But with Paper, I think “experience design” is an apt term for what they’ve done. Maybe even that term sells it short. It could be called something like “self-conception design”.</p>
<p>But, wait! Here’s the best part. <em>Someday all our apps will be this great.</em></p>
<p>Think about that. In the not-too-distant future, every bit of software you currently use (and maybe swear at) — an online store, the Settings area for your latest device, a random tool from an IT department, the production app you spend your workday in — all those things will someday be as beautiful to look at and joyful to use as this Paper app.</p>
<p>And those apps will make you <em>feel </em>great. When send a message, you will feel like a great communicator (or socialite). When you follow a treasure map to an out-of-the-way restaurant in a new town, you will feel like a great explorer. When you follow a recipe, you will feel like a great chef. And when you create a bit of software, you will feel like a great designer.</p><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/uheO0wDv-CM" height="1" width="1" /></div></content>



    </entry>
    <entry>
        <title>Make web menu bars more usable: open a menu on hover only if another menu is already open</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/04/menubar.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/04/menubar.html" thr:count="2" thr:updated="2012-04-03T08:49:32-07:00" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e20163037a414a970d</id>
        <published>2012-04-03T05:00:00-07:00</published>
        <updated>2012-04-03T08:38:40-07:00</updated>
        <summary>The history of user interface design isn’t terribly long, but it’s long enough that designers who ignore it do so at their users’ peril. In the transition from clients apps to the web, a lot of UI history has been...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Controls" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>The history of user interface design isn’t terribly long, but it’s long enough that designers who ignore it do so at their users’ peril. In the transition from clients apps to the web, a lot of UI history has been forgotten, ignored, or reluctantly set aside because its lessons were too expensive (if not impossible) to preserve in early browsers.</p>
<p>For example, it’s hard to find a web application with a menu bar as usable as the standard system menu bars in OS/X and Windows. Consider the basic tasks of opening and closing a menu in a menu bar. Last week’s <a href="http://miksovsky.blogs.com/flowstate/2012/03/popup.html">post on popups</a> listed a number of ways in which a user can cancel a menu: clicking outside of it (while <em>not</em> accidentally triggering whatever one clicks on), pressing Escape, resizing the window, scrolling, or moving the focus to a different window. Web implementations often overlook these aspects of closing a menu.</p>
<p>If we now turn our attention to the task of <em>opening</em> a menu, we find most web apps give this basic act similarly blunt treatment. The choices you’ll typically see in web menus are one of these:</p>
<ul>
<li>Menus open when the user <strong>clicks</strong> on a menu title.<strong> </strong>This is straightforward for a single menu, but problematic in a menu bar with multiple menus. Users need to scan a set of menus if they’re exploring their options, or if they’re hunting for a particular command. In these situations, having to click on each menu in turn feels clunky. And if the menu developer has done the fundamentally right thing in absorbing mouse clicks outside the menu (so the user doesn't accidentally trigger something when canceling the menu), the user must click <em>twice</em> to open up the next menu. </li>
<li>Menus open as soon as the user <strong>hovers</strong> over a menu title. This feels responsive, and lets the user quickly scan a set of menus. On the downside, it can be incredibly distracting to have menus pop open when they’re unwanted. Consider a user who clicks in a text field, and then has to move the cursor away from the text field because the cursor doesn’t automatically disappear when they start typing. <em>(Another bit of UI history that’s been forgotten!)</em> Knocking the mouse out of the way, the user happens to end up parking the cursor over the menu bar, and now a completely unwanted, giant <a href="http://www.useit.com/alertbox/mega-dropdown-menus.html">mega menu</a> pops up, covering up their work surface. (That menu article suggests using careful timing to avoid irritating the user, but to me that seems like a band-aid on what’s fundamentally the wrong solution.) Open-on-hover does offer the ability to have a click on the menu title perform navigation, but as discussed in <a href="http://uxmovement.com/navigation/why-hover-menus-do-users-more-harm-than-good/">Why Hover Menus Do Users More Harm Than Good</a>, users may not discover that they can click on the title like a link — if hovering into the title popped it up, then the user can easily conclude that the menu has already performed the only job it’s there for.</li>
</ul>
<p>The odd thing is that a completely smooth way to finesse the problems of both these methods is right in front of the designer and developer, in the very same OS/X and Windows client applications they are likely using to design or code one of these problematic approaches.</p>
<p><strong>Key attributes of menu riffing behavior</strong></p>
<p>For ages both OS/X and Windows have used the following menu behavior:</p>
<ol>
<li>When no menu is open, hovering over a menu title can provide hover feedback on the title (Windows does this), but does <em>not</em> pop up the menu.</li>
<li>Clicking a menu opens it. This required click prevents accidental menu invocation.</li>
<li>Once a menu is open, hovering into the title of another menu closes the previous menu and implicitly opens the new one. This lets the user quickly <em>riff</em> through a menu bar’s menus to familiarize themselves with their contents or to find a specific command.<br /><br /><em>[UPDATE: A commenter correctly points out that client OSes actually open menus immediately on mouse down, instead of waiting for mouse up. This makes it possible to riff through menus with the mouse down. If I recall, Mac OS menus originally only worked on mouse down; letting go of the mouse while over a menu title closed the menu. Windows, in contrast, would keep the menu open even after the user released the mouse button, which was easier to use. The user didn't have to hold the mouse down throughout the whole menu exploration and command selection operation. This approach was eventually adopted by the Mac OS. But both Windows and OS/X still support mouse down opening and riffing of menus.]</em></li>
</ol>
<p>To me, this resolution seems about perfect, and I wish all web app menus worked this way. In contrast, how often have you used one of the clunky always-click-to-open or twitchy open-on-hover web menu implementations and said to yourself, “I wish all my OS/X (or Windows) apps worked this way!”?</p>
<p>To be fair, simply knowing the UI history (or being very observant) isn’t enough — there’s still the question of cost. One could argue that Apple and Microsoft have greater control over the environment than a web site within the constraints of the browser, which is true, but I think that explanation falls short. The fundamental problem seems to be the economics of homegrown UI: for most companies, it’s hard to justify the return on investment to get these details right in order to make a really usable menu bar. (Which, if they get it right, their users won’t even notice.) Apple and Microsoft can each build a perfect menu bar once that many developers can benefit from, so it’s worth their taking the time to get it right.</p>
<p>Google Docs is one web app that has taken the time to sweat the details. Their document editing suite carefully follows the same menu riffing behavior described above: you open the first menu with a click, and subsequent menus with hover:</p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e9741623970c-pi"><img alt="image" border="0" height="286" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201676472dce5970b-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" width="531" /></a></p>
<p> </p>
<p>I’m not sure if Google acquired this finely-tuned menu through Writely or one of the other predecessors to Google Docs, or if they’ve more recently decided that a good way to displace with Microsoft Office is with great usability at a much cheaper price. Either way, it’s details like this that make Google Docs feels like such a reasonable replacement for a desktop application suite. (Thought not perfect yet: Google Docs gets the menu open behavior right, but gets points off for menu <em>closing</em> behavior because they don’t absorb background mouse clicks. And, as referenced above, it doesn’t hide the mouse when you start to type, the way most client text editors or word processors do.)</p>
<p><strong>MenuBar control</strong></p>
<p>I’ve added a <a href="http://quickui.org/catalog/MenuBar">MenuBar</a> control to the QuickUI Catalog, along with the usual companions of <a href="http://quickui.org/catalog/Menu">Menu</a>, <a href="http://quickui.org/catalog/MenuItem">MenuItem</a>, and <a href="http://quickui.org/catalog/MenuSeparator">MenuSeparator</a> classes. A Menu can be used on its own, or as part of a MenuBar. When placed inside a MenuBar, the menus will exhibit the riffing behavior described above.</p>
<p>I like the way Google’s visual style puts both the menu title and an open menu on the same seamless surface to visually connect the two regions, so I’ve used that style for a Menu’s generic appearance (the one you get if you don’t want to do any of your own styling).</p>
<p>Although the MenuItem and MenuSeparator classes assume a traditional vertically-oriented list of commands, use of those classes isn’t required, and the Menu class could just as easily be used to present commands in multiple columns or any other arrangement.</p>
<p><strong>Implementation notes</strong></p>
<p>The tricky bit here was making the entire MenuBar and its menus accessible to the mouse, while simultaneously absorbing any background mouse click outside the menu bar or its menus. By default, an individual Menu control supplies its own Overlay so that a Menu can be used on its own or in some other menu bar-like UI construct. The problem is that an Overlay behind a single Menu control will prevent the user from hovering into other menus in the menu bar. So the MenuBar creates its own <a href="http://quickui.org/catalog/Overlay">Overlay</a> control, and turns off the Overlays of the individual Menu controls. The result is the entire menu bar and its menus sit above a shared overlay. The user can hover from one menu to the next, and any clicks on the background overlay are absorbed and cancel the currently-opened menu.</p>
<p>As always, it’s my hope that delivering this behavior in an open, reusable component can eventually change the economics of web usability so that anyone can benefit from the UI design history baked into a component — whether they realize that history is there or not.</p><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/k-rav_luyUY" height="1" width="1" /></div></content>



    </entry>
    <entry>
        <title>There must be 50 ways to close a popup: menus, dropdowns, tooltips, palettes, dialogs, and more</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/03/popup.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/03/popup.html" thr:count="2" thr:updated="2012-03-28T09:05:31-07:00" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e20168e9287305970c</id>
        <published>2012-03-26T08:00:00-07:00</published>
        <updated>2012-03-23T16:33:09-07:00</updated>
        <summary>Apps often need to pop up something over the main UI; common examples would be menus and dialogs. Unfortunately, while apps need popups, documents don’t, and until recently HTML was relentlessly document-focused. It’s frustratingly difficult to do a popup well...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Controls" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>Apps often need to pop up something over the main UI; common examples would be menus and dialogs. Unfortunately, while apps need popups, <em>documents</em> don’t, and until recently HTML was relentlessly document-focused. It’s frustratingly difficult to do a popup well in a contemporary web app, and so it’s not surprising to see so many apps do them poorly or inconsistently.</p>
<p>As a case in point, consider the ways a user might want to dismiss a UI element which has popped up over the main UI. Depending on the specific form of popup, there are a surprisingly large number of methods the popup might support for leaving it:</p>
<ol>
<li><strong>Click outside the popup. </strong>This is the most common means to dismiss a lightweight popup like a menu. The user is saying, “I see you, popup, but don’t want to interact with you; let me get back to the main UI.” When the user clicks on the main UI in the background, a key question arises: <em>what happens with that click?</em> This isn’t an easy question to answer; see below.</li>
<li><strong>Click inside it. </strong>Perhaps the user has hovered into an element that’s popped up a tooltip, and maybe the tooltip’s under the mouse. If the tooltip is nothing but static content, the user can generally click anywhere within the popup to dismiss it.</li>
<li><strong>Make a selection</strong>. This is a special case of the above point. If the user’s dropped down a combo box and has clicked in an item in the resulting list, they’re not only making a selection, they’re also saying they’re done with the dropdown.</li>
<li><strong>Click a button</strong> that explicitly indicates completion. Another special case of point #3. A classic example would be an OK button in a modal dialog, which is essentially a heavyweight form of popup.</li>
<li><strong>Click a close box.</strong> A modeless dialog or persistent palette window often relies on a small “<strong>×</strong>” icon in the upper-right corner as the primary means to dismiss it.</li>
<li><strong>Press Esc.</strong> Popups of many flavors can be dismissed by pressing the Escape key.</li>
<li><strong>Wait.</strong> A tooltip or <a href="http://miksovsky.blogs.com/flowstate/2012/01/transientmessage.html">transient message</a> may go away all on its own after giving the user time to read its contents.</li>
<li><strong>Hover into another control that produces a popup.</strong> The classic example here is menu riffing in Windows or OS/X menu bar. The user must click a menu to open it, but once that first menu is opened, the user can open the next menu simply by hovering into it. (This aspect of menus is worth a closer look in a subsequent blog post.)</li>
<li><strong>Move the focus to another window.</strong> Most forms of pop ups are temporary enough that the user doesn’t expect them to stick around. If the user opens a right-click context menu in Google Docs, and then switches to work in a different window, they don’t expect to come back to Google Docs later and find the context menu still open.</li>
<li><strong>Press the ALT key.</strong> On Windows, the ALT key or (considerably more obscurely) Shift+F10 are used as the keyboard shortcuts to activate the menu bar (or, in some cases, the selection’s context menu). If the user already has a menu or other popup open, this generally dismisses the popup before activating the menu bar.</li>
<li><strong>Scroll the page with the mouse wheel.</strong> Some apps handle this, some don’t. But if a tooltip or context menu was invoked from something that’s being scrolled out of view, there’s probably no reason for the popup to remain open.<br /> <br /><em>[… Are there other ways? There are a wide range of other user actions that could dismiss a popup, but the others I can think of close the popup as a side effect of a click outside the popup or a loss of window focus</em><em>.]</em></li>
</ol>
<p>Most web apps that create popups seem to consider only a small fraction of these cases. For example, it’s common to have a web app’s menu stay open even when the Escape key is pressed (point #6 above) or the tab or window has lost focus (#9 above).</p>
<p>Some of the above cases have complexities that get overlooked. Point #1 above — handling a click outside the popup — raises the question of what should happen with that outside click. The choices are: a) absorb the click so that it has no effect other than closing the popup, or b) let the click affect as usual whatever element outside the popup the user clicked on. On the web, the latter choice can be easier to handle, but this raises a significant usability risk: if the user clicks outside a menu, and just so happens to do so by clicking on a link, do they really intend to trigger the link’s normal navigational response?</p>
<p>As an illustration, suppose a Facebook user has dropped down the menu on the right side of their current toolbar, and then they decide to close the menu by clicking outside it:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201676427a8be970b-pi"><img alt="image" border="0" height="422" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201676427a92c970b-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" width="290" /></a> <br /><em>Careful!</em></p>
<p>That click outside the menu isn’t just going to dismiss the menu—the click is also going to activate the partially obscured “app request” link. If the mouse were just a few pixels lower, the user would end up launching the process to create an ad.</p>
<p>Most OSes and client apps will absorb a click made outside a popup like a menu so that the user doesn’t accidentally trigger an unintended action. Web apps usually <em>don’t</em> absorb the click. It’s hard to know whether this is intentional or not. I think it’s simply a reflection of the fact that absorbing the outside click in a web app takes more effort. I personally think that effort is worth the trouble to avoid usability issues that can arise if, in the course of dismissing a popup, the user ends up accidentally triggering a background UI element. I think that work is even more worthwhile if it can be folded into a shareable component so that most designers and developers don’t have to ever think about this issue.</p>
<p>Related to the concept of a popup is that of an overlay. To help the user see a heavyweight popup like a modal dialog, many web apps display a “lightbox effect” or other visual treatment. This layer sits visually behind the popup but <em>over</em> the main UI in the background. This overlay is really a distinct UI element, albeit one whose existence is probably seldom noticed. The overlay may not even be visible — it may be entirely transparent! But a transparent overlay is precisely the means one would typically use to absorb clicks outside a popup: a click on the overlay prevents the click from reaching a UI element in the background.</p>
<p><strong>The Popup control and its related classes</strong></p>
<p>Over the past week, I’ve overhauled the <a href="http://quickui.org/catalog/Popup">Popup</a> base class as part of work towards a new Menu control. One of my goals was to create a base class that handled more of the cases above automatically. For example, I wanted a Popup to absorb outside clicks by default so that most designers won’t have to even think about this, while still leaving the option of letting the outside click go through if the designer really wants that behavior. Similarly, I wanted the various Popup subclasses (like <a href="http://quickui.org/catalog/Dialog">Dialog</a>) and related classes to handle their respective situations better so that anyone using them has an edge in producing UI with good usability.</p>
<p>The base Popup class now gives the designer and developer the ability to smoothly handle many of the dismissal cases above: outside click, inside click, loss of window focus, pressing Esc, etc. Special cases like menu bar hover behavior can be addressed in subclasses (like the forthcoming Menu control).</p>
<p>A Popup control will normally create a companion overlay control to absorb outside clicks. This overlay is generally an instance of the <a href="http://quickui.org/catalog/Overlay">Overlay</a> class. By default, the first click on an overlay dismisses the popup and removes the overlay. A subclass called <a href="http://quickui.org/catalog/ModalOverlay">ModalOverlay</a> can be used for modal dialogs that want to absorb <em>all </em>outside clicks (not just the first), so as to force the user to explicitly dismiss the dialog. The generic appearance of the ModalOverlay class includes a basic lightbox effect. A Popup can also be created with no overlay in situations where it’s important to let outside clicks have their normal effect.</p>
<p>A related class called <a href="http://quickui.org/catalog/PopupSource">PopupSource</a> is available for the common case where a persistent UI element (a button, say) invokes an attached popup. PopupSource takes care of positioning the popup in relation to the button which invokes the popup. If space allows, the popup is shown below the button and left-aligned, but if this would cause the popup to extend beyond the viewport, the popup may appear above the button or right-aligned as necessary. PopupSource is used as the base class for <a href="http://quickui.org/catalog/ComboBox">ComboBox</a>, so a dropdown produced by a combo box may actually drop <em>up</em> if there’s more room above the combo box and not enough below. This is standard behavior on client OSes, but rare in web sites that have created their own combo box-like elements.</p>
<p><strong>Implementation notes</strong></p>
<p>In dealing with popups, one naturally has to dive into the details of how browsers render one element on top of the other. In this study I was aided by an excellent <a href="http://css-discuss.incutio.com/wiki/Overlapping_And_ZIndex">summary of how DOM elements stack</a>. Having read that, it now seems likely to me that any occurrence of the CSS rule, “z-index: 1000”, can also be read as, “z-index: I don’t really know how this works”.</p>
<p>Predictably, creating a general-purpose Popup class that works reasonably well in a wide variety of configurations on all the mainstream browsers entailed a substantial amount of testing and debugging. IE8 was particularly problematic in this regard.</p><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/4VjGZrf210U" height="1" width="1" /></div></content>



    </entry>
    <entry>
        <title>Controls of the Week: HorizontalPanels and VerticalPanels for basic CSS3 flexbox layouts today</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/03/simpleflexbox.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/03/simpleflexbox.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e20168e8d88a70970c</id>
        <published>2012-03-19T08:00:00-07:00</published>
        <updated>2012-03-16T22:03:26-07:00</updated>
        <summary>It’s really, really common in UI to place a panel on one or both sides of a main content area, on the left and right or on the top and bottom: As ubiquitous as these layouts are, until recently it...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Controls" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>It’s really, really common in UI to place a panel on one or both sides of a main content area, on the left and right or on the top and bottom:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e2016302e32320970d-pi"><img alt="HorizontalPanels" border="0" height="200" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e2016763d7f924970b-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="HorizontalPanels" width="600" /></a></p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e2016302e32327970d-pi"><img alt="VerticalPanels" border="0" height="200" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e8d88a68970c-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="VerticalPanels" width="600" /></a></p>
<p> </p>
<p>As ubiquitous as these layouts are, until recently it wasn’t easy to create them in HTML and CSS alone. You were either forced to hard-code the heights or widths of the panels, which is gross and hard to maintain — measuring the rendered dimension of a UI element is a task best left to the browser. You could write JavaScript to calculate the dimensions at runtime, but that’s a bunch of work many have avoided.</p>
<p>The <a href="http://www.w3.org/TR/css3-flexbox/">CSS Flexible Box Layout Module</a>, a.k.a. “flexbox”, is intended to address layouts like the ones above. For a general introduction to flexbox layout, see <a href="http://coding.smashingmagazine.com/2011/09/19/css3-flexible-box-layout-explained/">CSS3 Flexible Box Layout Explained</a>. This feature hasn’t gotten as much use as it could; as shown on <a href="http://www.caniuse.com/#feat=flexbox">When can I use</a>, it’s not supported on the current (as of this writing) versions of Internet Explorer. Moreover, the flexbox spec changed a while back; only Chrome supports the final spec.</p>
<p>To address older browsers, it’s possible to use a <a href="http://en.wikipedia.org/wiki/Polyfill">polyfill</a> to support new CSS features. In this case, I wanted to create QuickUI controls to serve as a polyfill for flexbox layout. That is, these should take advantage of flexbox on browsers that support it. On older browsers, they should fall back to simpler flexbox-less CSS in cases where that is sufficient, and otherwise fall back to JavaScript-based layout.</p>
<p><strong>Key attributes</strong></p>
<p>The flexbox layout module can handle many layouts and needs beyond the two shown above, but the two above are common enough that they represent a good starting point.</p>
<ul>
<li>Each layout has a stretchable main content panel.</li>
<li>A horizontal layout can have a panel on the left, right, or both. Similarly, a vertical layout can have a panel on the top, bottom, or both.</li>
<li>The control needs to be able to handle arbitrary content in the panels. If the content changes, the layout should adjust in response.</li>
<li>Each layout comes in two forms: one with a constrained height (in which the content is generally scrollable) and one with no height constraint (i.e., grows as tall as necessary). In practice, the unconstrained form comes up much more often in the horizontal layout. (In the vertical case, the unconstrained form is really just a stack of divs, so no special layout is necessary. However, controls such as <a href="http://quickui.org/catalog/TabSet/">TabSet</a> come in both height-constrained and unconstrained forms, and it’d be nice to be able to position the tabs using a vertical layout in either case. So even the unconstrained vertical layout comes up in some, albeit rare, situations.)</li>
</ul>
<p><strong>HorizontalPanels and VerticalPanels controls</strong></p>
<p>I’ve posted <a href="http://quickui.org/catalog/HorizontalPanels/">HorizontalPanels</a> and <a href="http://quickui.org/catalog/VerticalPanels/">VerticalPanels</a> controls that address the layouts described above. They can each handle up to one panel on either side of the content area.</p>
<p>As browser implementations come up to snuff, the components can be updated to take advantage of native CSS flexbox support (including, eventually, the new syntax). You can build a UI using these layout components that will work today (as far back as IE 8), knowing that your UI will capitalize on flexbox support as it become more available.</p>
<p><strong>Implementation notes</strong></p>
<p>The HorizontalPanels and VerticalPanels controls derive from a base class called <a href="http://quickui.org/catalog/SimpleFlexBox/">SimpleFlexBox</a>, which sniffs out support for display: box and its variants. In testing, it seemed only WebKit’s flexbox implementation is worth using today. As of this writing, the Mozilla implementation seems too flaky overall to depend upon. And even on WebKit, I hit what looks like a <a href="http://code.google.com/p/chromium/issues/detail?id=118004">bug</a> preventing the use of automatic scroll bars in a height-constrained flexbox panel with horizontal orientation, which is a pretty common use case. This means HorizontalPanels can’t always use flexbox layout, even on Chrome. And while I’m interested in testing these controls on IE 10, Microsoft has tied the IE 10 preview to the Windows 8 preview, and I’ve already wasted too much of my life fiddling with Windows betas to care about trying Windows 8 before it’s ready. (Weren’t all the tying-IE-to-Windows shenanigans supposed to end with the DOJ consent decree?)</p>
<p>The height-unconstrained cases can be emulated on older browsers using other CSS (i.e., without doing layout in JavaScript), so again there’s no price to pay unless its necessary. If the only way to perform the layout is JavaScript, the control binds to a newly-overhauled pair of events in the QuickUI framework. There’s now a general-purpose layout event to which any control class can bind if it wants to be notified when the control’s dimensions have changed in response to a window resize. There’s a companion sizeChanged event a control can listen to for changes in the dimensions of its children. This is used by the SimpleFlexBox base class, for example, to listen for any changes in the size of controls in its side panels so it can determine whether it needs to adjust the size of the center content area. SimpleFlexBox only binds to these events in the cases where it needs to manually lay things out, so you’re only paying the price of those events when it’s necessary.</p>
<p>I did hit a weird cross-browser issue in IE9: when I view the VerticalPanels demo in IE9 under Large Fonts, the border for the main content area doesn't quite touch the border for the bottom panel. This can happen in IE9 because elements that size to text content can end up with fractional pixel heights. Since IE9 doesn't support flexbox, in the constrained height scenario SimpleFlexBox needs to examine the height of the top and bottom panels so it can adjust the metrics on the main content area. SimpleFlexBox requires on jQuery's height() function to do this, which turns out to always report integral pixel values. Under certain cases, then, it's possible to end up with a sub-pixel gap between the main content area and the panels — and the gap can become visible if the browser or display is scaling things up (as with Large Fonts). IE9 can report fractional heights via window.getComputedStyle(), but it doesn't seem worth this trouble just to support IE9 under various display edge cases. IE8 reports integral heights, and IE10 should support flexbox, leaving only IE9 with this issue. A simple workaround would be to avoid setting interior borders on the main content area if you're also setting them on the panels.</p>
<p>In any event, it’s nice to be able to wrap up a bunch of browser-dependent styling or code into a reusable component that can handle the details so the component user doesn’t have to. And, IMO, I’m not altogether sure that universal flexbox support will actually eliminate all need for controls like HorizontalPanels or VerticalPanels. Use of those controls in your code can arguably make it easier to clearly state your <em>intent</em>. While the CSS flexbox spec is very, um, flexible, the resulting CSS is not particularly easy to read. I preferred the Dock=“Left” syntax of Microsoft’s <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.dockpanel.aspx">DockPanel</a> control to the flexbox syntax, and have tried to mirror the former in designing the API for HorizontalPanels and VerticalPanels. Compare: to set the content of the left panel of HorizontalPanels control, you can stuff that content into a property called “left”. To achieve the same result in CSS3, you <em>omit</em> the “box-flex:” property to ensure the panel <em>won’t</em> stretch. I think the former is easier to read and maintain. Even once everyone has a flexbox-capable browser, these controls might still find use as more legible wrappers around the underlying CSS.</p><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/8ROkPSlyS1I" height="1" width="1" /></div></content>



    </entry>
    <entry>
        <title>Like snapping together a skyscraper: Web components will catalyze a completely new ecosystem for creating UI</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/03/snapping-together-a-skyscraper.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/03/snapping-together-a-skyscraper.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e20167639cdd7e970b</id>
        <published>2012-03-14T08:00:00-07:00</published>
        <updated>2012-03-09T15:03:25-08:00</updated>
        <summary>In just a few years, the ecosystem in which we create UI will change so dramatically that it will be hard to remember how we did things way back in 2012. For a sense of perspective, consider a similar change...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>In just a few years, the ecosystem in which we create UI will change so dramatically that it will be hard to remember how we did things way back in 2012.</p>
<p>For a sense of perspective, consider a similar change that transpired over a much longer period of time in a different industry: home construction. If you were building a house hundreds of years ago, you might have directly built or overseen most of the elements that went into your house: the framing, the hearth, the chimney, the roof, the windows, doors, you name it. You built nearly everything yourself — there were hardly any <em>components</em>. Depending on where you lived, the only pre-built components you might have used would have been small and simple: glass from a glazier, bricks from a brickmaker, hardware from a blacksmith, and pipes or tiles from a ceramist. Even a glass window would have its surrounding parts — the case or sash, the wooden frame, the sill — measured, cut, and assembled on site and for a specific window. If you hired a craftsman like a carpenter or mason, everything they built for you would have been created on site specifically for your house.</p>
<p>Now build a house in a modern economy. The majority of your home’s elements are components assembled elsewhere by specialists and shipped to your construction site ready for final installation. When you design a house, you now spend a lot of your time looking through catalogs of these components. Most of those components come in standardized dimensions or configurations. Many are quite complex. You can buy an intricate multi-part casement window in a variety of window configurations as a single, complete unit that includes wood, metal, multiple layers of glass, glass treatments, hinges, locks, screens, and other hardware. You can find a similarly dizzying selection of pre-built roof joists, plumbing fixtures, or light sconces, or other components. If you want a component that someone doesn’t already offer for sale, you are either visionary or insane.</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20167639cdd4e970b-pi"><img alt="Window Styles 1" border="0" height="302" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e89dee22970c-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Window Styles 1" width="600" /></a></p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e89dee33970c-pi"><img alt="Window Styles 2" border="0" height="315" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20167639cdd70970b-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Window Styles 2" width="600" /></a></p>
<p><span style="font-size: 10pt;"><em>A tiny handful of configurations for window components (source: <a href="http://www.windowexpress.co.uk/double_glazed_windows.html">Window Express</a>)</em></span></p>
<p> </p>
<p>The componentization of the building industry means you can get a lot more house for a lot less money, and the resulting home can be better suited to your needs. Most of the factory-made components will be of better quality than what any one individual could make themselves on site. (It’s the site-built skylights that leak, not the factory-made ones.) And not only is the resulting building different; the component ecosystem brings about myriad new roles and industries.</p>
<p>Now consider software, where we’ve labored for years hand-crafting every element of the user experience like a medieval builder. The browser or OS gives us a tiny number of simple UI primitives; we must write nearly everything else in the UI by hand. For simple designs that are essentially fancy documents, one can use a visual editor of the Adobe DreamWeaver ilk, but you still have to roll up your sleeves. And any UI that affords any significant degree of interactively is created substantially in code on either the back end or front end. To the extent that UI code is “shared”, most often it’s actually copied and then hacked to fit, rather than implemented with a truly shareable component. If you did static analysis of the UI code for the 100 most popular web apps, I’ll bet you’d find that only a tiny percentage of that UI code is actually shared with another organization.</p>
<p>If only there were some standard for composing and extending web UI components, we’d be able to unleash a UI ecosystem that would transform the UI world as thoroughly as the physical building component ecosystem has changed home construction.</p>
<p>The UI field may actually undergo a <em>bigger</em> transformation, because the software world isn’t subject to the same constraints as the physical world. It is possible to create responsive UI components that change based on the device context, meta-controls that generate UI from more basic controls, adaptable components that change based on the user’s abilities and experience, and components that directly exploit third-party services.</p>
<p>With such tools in hand, it should be possible to create huge, complex interfaces in a fraction of the time it currently takes, and for far less money. You’ll be able to assemble the UI of a significant application very quickly, and get something interesting that in many ways actually <em>works</em>. It will be like snapping together building parts to create a skyscraper.</p>
<p>This transformation is still in the future, but it’s coming. One important step here is Google now taking the lead on a spec for web components that will standardize how components are defined and interact. A good summary can be found in <a href="http://dvcs.w3.org/hg/webcomponents/raw-file/tip/explainer/index.html">Web Components Explained</a>. (Years ago, Microsoft tried to promulgate a standard for <a href="http://en.wikipedia.org/wiki/HTML_Components">HTML Components</a>, but it never caught on.) While closure on the web component spec is still off in the future — and broad availability is, of course, even further away — this new world is coming.</p>
<p>This can’t happen soon enough. It will finally free us from having to waste such an ungodly amount of time attending to the design, coding, and testing of common user interface patterns, and let us move our attention up the value ladder to focus more on our own products’ domains.</p>
<p>This development will ultimately commoditize some large portion of the industry’s UI output. As with the building industry, commoditization of UI elements will catalyze the creation of new roles in the UX industry: specialists who create components, component integrators, component testing labs, standards groups, and many more people in more organiziations creating better UI because they can start with solid, usable components addressing many of their needs.</p>
<p>I’m excited by what this will mean for the QuickUI control framework. Google’s web component spec will eventually let the browser natively address the lowermost functions which QuickUI must currently perform in JavaScript. This will enable much better performance, better isolation and modularity, and faster adoption. It’s too early to say how QuickUI evolve in this regard, but I want to direct its evolution such that it will transition smoothly to the standard web component foundation when that becomes widely available. Among other things, I’d looking at how to evolve the open <a href="http://quickui.org/catalog">QuickUI Catalog</a> of common UI controls so that they can someday be delivered as web components on the standard foundation. The goal is that someone using QuickUI controls today will find their investment preserved and profitable when the component future arrives.</p>
<p>If you’re interested in tracking Google’s work on the topic, they are posting announcements on Google+ on the <a href="https://plus.google.com/103330502635338602217">Web Components</a> page.</p><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/UlQ7X3aSgGM" height="1" width="1" /></div></content>



    </entry>
    <entry>
        <title>Control of the Week: Pinterest-style PackedColumns efficiently fills space with tiles of varying heights</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/03/packedcolumns.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/03/packedcolumns.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e201676373f8b9970b</id>
        <published>2012-03-12T08:00:00-07:00</published>
        <updated>2012-03-05T15:54:31-08:00</updated>
        <summary>Image-sharing site Pinterest is the current darling of the social media world, and the core of its user experience is its attractively-designed home page: This page takes good advantage of available window real estate. As the user makes the window...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Controls" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>Image-sharing site <a href="http://pinterest.com">Pinterest</a> is the current darling of the social media world, and the core of its user experience is its attractively-designed home page:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201676373f7bf970b-pi"><img alt="Pinterest" border="0" height="347" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20163027f804d970d-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="Pinterest" width="450" /></a></p>
<p> </p>
<p>This page takes good advantage of available window real estate. As the user makes the window wider, the page re-lays out the columns of image tiles (or “pins”, in the parlance of the site) to take advantage of the extra width:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20163027f80d2970d-pi"><img alt="Pinterest (Wider)" border="0" height="345" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201676373f8a6970b-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="Pinterest (Wider)" width="600" /></a></p>
<p> </p>
<p>The page must accommodate a wide range of tile heights, as the photos have different aspect ratios, and the number of comments per pin can vary. If the page simply laid out the tiles in a strict grid, it would waste a great deal of space. To use the space more efficiently, the page employs a “packed columns” layout.</p>
<p><strong>Key attributes</strong></p>
<p>The packed columns layout algorithm is straightforward:</p>
<ol>
<li>Divide available width by the standard item width to determine how many columns can fit.</li>
<li>Make all columns initially empty.</li>
<li>For each item in turn, add the item to the column which is currently shortest.</li>
</ol>
<p>The simplicity of this algorithm is such that it’s been independently recreated multiple times. The algorithm has some nice properties:</p>
<ul>
<li>It’s fast.</li>
<li>As much horizontal space is used as possible (while still showing entire items). If a user gives the site more width, they’re rewarded with more information.</li>
<li>The arrangement is visually interesting.</li>
<li>The positions of the first few items are stable.</li>
<li>At any given page width, the overall heights of the columns will be roughly equivalent. If the user scrolls to the bottom, they won’t find an unbalanced amount of space under any particular column.</li>
<li>The relative vertical position of any two items is preserved across resize operations. If item A appears above item B at one window size, then item A will always be above (or on the same row) as item B at any other window size. The user doesn’t need to understand this; it just means that if some interesting item is “near the top” before a resize, then after the resize the same interesting item will still be “near the top”.</li>
</ul>
<p>The last point speaks to another benefit of the algorithm which doesn’t show up in Pinterest, but does show up in other applications: the consistent relative positions of items means you can offer users the ability to specify an order or prioritization for the items that affects (but doesn’t completely determine) where items end up. I used this years ago in the design for a home page for Microsoft Money, a personal finance application whose home page included a user-customizable set of home page modules. A Settings dialog let the user specify the priority of those modules by dragging the modules within a one-dimensional list. While the ultimate two-dimensional position of the modules depended on the window width and the modules’ current heights, the priority of any given module determined how close to the top of the page that module would end up. This limited degree of customization was sufficient to meet many users’ needs without having to create a full-blown customizable layout UI.</p>
<p><strong>PackedColumns</strong></p>
<p>I’ve added a <a href="http://quickui.org/catalog/PackedColumns">PackedColumns</a> control to the QuickUI Catalog. There’s a link to a <a href="http://quickui.org/catalog/PackedColumns/demo.html">demo</a> that simulates the general appearance of Pinterest’s home page. (I initially centered the items in the demo the way Pinterest does, but turned centering off to make it easier to observe the layout behavior.)</p>
<p>Usage: Use PackedColumns to arrange a collection of child elements whose widths are fixed but whose heights vary substantially. If the heights are relatively consistent, users will likely find a traditional grid presentation easier to interpret and use.</p>
<p><strong>Commentary</strong></p>
<p>Given the simplicity of the algorithm, this wasn’t all that hard to code up. I expect it’s not necessarily the actual cost of a layout like this that deters sites from adopting it. Rather, it’s the current need to independently discover or reverse-engineer behavior like this that most inhibits its adoption. As design knowledge gets coded into controls, however, such UI should become more pervasive.</p>
<p>In essence, an ability to easily create and adopt create web components will lead to a commodification of user interface elements. Today Pinterest’s insight and ability to create a packed columns layout may confer a slight competitive edge, but someday commodification will quickly eliminate such edges. This will be true not just for UI elements that can easily be independently created, but for nearly anything. The day after a new site launches with a cool new UI trick, that trick will be copied and packaged up as an openly available and readily adoptable UI control anyone can use.</p><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/HYPEMluAlUc" height="1" width="1" /></div></content>



    </entry>
    <entry>
        <title>UI Control of the Week: Repeater control generates multiple copies of UI elements</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/02/repeater.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/02/repeater.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e201676283ee32970b</id>
        <published>2012-02-27T08:00:00-08:00</published>
        <updated>2012-02-17T10:34:55-08:00</updated>
        <summary>User interfaces invariably entail a certain degree of repetition; they’re filled with vertical or horizontal sequences of UI elements that behave identically are are styled identically. Sometimes the elements in such a sequence vary only in their label, and sometimes...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Controls" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>User interfaces invariably entail a certain degree of repetition; they’re filled with vertical or horizontal sequences of UI elements that behave identically are are styled identically. Sometimes the elements in such a sequence vary only in their label, and sometimes even that doesn’t vary; the controls really are all exactly the same. As an example, if we go back to the first post in this series on UI controls, we find that Apple’s <a href="http://miksovsky.blogs.com/flowstate/2011/10/slidingpageswithdots.html">sliding pages with dots</a> control contains a horizontal sequence of little dot buttons. The variant of this control on Apple’s web Store uses blue dots:</p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e2014e8c1fa9c5970d-pi"><img alt="Apple Store Sliding Pages" border="0" height="379" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e2014e8c1fa9c9970d-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="Apple Store Sliding Pages" width="640" /></a></p>
<p>Those little dots along the bottom don’t contain any data, and so their DOM representation of each is essentially identical. (The blue selected state comes from a style applied with a class.) Sequences of completely identical UI elements like this are relatively rare in a production UI. During design and development, however, it’s pretty common to want to throw a bunch of placeholder controls into the UI. Early in the design process, a prototype’s toolbar might have buttons labeled, “Button 1”, “Button 2”, “Button 3”, and so on, until the team can work out exactly what commands they want to offer users there.</p>
<p>But, despite the repetition, creating a collection of buttons like that is generally a manual process: the designer or developer must manually create a set of buttons, and carefully give them each a unique, placeholder name. Alternatively, one writes a bit of throwaway script to generate a given number of controls, although that can take a few minutes to work up.</p>
<p>The <a href="http://miksovsky.blogs.com/flowstate/2012/02/placeholders.html">recent post on placeholder controls</a> pointed out that it can be worthwhile to have a UI control even if it’s only used during the design process; anything that saves time helps. Here, I think it’s interesting to have a control specifically for the task of generating repetitions in a UI. As with the <a href="http://miksovsky.blogs.com/flowstate/2011/11/listbox.html">previously-discussed</a> <a href="http://quickui.org/catalog/ListBox/">ListBox</a>, this is effectively a higher-order meta-control: a control that creates or manipulates other controls. This can be useful for mocking things up during design. And, per the Apple example above, it might even be useful in production UI.</p>
<p><strong>Repeater</strong></p>
<p>The QuickUI Catalog contains a <a href="http://quickui.org/catalog/Repeater/" target="_self">Repeater</a> control. Given a control class and a number, it will create that many instances of that class. If you create a Repeater and give it a dot button class and a count of 5, you’ll get:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e785d246970c-pi"><img alt="Repeater Dots 5" border="0" height="9" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201676283ee12970b-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Repeater Dots 5" width="93" /></a></p>
<p> </p>
<p>With that in hand, you can easily bump the count up or down to get whatever number you need. If you want to see what things look like with 20 copies of the dot control, instead of doing a cut-and-paste of your UI code, you can just change the desired count to 20:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20163018ec554970d-pi"><img alt="Repeater Dots 20" border="0" height="9" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20163018ec55c970d-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Repeater Dots 20" width="408" /></a></p>
<p> </p>
<p>If you give the Repeater some content, each generated copy of the control will end up with that content. Here a Repeater has been told to create 5 instances of a simple button class and set their content to the text, “Button”:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201676283ee1b970b-pi"><img alt="Repeater Buttons 5" border="0" height="25" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201676283ee25970b-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Repeater Buttons 5" width="290" /></a></p>
<p> </p>
<p>For a bit of variety, you can also ask the Repeater to append an incrementing integer to the content:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201676283ee28970b-pi"><img alt="Repeater Buttons 5 with Increment" border="0" height="25" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20163018ec568970d-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Repeater Buttons 5 with Increment" width="350" /></a></p>
<p> </p>
<p>This is another one of those controls that, now that I have it, I end up using quite a bit. When poking around with a layout idea, it’s great to be able to fill up the UI quickly with a sequence of elements.</p>
<p><strong>Implementation notes</strong></p>
<p>It’s easy enough to create a one-off bit of JavaScript that creates an arbitrary number of controls, but why rewrite that code every time you need it? By investing just a bit of time in creating a reusable component, even that simple bit of code has already been written for you.</p>
<p>The implementation of Repeater has become simpler over time as the QuickUI framework has gotten better at supporting the creation of meta-controls. These controls generally have one or more properties that accept a control class as a value. Creating such a property is easily done in a single line using a <a href="http://quickui.org/docs/control-class-methods.html#property-class">Control.property()</a> declaration. A recent update to the QuickUI runtime makes it also possible to pass in arbitrary UI in <a href="http://quickui.org/docs/control-JSON.html">Control JSON</a> format, so you can use the Repeater control to generate <em>n</em> copies of some brand-new UI fragment containing a mixture of other controls.</p>
<p>As suggested above, a Repeater is incorporated into the implementation of the Catalog’s <a href="http://quickui.org/catalog/SlidingPagesWithDots/">SlidingPagesWithDots</a> and <a href="http://quickui.org/catalog/RotatingPagesWithDots/">RotatingPagesWithDots</a> (which adds automatic rotation) controls. Once the number of children (pages) is known, the control can simply pass that number to the Repeater’s count() property to generate the required number of dot buttons.</p><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/PnCIgf8anXI" height="1" width="1" /></div></content>



    </entry>
    <entry>
        <title>UI Controls of the Week: Making HTML check boxes and radio buttons work the way they should have in the first place</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/02/labeledinput.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/02/labeledinput.html" thr:count="3" thr:updated="2012-02-21T21:06:05-08:00" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e20168e74de1eb970c</id>
        <published>2012-02-20T08:00:00-08:00</published>
        <updated>2012-02-14T14:18:48-08:00</updated>
        <summary>Here’s the current Sign In UI on a typical e-commerce web site (United Airlines, one of the largest airlines in North America) with a minor but common user interface bug: The bug is this: the “Remember me” check box can...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Controls" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>Here’s the current Sign In UI on a typical e-commerce web site (United Airlines, one of the largest airlines in North America) with a minor but common user interface bug:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e74de1cb970c-pi"><img alt="United Airlines Sign In" border="0" height="208" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201630156faf9970d-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="United Airlines Sign In" width="222" /></a></p>
<p> </p>
<p>The bug is this: the “Remember me” check box can only be checked by clicking the tiny 13 by 13 pixel square; clicking the text <em>label</em> for the check box has no effect. This minor but common bug appears on many web sites because an HTML &lt;input&gt; check box on its own can’t define a label. The label can only be defined by creating a separate &lt;label&gt; tag. I have no idea who came up with this arrangement, and can only imagine that this was intended to allow flexibility. It does allow, for example, a check box label to be placed above, under, or to the left of, a check box. But this flexibility comes at a cost: many web developers aren’t aware of the need for &lt;label&gt; tags, and so they end up with check boxes with static, unclickable labels. HTML radio buttons suffer from the same issue.</p>
<p>Of course, users have been long trained by client OSes that the text next to a check box or radio button <em>should</em> be clickable. It makes sense, after all, to give the user a large hit area (especially on a touch device). If the site above were to correctly define a check box label, the hit target would be 600% times as large as using the box alone, at no additional cost in screen real estate. Furthermore, the UI would be more accessible to a larger population, including vision-impaired people using screen readers.</p>
<p>The situation is improving, and a quick survey of some highly-trafficked web sites shows that many of them do correctly define labels for check boxes and radio buttons. But even some popular sites do not, or don’t do so consistently. Quantcast estimates the above United Airlines site gets about 1M U.S. visitors a month, and it’s fair to guess that some significant portion of those people are being driven through the faulty Sign In UI above.</p>
<p>The problem persists because here <em>it’s harder to create a correct UI than an incorrect one</em>. For the correct result here, the developer has to:</p>
<ol>
<li>Hear about the need for the &lt;label&gt; tag and learn how it works.</li>
<li>Remember to use a &lt;label&gt;.</li>
<li>Set an ID on the &lt;input&gt; element.</li>
<li>Create the &lt;label&gt; element.</li>
<li>Type in the user-visible text.</li>
<li>Set the label’s “for” attribute to the input element’s ID.</li>
</ol>
<p>In contrast, to create this check box the <em>wrong</em> way, the developer just has to:</p>
<ol>
<li>Type in the user-visible text.</li>
</ol>
<p>A check box created the wrong way looks pretty much like one created the right way, so it can be hard for the team creating the UI to spot the bug. And, of course, when the problem exists in UI that’s generally shown only to new users (like the UI above), team members will rarely be exposed to the bug themselves.</p>
<p>Usability experts can exhort the correct use of &lt;label&gt; tags until they’re blue in the face, but a real fix requires that it be easier to create a correct UI than an incorrect UI. Client OSes have made this easy for years, and I can probably count on one hand the number of times I’ve seen a check box in a client app in which the text was not correctly clickable.</p>
<p>Oh, and one more thing. On the web, it turns out that <em>even if you do things the way you’re told to</em>, your check box or radio button UI may still have a tiny bug. By default WebKit and Mozilla put an unclickable 3px margin around the input element. So even if you use a &lt;label&gt; tag in the recommended fashion, you still end up with a 3 pixel gap (highlighted below in red) between the input element and the label:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e201630156fb02970d-pi"><img alt="Check Box Label Gap" border="0" height="52" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e74de1e4970c-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="Check Box Label Gap" width="440" /></a></p>
<p> </p>
<p>Clicks in this gap have no effect! This is a teeny tiny bug that nevertheless happens to show up in WebKit and Mozilla on nearly every web site. (IE takes care to leave no gap.) This probably means that on any given day thousands of users happen to click in that gap, and are puzzled that nothing has happened before they quickly click again. I noticed that one site, Gmail, carefully works around this very issue by overriding the margins on the check box and label to eliminate the gap. Once again, it seems the platform makes it harder to create a correct UI than an incorrect one.</p>
<p><strong>CheckBox and RadioButton</strong></p>
<p>I’ve added <a href="http://quickui/catalog/CheckBox">CheckBox</a> and <a href="http://quickui/catalog/RadioButton">RadioButton</a> controls to the QuickUI Catalog that implicitly associate a label with an input element, and close up the gap described above.</p>
<p>These aren’t particularly fancy or interesting components, but they’re nevertheless simple to use and solve the problem defined above. I wish HTML check boxes and radio buttons had always worked like this.</p>
<p><strong>Implementation notes</strong></p>
<p>Both CheckBox and RadioButton inherit from a <a href="http://quickui/catalog/LabeledInput">LabeledInput</a> base class that creates the automatic link between the label and the input element.</p>
<p>I originally implemented the LabeledInput base class as an inline div containing an input and a label element, and had some JavaScript explicitly link the two elements with a generated ID. But then I noticed something interesting on Gmail’s sign in page: the input element is <em>inside</em> the label element, right before the static text. I’ve never seen this approach documented on pages that describe the use of &lt;label&gt;. Every site seems to document the label appearing in the HTML immediately after the input. But putting the input inside the label seems to work in all the mainstream browsers. The advantage of this approach is that there’s no need to set the “for” attribute on the label; the label automatically binds to the input element it contains.</p>
<p>Taking another hint from Gmail, the LabeledInput class also sets margins so as to leave no gap between the input element and the adjacent text.</p>
<p>Finally, as an extra bonus, the RadioButton control solves an annoyance specific to HTML radio buttons. An HTML developer must manually designate an internal radio button group name for each radio button in the group that should work together (i.e., which should be mutually exclusive). This isn’t hard to do, but it’s still an extra step, and more work than should really be necessary. So, by default, if you don’t explicitly put a RadioButton into a group, it will automatically group itself with any siblings (with the same DOM parent) that are similarly ungrouped.</p><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/9XbbilpD8KA" height="1" width="1" /></div></content>



    </entry>
    <entry>
        <title>UI Controls of the Week: Quickly fill up a UI mockup with photos, placeholder text, and ads</title>
        <link rel="alternate" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/02/placeholders.html" />
        <link rel="replies" type="text/html" href="http://miksovsky.blogs.com/flowstate/2012/02/placeholders.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-6a00d83451fb6769e20168e6fdfa01970c</id>
        <published>2012-02-13T08:00:00-08:00</published>
        <updated>2012-02-08T11:07:55-08:00</updated>
        <summary>When you’re designing a new UI, you often need to experiment with a variety of UI layouts in advance of having content that’s representative of what your UI will eventually display. This is a good thing — you don’t want...</summary>
        <author>
            <name>Jan Miksovsky</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Controls" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://miksovsky.blogs.com/flowstate/"><div xmlns="http://www.w3.org/1999/xhtml"><p>When you’re designing a new UI, you often need to experiment with a variety of UI layouts in advance of having content that’s representative of what your UI will eventually display. This is a good thing — you don’t want to be burdened with the task of creating meaningful content when you’re focused on layout and navigation flow. In the exploratory stages of design work, it’s also important for you, or your design’s reviewers, to not get caught up too much in the generation of sample content.</p>
<p>This is why designers have long used <a href="http://en.wikipedia.org/wiki/Lorem_ipsum">Lorem Ipsum</a> placeholder text to fill up a design. It looks like real text (which would not be the case if you simply mashed the keyboard), and you can <a href="http://www.lipsum.com/">generate an infinite amount of it</a> to fill up any design you’re working on. Most designers also have a collection of placeholder images or advertisements they can use to fill up a design mockup. One service will dynamically serve up <a href="http://placekitten.com/">placeholder photos of kittens</a>, although I’d imagine the conspicuous presence of zillions of kittens will be highly distracting for most web site designs.</p>
<p>Although end users never see these sorts of placeholders, they’re nevertheless an essential element in the software development process. I’ve yet to see placeholder components included in a UI library, but it seems eminently reasonable for these placeholders to be packaged up as reusable controls. Anything that cuts down on design time is money in your company’s pocket.</p>
<p>With that in mind, the QuickUI library now has several placeholder controls:</p>
<p> </p>
<p><strong>LoremIpsum</strong></p>
<p>The <a href="http://quickui.org/catalog/LoremIpsum/">LoremIpsum</a> control generates an arbitrary number of paragraphs of Lorem Ipsum text. You can control number the number of sentences per paragraph. By default, the first sentence of the first LoremIpsum control starts with “Lorem ipsum dolor sit amet…”, but you can control that as well.</p>
<p><strong>FlickrInterestingPhoto</strong></p>
<p>The <a href="http://quickui.org/catalog/FlickrInterestingPhoto/">FlickrInterestingPhoto</a> control grabs a photo from Flickr’s <a href="http://www.flickr.com/explore/interesting/">Interestingness</a> collection for the previous day. You can pick one of Flickr’s standard image sizes, or you can use CSS to scale the photo to an arbitrary size.</p>
<p>I use Flickr for this control because it’s free, has a good API, has high-quality images, and the images will change each day. It’d be pretty straightforward to adapt the control to another photo service.</p>
<p><strong>AdPlaceholder</strong></p>
<p>Finally, the <a href="http://quickui.org/catalog/AdPlaceholder/">AdPlaceholder</a> control creates a rectangle the size of any <a href="http://www.iab.net">IAB</a> standard ad unit, or you can specify an arbitrary size.</p>
<p>I’ve looked for a server that would serve up meaningful ad images, but haven’t found one. Some sites will give you a small set of ad placeholders, but they’re too boring to be convincing, and the small size of the sample set means you get too much repetition. An ad placeholder service would be quite useful. It would give advertisers free exposure, although the ad server would need to be rigged to <em>not</em> count such impressions as meaningful. All this means that it’s hard to provide a general-purpose ad placeholder control. It would be quite easy, on the other hand, to create an ad placeholder control that worked against a specific ad server and ad account.</p>
<p> </p>
<p>Using placeholders like these let you quickly fill up a mockup. E.g., the <a href="http://quickui.org/catalog/PersistentPanel/persistentPanelSideDemo.html">demo</a> for the <a href="http://quickui.org/catalog/PersistentPanel/">PersistentPanel</a> control uses all three types to block out a fairly interesting layout on the fly:</p>
<p> </p>
<p><a href="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e6fdf9ed970c-pi"><img alt="PersistentPanel (side)" border="0" height="480" src="http://miksovsky.blogs.com/.a/6a00d83451fb6769e20168e6fdf9fc970c-pi" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="PersistentPanel (side)" width="425" /></a></p>
<p> </p>
<p>In practice, I’ve discovered that these dynamic placeholder controls deliver a substantial benefit over relying on static content: the random content forces me to cope with layout situations I might not expect or encounter until far later in the development process. Designers have a innate tendency towards perfection, and invariably pick sample content to make a layout look as appealing as possible. For example, a design for a window will typically show a set of content that perfectly fills the window, but as I noted long ago, such a design is <a href="http://miksovsky.blogs.com/flowstate/2005/07/if_a_ui_sketch_.html">probably too good to be true</a>. Your team will end up evaluating a design according to a degree of theoretical perfection that will never be seen in production. By building mockups around dynamic content, you force yourself to recognize and adapt to a more meaningful range of text run lengths, picture aspect ratios, and so on.</p><xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/flowstate/~4/e5Ow0QJrtYU" height="1" width="1" /></div></content>



    </entry>
 
</feed><!-- ph=1 -->

