```Command K 条形图```
Command K Bars

原始链接: https://maggieappleton.com/command-bar

## 命令行的回归:平衡GUI的复杂性 数十年以来,图形用户界面(GUI)一直占据主导地位,为计算机操作提供视觉布局。然而,GUI在处理复杂性方面存在困难——例如在Cinema 4D等专业软件中,查找功能变得令人不知所措。虽然GUI在可发现性和多任务处理方面表现出色,但对于拥有大量命令的系统来说,它们可能会变得杂乱且效率低下。 一种越来越受欢迎的解决方案是“命令栏”——一个弹出式、可搜索的界面(通常通过Cmd+K等快捷键访问),允许用户*键入*命令,而不是浏览菜单。这些栏使用模糊搜索,即使在不精确记住命令的情况下也能快速访问,并且还可以充当通用搜索工具。 命令栏可以简化GUI,减轻认知负担,并且越来越受到Linear、Todoist和Raycast等工具的欢迎。Command Bar等服务和`cmdk`等开源项目简化了实施过程。这些栏的灵感来自苹果公司2005年的Spotlight搜索,代表着一种将GUI的易用性与命令行界面的效率相结合的转变,为管理复杂应用程序提供了一种强大的方式。

Hacker News 上正在讨论“命令栏”的设计——通过键盘快捷键(如 Command+K)访问的界面,用于容纳不常用的功能。文章(来自 maggieappleton.com)探讨了这种 UI 模式。 虽然该设计因能简化界面而受到赞扬,但评论员们表达了对*可发现性*的担忧。一位用户指出 Windows 开始菜单的演变是一个警示故事,功能变得隐藏且难以找到。另一位用户强调,命令栏主要服务于熟悉打字的重度用户。 讨论还涉及快捷键冲突——Command+K 以前常用于链接创建,迫使一些应用程序(如 Slack)重新使用其他不太直观的快捷键。 许多评论员建议浏览 Maggie Appleton 的网站,以获取更多关于设计的有见地文章。 最后,用户们对网站覆盖标准键盘快捷键表示沮丧。
相关文章

原文

The Context

Graphical user interfaces (GUIs) have been the bread and butter of user interface design since the mid-1980s. Having all your computational objects and actions laid out in little pixelated boxes, icons, toggles, and buttons make it easy to understand what you can do with a computer. They make the affordances visible, as we say in nob-designer-land.

Before GUIs, every computer interface was a command-line interface (CLI). You typed memorised text-based commands into an input. This certainly kept the screen free of clutter but had several downsides. It was difficult to remember what commands were available. You couldn’t see the current state of the system. Everything was hidden away behind that blinking cursor.

I explored this history and trade-offs between these two interface paradigms in Programming Portals so I won’t delve as deeply into them here. The important tensions we’re going to focus on are the trade-offs between pixel real estate, cognitive load, and complexity.

Well-designed GUIs make interfaces easier for new users to learn, improve discoverability, and are better suited to multi-tasking workflows. But they don’t scale very well to complex systems with hundreds of commands – especially if those commands can be combined to create emergent complexity. GUIs rely on representing computational objects and functions visually. As in, graphical shapes and text that use up the precious commodity of screen space.

Here’s a series of screenshots from Cinema 4D, a popular 3D modelling and animation app:

You absolutely could not do 3D modelling without a graphical interface. Defining 3D objects in text without being able to see them would be laborious, error-prone, and absurd. And yet look at the number of icons, panels, and toolbar options in these screenshots!

The dropdown menus have submenus. Every pane has multiple tabs. Numerous pop-over panels contain enough functions to be apps in themselves. From personal experience I can tell you finding anything in here is a wild goose chase. People spend hundreds of hours learning to use this interface.

This is not a rag on Cinema 4D. Professional 3D modelling involves a lot of inherent complexity. People need fine-grained control over their creations. And Cinema 4D gives them access to an array of tools that profoundly expand what they’re capable of making. But simply finding what’s available in this dizzying UI becomes a challenge.

This issue isn’t limited to unusually complex applications like Cinema 4D. Think of all times you’ve gone hunting through a settings panel trying to track down functionality you know exists, but can’t quite locate. Even in much simpler apps, finding the tiny toggle button that will make them stop emailing you every day is a genuine challenge.

We usually rely on a mix of spatial memory and well-written labels to find what we need in this kind of interface. But that only goes so far. At some point, we have to find ways to help users navigate apps outside of graphical menu bars, mystery icons in toolbars, and tabbed settings panels.

