openfreebooks-bookgenerator/.agents/skills/microinteractions/references/loops-modes.md

14 KiB

Loops and Modes in Microinteractions

Loops and modes are the long-term behavior of microinteractions. While triggers, rules, and feedback handle the moment-to-moment experience, loops and modes determine how an interaction evolves over time and how it adapts to different contexts. They are the mechanism for making microinteractions feel alive -- growing with the user, adapting to behavior, and avoiding stagnation.

Understanding Loops

A loop is a cycle that a microinteraction goes through repeatedly. The key question is: what happens when the microinteraction is triggered again? Does it behave the same way? Does it adapt? Does it expire?

Open Loops vs. Closed Loops

Type Behavior Ends When Example
Open loop Repeats indefinitely until manually stopped User or system explicitly stops it Repeating alarm clock, auto-save every 5 minutes
Closed loop Runs a fixed number of times or for a fixed duration Completion condition is met Countdown timer (reaches zero), 3-retry limit

Designing Open Loops

Open loops run continuously and need careful management to avoid becoming annoying or resource-wasteful.

Design considerations:

Consideration Guideline Example
Frequency Match repetition rate to user need Auto-save: every 30 seconds, not every second
Visibility Show loop status without being intrusive Small "Last saved: 2 min ago" text in footer
Control Let users adjust or stop the loop Toggle to enable/disable auto-save; frequency setting
Resource impact Minimize battery, network, and CPU usage Poll for updates every 60s, not every second; use WebSockets when available
Failure handling Degrade gracefully if a cycle fails Skip failed auto-save; retry next cycle; show warning after 3 failures

Designing Closed Loops

Closed loops have a natural endpoint. The design challenge is communicating progress and handling completion.

Design considerations:

Consideration Guideline Example
Progress Show how far along the loop is "Attempt 2 of 3" or progress ring
Completion Clear signal when loop ends Timer reaches 00:00 with sound/vibration
Early exit Allow cancellation before completion "Cancel" button on countdown timer
End state Define what happens after the last cycle Timer shows "Done!" with dismiss action
Failure to complete Handle cases where loop cannot finish "Max retries reached. Try again manually."

Long Loops: Behavior Over Time

Long loops are the most powerful -- and most neglected -- aspect of microinteraction design. A long loop asks: how should this microinteraction behave differently the 100th time compared to the first time?

Progressive Reduction

Progressive reduction means removing scaffolding as users demonstrate mastery. The microinteraction starts helpful and becomes streamlined.

Use Count Behavior Rationale
1-3 uses Full labels, tooltips, coaching marks User is learning
4-10 uses Labels remain, tooltips disappear User recognizes patterns
11-50 uses Labels shrink to icons, hints removed User knows the interface
50+ uses Icons only, keyboard shortcuts promoted User is an expert

Implementation strategies:

Strategy Mechanism Example
Use counter Track trigger count per user After 5 uses, hide "swipe to delete" tooltip
Time-based Track days since first use After 7 days, collapse onboarding sidebar
Behavior-based Detect user competence from actions If user uses keyboard shortcut 3 times, hide toolbar button label
Explicit Let user dismiss scaffolding "Got it, don't show again" link on tooltip

Adaptive Long Loops

Adaptive loops change the microinteraction based on accumulated user behavior patterns.

Adaptation What Changes Example
Smart defaults Default values shift to match user's typical input Email compose defaults to the team the user writes to most
Frequency adjustment How often the interaction triggers or repeats Notification frequency decreases if user ignores 5 in a row
Content personalization What content appears in the interaction Search autocomplete prioritizes user's past searches
Complexity scaling Simpler version for new users, richer for experts Photo editor shows basic controls by default, reveals advanced on demand
Suggestion refinement Predictions improve with use Keyboard autocorrect learns from user's vocabulary

Long Loop Design Principles

1. Never degrade core functionality. Progressive reduction should remove scaffolding, not features. The base action must always work.

2. Provide a way back. If a tooltip was hidden after 10 uses, provide a "?" icon or help menu to resurface it.

3. Track per-feature, not globally. A user who is expert at one feature may be a beginner at another. Track usage at the microinteraction level.

4. Avoid the uncanny valley. If the system adapts based on behavior, the changes should either be invisible (smart defaults) or transparent (explicit recommendations). Half-visible adaptation feels creepy.

5. Test the 100th use. Most designers test the first use. Few test the 100th. Run the complete interaction 100 times and evaluate: does it still feel right? Is there unnecessary friction for an expert?


Understanding Modes

A mode is a temporary state where the same trigger produces a different result. In edit mode, clicking a paragraph selects it for editing. In view mode, clicking the same paragraph does nothing (or follows a link). Modes are powerful but dangerous.

Why Modes Are Dangerous

Problem Description Real-World Example
Mode error User performs the right action in the wrong mode Typing when Caps Lock is on; drawing when in eraser mode
Mode confusion User does not know which mode they are in Editing a live document thinking it is a draft
Mode amnesia User forgets they entered a mode Left phone in Do Not Disturb; missed urgent calls
Action inconsistency Same trigger does different things Click selects text in edit mode, follows link in view mode

When Modes Are Justified

Despite their dangers, modes are sometimes the right design choice:

Justification Why It Works Example
Physical constraints Limited input controls must serve multiple functions Caps Lock/Shift on keyboard (limited key count)
Separation of concerns Editing and viewing are fundamentally different activities Google Docs edit mode vs. suggestion mode vs. view mode
Safety Prevent accidental destructive actions in normal use "Edit mode" in CMS protects published content
Complexity management Different tasks need different tool sets Photoshop tools: brush, eraser, selection, text

