MOBILE_UX.md (6734B)
1 # Mobile UX (Draft) 2 3 This doc proposes a mobile-first UX that stays consistent with Bzl’s modular “everything is a panel” direction, without trying to squeeze desktop racks onto a phone. 4 5 ## Goals 6 7 - Mobile feels **intentional** (not a scaled-down desktop). 8 - Keep the modular mental model: **surfaces are registered modules** (core + plugins). 9 - Fast access to the few things you use constantly (Hives / Chat / People / Maps). 10 - Works for both **small phones** and **odd aspect ratios**. 11 - Supports moderator-only surfaces without breaking non-mod UX. 12 13 ## Non-goals (MVP) 14 15 - Full rack / multi-column layout on mobile. 16 - Drag-and-drop panel layout editing. 17 - Multi-window / splits. 18 - Perfect parity with every desktop feature (we’ll ship in phases). 19 20 ## Core idea: **Screens**, not racks 21 22 On mobile, the primary constraint isn’t layout; it’s attention and space. 23 24 So mobile becomes a **single active screen** at a time (full-height), plus: 25 26 - A **bottom nav** for pinned screens 27 - A **More** drawer/sheet for everything else 28 - **Overlays** (bottom sheet / fullscreen modal) for transient flows 29 30 We still preserve modularity by keeping the registration model the same: 31 32 - Desktop: panels can be docked and arranged in racks 33 - Mobile: the same panel ids become **screens** or **tools** 34 35 ## Terminology 36 37 - **Screen**: a full-height mobile surface (Hives feed, Chat, People, Maps, Library, Instance, Moderation). 38 - **Tool**: a smaller surface shown as an overlay (Profile, Composer, Plugin Rack). 39 - **Pinned**: a screen shown in bottom nav. 40 - **More**: the place you can find and open any available surface. 41 42 ## Information architecture 43 44 ### Bottom nav (pinned screens) 45 46 Default (non-mod): 47 - Hives 48 - Chat 49 - People 50 - Maps (if installed) or Library 51 - More 52 53 Default (mod): 54 - Hives 55 - Chat 56 - Moderation 57 - People 58 - More 59 60 Rules: 61 - Max **4 pinned** + **More**. 62 - Long-press (or Edit mode) to reorder / replace pinned. 63 - Pinned screens show optional badges (unread / mention). 64 65 ### More sheet 66 67 “More” opens a sheet with: 68 - A searchable list of **all available surfaces** 69 - Grouping: 70 - Core 71 - Plugins 72 - Tools (overlays) 73 - Moderation (mods only) 74 - Docked/hidden items (desktop hotbar equivalent) live here too on mobile. 75 76 ## Interaction model 77 78 ### Navigation 79 80 - Tap a pinned icon → opens that screen. 81 - Tap “More” → opens the surface list sheet. 82 - Tap a surface in “More” → opens that screen (or tool overlay). 83 84 ### Back behavior 85 86 Recommended behavior: 87 - Hardware back / top-left back: 88 - If a tool overlay is open → close it. 89 - Else if the More sheet is open → close it. 90 - Else → go to previous screen in history (small stack), otherwise do nothing. 91 92 ### Chat thread selection 93 94 Mobile should avoid spawning multiple chat instances by default. 95 96 - Tapping “Chat” on a hive post: 97 - If Chat screen is open and empty → fill it. 98 - Else → switch Chat screen to the requested thread. 99 - Advanced: optional “multi-chat” power mode can still exist, but mobile default should be **single chat context**. 100 101 ### Transient flows as overlays 102 103 These should not “steal” the whole navigation permanently: 104 105 - **Composer**: bottom sheet on phones; fullscreen on very small viewports. 106 - **Profile**: fullscreen modal (with its own internal scroll). 107 - **Plugin Rack**: fullscreen modal or tall bottom sheet depending on content. 108 109 ## Layout rules (responsive) 110 111 We should not assume desktop-like columns. 112 113 Mobile containers should: 114 - Use `min-width: 0` everywhere 115 - Avoid fixed widths; rely on `%`, `clamp()`, and container constraints 116 - Prefer vertical stacking and bottom sheets 117 118 ### Implementation notes (current) 119 120 - Mobile screen mode currently activates on **narrow viewports** (`max-width: 760px`) and on **touch-first devices** (coarse pointer) up to a wider threshold (including landscape phones). 121 - Bottom navigation is a fixed bar that is constrained to the viewport width; buttons flex and will ellipsize labels on very small screens. 122 123 ## State model (MVP) 124 125 Persist as JSON in `localStorage` (per user/device) under something like `bzl_mobile_layout_v1`: 126 127 ```json 128 { 129 "version": 1, 130 "pinned": ["hives", "chat", "people", "maps"], 131 "active": "hives", 132 "history": ["hives", "chat"], 133 "tools": { 134 "composerOpen": false, 135 "profileOpen": false, 136 "pluginRackOpen": false 137 } 138 } 139 ``` 140 141 Notes: 142 - Missing panels should be ignored safely (plugin removed). 143 - If a pinned panel isn’t available, substitute a reasonable fallback. 144 - Moderation only appears if the user can moderate. 145 146 ## Mapping desktop panels → mobile behavior 147 148 Recommended defaults: 149 150 - Primary/core screens: 151 - `hives` → screen 152 - `chat` → screen 153 - `people` → screen 154 - `maps` → screen (if installed) 155 - `library` → screen 156 - `instance` → screen (maybe inside More) 157 - `moderation` → screen (mods only) 158 159 - Tools (overlays): 160 - `profile` → tool overlay 161 - `composer` → tool overlay 162 - `pluginRack` → tool overlay 163 164 ## Plugin integration (draft) 165 166 Plugins already register panels; mobile needs one extra hint so we don’t overwhelm “More” or pin tool-like widgets by default. 167 168 Proposed addition to `ctx.ui.registerPanel()` (draft): 169 170 ```js 171 ctx.ui.registerPanel({ 172 id: "radio", 173 title: "Radio", 174 defaultRack: "main", 175 role: "utility", 176 mobileHint: "tool" // "screen" | "tool" | "hidden" 177 }); 178 ``` 179 180 Defaults: 181 - `role: "primary"` → `mobileHint: "screen"` 182 - everything else → `mobileHint: "tool"` 183 184 ## Phased implementation plan 185 186 ### Phase 1: Mobile shell + core screens 187 188 - Add a mobile UI shell: `ScreenHost`, bottom nav, More sheet. 189 - Implement navigation + persistence (`pinned`, `active`, basic history). 190 - Hook up the core screens: 191 - Hives, Chat, People, Instance 192 - Maps/Library if installed 193 - Moderation for mods 194 195 Acceptance: 196 - Works on small phone widths without horizontal overflow. 197 - Can switch between Hives/Chat/People quickly. 198 199 ### Phase 2: Tools as overlays 200 201 - Composer as a bottom sheet / fullscreen modal (viewport-dependent). 202 - Profile as fullscreen modal. 203 - Plugin Rack as tool overlay (stacking widgets inside). 204 205 Acceptance: 206 - Tools open/close cleanly and don’t break navigation. 207 208 ### Phase 3: Polishing + badges + shortcuts 209 210 - Unread / mention badges in bottom nav and More list. 211 - Search in More. 212 - “Edit pinned” mode. 213 214 Acceptance: 215 - Users can tailor bottom nav to their usage. 216 217 ## Open questions 218 219 - Should mobile share “layout presets”, or is pinned nav personalization enough? 220 - Should plugin widgets be allowed as pinned screens, or restricted to tools by default? 221 - Do we want a “focus mode” (hide nav bar while scrolling, reveal on tap)? 222 - How do we handle Maps + associated chat (global/local) on small screens (tab within chat vs inline on map)?