The Pattern

Command bars are command-line bars that pop up in the middle of the screen when you hit a certain keyboard shortcut. Traditionally CMD + K, hence the moniker “Command K bars.” But CMD + E and CMD + / have also been strong shortcut contenders.

They typically look like this:

The command K bar in Linear

This one is from Linear - an issue-tracking app for product teams. Bars like this let users search through all the available commands in an application. Rather than remembering which sub-sub-sub menu a function lives in, users need only remember its name.

They don’t even have to remember its exact name. Fuzzy search can help them find it by simply typing in similar names or related keywords. For example, if I type “make” into a command bar, it’s likely to show me any actions related to creating new items. Even if “make” isn’t part of the action name.

Fuzzy search in Linear lets you find actions without needing the exact name

This makes it much faster and easier to find things. If you’re in the middle of writing something, you don’t even have to take your hands off the keyboard. A few quick finger strokes and you can find the action you need and run it. Far faster than navigating a small cursor through a series of menu mazes.

These bars also do double duty as universal search bars. You’re not only searching through the available actions in an app. You can also search through content like documents, file names, and tasks.

By stashing infrequently-used items in a command bar like this, you can clear up a lot of screen real estate. You don’t need to add that extra toolbar or layer of menu items. Keeping the interface clear of options helps reduce the number of things users need to pay attention to at any one time. Which means they’re less likely to be overwhelmed and confused by irrelevant features.

Unsurprisingly, they’re now proliferating. You know an interface pattern is catching on when whole SaaS applications and community open-source projects spring up around it. Command bar is a paid-for service that gives applications a plug-n-play solution. Or teams can opt to use the open-source projects cmdk and kbar to easily add command bars to their app.

These pre-built bars stuff an enormous amount of sophisticated UI functionality into their little rectangles. They can give you tabs, filters on searches, recommended actions, inline forms, pop-up menus, grid displays, dark mode, and more.

This lack of friction means it’s easy for product teams to pop one of these in without thinking too much about it. Here are just a few of these bars in action:

Todoist

Todoist is a popular task manager that puts a lot of emphasis on quick actions via keyboard shortcuts. You can see in their bar they’re using the space on the right-hand side of each action to remind users of keyboard combos.

Framer

Framer is a design & prototyping tool. You can search for both actions and components, and it fittingly gives you a nice big visual preview. Their command bar is more graphical than most with colourful icons and buttons embedded inside it.

Tana

Tana is a new knowledge management app that puts a lot of focus on dynamic views and flexible data. Their command bar lets users access a huge range of advanced functionality you could never fit into a classic UI (without it turning into a C4D situation).

Here’s a demo of me using the command bar to quickly write a search query for all the books in my database, filtered for only ones marked “Unread”

This is a good example of how users can chain multiple actions together in command bars. Each selection in the bar moves you onto the next set of available choices.

Raycast

Raycast takes the concept of a command-bar-as-universal-interface to the extreme. The whole app is just a command bar. But it has access to your full desktop environment and integrates with most major applications.

Think of Apple’s Spotlight feature, but if search actually worked and it could tap into all your other applications – Slack messages, Google drive files, Github PR, Figma files, etc. Raycast very cleverly designed the system to be extensible. Any developer can build a new extension for it, meaning there’s no ceiling to the number of actions potentially available in it.

Here’s a quick demo of me accessing Wikipedia, Spotify, Google, and even querying GPT-3 from the unified interface:

Lazy

Lazy is following the spirit of Raycast, but specifically for information capture and knowledge management. It’s a bar you can pull up in any context – twitter, an article, a youtube video, email – and natively capture key information into a personal database.

They’re still pre-release so you’ll have to settle for the fancy landing page and hype video .

The History

The origins of command bars go back to 200521ya when Apple released their Spotlight feature in MacOS 10.4 X Tiger. The update introduced a universal search bar you could launch by hitting CMD + Space. As part of the native operating system, it had access to every kind of file and function: documents, email messages, photos, settings, etc.

Spotlight in MacOS Tiger – Source: Anand Tech

Spotlight is still a core feature of Mac today and set many of the standards for other command bars to copy.

Spotlight on MacOS Monterey (2022)

Independent developers swooped in to build advanced versions of Spotlight and application launchers for Mac. Quicksilver was one of the earliest ones

The plugin Sketch runner added a CLI experience on top of the once-popular design platform Sketch .

The sketch runner command bar

References and Further Reading

联系我们 contact @ memedata.com