Mode Design Guidelines

1. Make the current mode unmistakably visible.

Method Where to Apply Example
Color-coded background Entire screen or workspace Yellow tint in edit mode
Persistent banner Top of screen "You are editing this page" banner
Tool indicator Near cursor or toolbar Active tool highlighted in toolbar; cursor changes shape
Mode label Status bar or header "DRAFT" / "PUBLISHED" / "EDITING" label

2. Make mode transitions deliberate. Entering and exiting a mode should require a conscious action (button click, keyboard shortcut), not happen accidentally (hover, proximity).

3. Minimize the number of modes. Every mode doubles the testing surface. Two modes mean 2x testing. Five modes mean 5x.

Number of Modes Complexity Guidance
1 (no modes) Low Ideal -- same action always produces same result
2 Moderate Acceptable for clear binary states (edit/view)
3 High Reconsider -- can you merge or eliminate one?
4+ Very high Almost certainly too many; redesign with fewer modes

4. Provide mode escape. Users must always have a clear, obvious way to exit a mode. The escape route should be visible at all times while in the mode.

Escape Method Implementation Example
Explicit button "Done," "Exit," "Close" button visible in mode "Done Editing" button in top-right
Keyboard shortcut Escape key exits mode Esc exits full-screen mode
Timeout Mode auto-exits after inactivity Edit mode locks after 15 minutes idle
Gesture Swipe down or pinch to dismiss Swipe down exits full-screen image view

Avoiding Mode Errors

Mode errors occur when users perform the correct action in the wrong mode. They are one of the most frustrating user experiences because users did the right thing -- the system responded wrong.

Prevention Strategies

Strategy How It Works Example
Spring-loaded modes Mode exists only while holding trigger Caps Lock as long as Shift is held (not toggled)
Undo on mode exit Offer to undo all actions on mode exit "Discard changes?" dialog when exiting edit mode
Mode confirmation Show a brief confirmation when entering mode "Edit mode" banner flashes for 2 seconds on entry
Preemptive warning Warn before an action that depends on mode "You are in eraser mode. Switch to pen to draw."
Eliminate the mode Use a different UI pattern instead Instead of "edit mode," use inline editing with pencil icon per field

Spring-Loaded Modes

Spring-loaded modes (also called quasi-modes) are temporary: they exist only while the user holds a trigger. When the trigger is released, the mode exits automatically. This eliminates mode amnesia because the user is physically reminded of the mode through the held action.

Spring-Loaded Mode Trigger Exits When Example
Shift for uppercase Hold Shift key Release Shift Typing uppercase letters
Space for preview Hold Space bar Release Space macOS Quick Look preview
Drag for reorder Hold and drag Release finger/mouse iOS home screen icon reordering
Alt for alternate Hold Alt/Option key Release Alt Alternate toolbar functions

Loop and Mode Combinations

Loops and modes can interact. A mode might change the loop behavior, or a loop might trigger a mode transition.

Common Combinations

Pattern How It Works Example
Mode-specific loop Loop behavior differs by mode Do Not Disturb mode: notification loop suppressed
Loop triggers mode After N repetitions, mode changes After 3 failed login attempts, account enters "locked" mode
Mode affects loop frequency Mode changes loop timing "Focus mode" reduces notification frequency from real-time to hourly
Loop exits mode After timeout, mode reverts Screen dims to sleep mode after inactivity loop

Real-World Loop and Mode Examples

Alarm Clock

Aspect Design
Loop type Open loop: repeats at same time until disabled
Long loop After 3 snoozes, snooze interval shortens (2nd: 9 min, 3rd: 5 min)
Mode Snooze mode: alarm is temporarily silenced
Mode indicator "Snoozing until 7:09 AM" displayed on screen
Mode escape "Stop" button always visible alongside "Snooze"

Text Editor (Google Docs)

Aspect Design
Loop type Auto-save open loop: saves every few seconds while editing
Long loop Saves become less frequent during periods of no edits
Modes Editing, Suggesting, Viewing
Mode indicator Mode selector dropdown + colored cursor (blue = editing, green = suggesting)
Mode escape Mode selector always visible in toolbar

Smart Thermostat (Nest)

Aspect Design
Loop type Temperature check loop: every 5 minutes
Long loop Learns schedule over 2 weeks; adapts set-points automatically
Modes Home, Away, Eco, Manual override
Mode indicator Leaf icon (eco), "Away" text, temperature display
Mode escape Manual adjustment exits Away/Eco mode immediately

Notification System

Aspect Design
Loop type Open loop: checks for new notifications at interval
Long loop Reduces frequency if user ignores notifications consistently
Modes Normal, Do Not Disturb, Focus
Mode indicator DND icon in status bar, banner at top of notification panel
Mode escape Toggle in control center; scheduled auto-exit

Loop and Mode Checklist

Loops

  • Is this an open or closed loop? Is that the right choice?
  • For open loops: can users stop or adjust the loop?
  • For closed loops: is progress shown? What happens at completion?
  • Have you designed the long loop (behavior at 1st, 10th, 100th use)?
  • Does the interaction use progressive reduction for experienced users?
  • Can users resurface removed scaffolding if they need help?
  • Is loop frequency appropriate for user need and system resources?

Modes

  • Is a mode necessary, or can you avoid it entirely?
  • Is the current mode visible at all times?
  • Is mode entry deliberate (not accidental)?
  • Is there an obvious, always-visible escape from every mode?
  • Have you tested for mode errors (right action, wrong mode)?
  • Could you use a spring-loaded mode instead of a toggle mode?
  • Is the total number of modes three or fewer?