Spaces:
Sleeping
Sleeping
File size: 15,119 Bytes
16a929f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 | # Web UI Visual Guide
## Interface Layout
```
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ποΈ AI Personas for Urban Planning β
β Explore diverse stakeholder perspectives on urban planning β
β βββββββββββββββββββββββββββββββββββββββββ¦ββββββββββββββββββββββββββββββββββββ£
β β π₯ Select a Persona β
β π¬ Conversation β Click to start conversation β
β ββββββββββββββββββββββββββββββββββ β β
β β Currently talking with: β β βββββββββββββββββββββββββββ β
β β π± Sarah Chen (Urban Planner) β β β π± β β
β ββββββββββββββββββββββββββββββββββ β β Sarah Chen β β
β β β Urban Planner β β
β ββββββββββββββββββββββββββββββββββ β βProgressive, sustainabilityβ β
β β Your question: ________________β β βββββββββββββββββββββββββββ β
β β [Send] β β β
β ββββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββ β
β β β πͺ β β
β π‘ Try asking: β β Marcus Thompson β β
β ββββββββββββββββββββ βββββββββββββββ β β Business Owner β β
β β What's most β β Should we β β β Pragmatic, economy-first β β
β β important issue? β β allow food β β βββββββββββββββββββββββββββ β
β ββββββββββββββββββββ βββββββββββββββ β β
β ββββββββββββββββββββ βββββββββββββββ β βββββββββββββββββββββββββββ β
β β How to make city β β Affordable β β β π β β
β β sustainable? β β housing? β β β Dr. Elena Rodriguez β β
β ββββββββββββββββββββ βββββββββββββββ β βTransportation Engineer β β
β β β Data-driven, safety-firstβ β
β βββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββ β
β β β
β π Conversation History β βββββββββββββββββββββββββββ β
β β β π‘ β β
β ββββββββββββββββββββββββββββββββββ β β James O'Brien β β
β β π You: β β β Long-time Resident β β
β β What do you think about the β β βTraditional, community- β β
β β bike lane proposal? β β β focused β β
β ββββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββ β
β β π± Sarah Chen: β β β β β β
β β I strongly support this bike β β β Priya Patel β β
β β lane proposal. As an urban β β β Housing Advocate β β
β β planner focused on β β β Activist, equity-focused β β
β β sustainability, I believe this β β βββββββββββββββββββββββββββ β
β β aligns perfectly with our β β β
β β climate goals. The data shows β β βββββββββββββββββββββββββββ β
β β protected bike lanes reduce... β β β π’ β β
β ββββββββββββββββββββββββββββββββββ β β David Kim β β
β β β Real Estate Developer β β
β ββββββββββββββββββββββββββββββββββ β βMarket-driven, growth- β β
β β ποΈ Clear Conversation β β β oriented β β
β ββββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββββββββ©ββββββββββββββββββββββββββββββββββββ£
β AI Personas β’ Phase 1 β’ Powered by Claude 3 Haiku β’ View Code β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## Key Features Illustrated
### 1. Persona Cards (Right Panel)
Each persona card shows:
- **Avatar emoji** - Visual identifier (π± πͺ π π‘ β π’)
- **Name** - Full name of the persona
- **Role** - Their professional or community role
- **Tagline** - Brief description of their perspective
**Selected State:**
- Cards highlight when selected (blue border)
- Button turns to "primary" style
- Name appears in conversation header
### 2. Conversation Area (Left Panel - Top)
**Currently Talking With Banner:**
```
ββββββββββββββββββββββββββββββββββ
β Currently talking with: β
β π± Sarah Chen (Urban Planner) β
ββββββββββββββββββββββββββββββββββ
```
Shows who you're conversing with.
**Question Input:**
```
ββββββββββββββββββββββββββββββββββ
β Your question: [Type here...] β
β [Send] β
ββββββββββββββββββββββββββββββββββ
```
- Text input field for questions
- Placeholder text guides the user
- Send button to submit
### 3. Quick Suggestions (Left Panel - Middle)
```
π‘ Try asking:
ββββββββββββββββββββ βββββββββββββββ
β What's most β β Should we β
β important issue? β β allow food β
ββββββββββββββββββββ βββββββββββββββ
```
Four pre-written questions to get started:
- Click any button to auto-fill the question
- Helpful for first-time users
- Demonstrates good question types
### 4. Conversation History (Left Panel - Bottom)
**User Messages (Blue):**
```
ββββββββββββββββββββββββββββββββββ
β π You: β
β What do you think about the β
β bike lane proposal? β
ββββββββββββββββββββββββββββββββββ
```
**Persona Responses (Gray):**
```
ββββββββββββββββββββββββββββββββββ
β π± Sarah Chen: β
β I strongly support this bike β
β lane proposal... β
ββββββββββββββββββββββββββββββββββ
```
**Clear Button:**
```
ββββββββββββββββββββββββββββββββββ
β ποΈ Clear Conversation β
ββββββββββββββββββββββββββββββββββ
```
Resets the conversation for a fresh start.
## User Flow
### First Visit
```
1. User lands on page
β
2. Sees 6 persona cards on right
β
3. Sees "Select a persona" message on left
β
4. Clicks on a persona (e.g., Sarah Chen)
β
5. Persona card highlights
β
6. Left panel shows "Currently talking with Sarah Chen"
β
7. User sees quick suggestions
β
8. Clicks suggestion or types question
β
9. Clicks Send button
β
10. "π Sarah Chen is thinking..." appears
β
11. Response appears in conversation history
β
12. User can ask follow-up or switch persona
```
### Switching Personas
```
1. User clicks different persona (e.g., Marcus)
β
2. Previous persona card unhighlights
β
3. New persona card highlights
β
4. Conversation history clears
β
5. Banner updates to show Marcus Thompson
β
6. User can start new conversation
```
## Color Coding
Each persona has a unique color theme:
- **π± Sarah Chen**: Green (#4CAF50) - Sustainability
- **πͺ Marcus Thompson**: Orange (#FF9800) - Business/Commerce
- **π Elena Rodriguez**: Blue (#2196F3) - Technical/Engineering
- **π‘ James O'Brien**: Brown (#795548) - Traditional/Established
- **β Priya Patel**: Pink (#E91E63) - Activism/Energy
- **π’ David Kim**: Gray (#607D8B) - Professional/Corporate
## Responsive Design
### Desktop (Wide Screen)
```
βββββββββββββββββββββββββββ¬ββββββββββββ
β β Personas β
β Conversation β Cards β
β (2/3 width) β (1/3 width)β
βββββββββββββββββββββββββββ΄ββββββββββββ
```
### Tablet (Medium Screen)
```
βββββββββββββββββββββββββββ¬ββββββ
β β P β
β Conversation β e β
β β r β
β β s β
βββββββββββββββββββββββββββ΄ββββββ
```
### Mobile (Narrow Screen)
```
βββββββββββββββββ
β Conversation β
β β
βββββββββββββββββ
βββββββββββββββββ
β Persona Cards β
β (Stacked) β
βββββββββββββββββ
```
## Interactive Elements
### Buttons
**Persona Selection Buttons:**
- Hover: Slight lift effect (translateY)
- Selected: Primary color, bold border
- Unselected: Secondary color, subtle border
**Send Button:**
- Full width of container
- Primary color
- Bold text
- 3rem height for easy clicking
**Suggestion Buttons:**
- Two columns layout
- Full width of container
- Secondary color
- Fills input when clicked
**Clear Conversation:**
- Full width
- Warning/destructive action style
- Icon + text label
### Input Field
**Text Input:**
- Placeholder: "e.g., What do you think about..."
- Auto-focus when page loads
- Enter key submits
- Clears after sending
### Loading States
**Thinking Indicator:**
```
π Sarah Chen is thinking...
```
Shows while waiting for API response.
**System Initialization:**
```
π§ Initializing AI Personas system...
```
Shows on first page load.
## Accessibility Features
- **Keyboard Navigation**: Tab through all interactive elements
- **Screen Reader Support**: Semantic HTML with ARIA labels
- **High Contrast**: Text meets WCAG AA standards
- **Focus Indicators**: Visible keyboard focus states
- **Clear Labels**: All buttons have descriptive text
## Tips for Best Experience
### 1. Large Screen Recommended
- Best viewed on desktop or tablet (β₯1024px width)
- Mobile works but cards may stack vertically
### 2. Modern Browser
- Chrome, Firefox, Safari, Edge (recent versions)
- JavaScript must be enabled
### 3. Stable Internet
- Responses require API calls
- 2-5 seconds per response
### 4. Clear Conversation
- Click "Clear Conversation" before switching topics
- Or switch personas for fresh start
## Comparison: CLI vs. Web UI
| Feature | CLI (`src.cli`) | Web UI (`web_app.py`) |
|---------|-----------------|----------------------|
| **Visual** | Text-only | Rich visual interface |
| **Personas** | Text list | Emoji avatars + cards |
| **History** | Scrolling text | Formatted chat boxes |
| **Input** | Command prompt | Text field with Send button |
| **Suggestions** | None | Quick-click buttons |
| **Selection** | Type persona ID | Click card |
| **Mobile** | Terminal only | Web browser |
| **Learning curve** | Higher | Lower |
| **Power user** | Better for scripts | Better for exploration |
## Future Enhancements
Planned improvements:
- [ ] Export conversation to PDF
- [ ] Dark mode toggle
- [ ] Voice input/output
- [ ] Multi-persona comparison (split view)
- [ ] Conversation templates
- [ ] Mobile app version
- [ ] Real-time typing indicators
- [ ] Emoji reactions to responses
- [ ] Save/load conversations
- [ ] Share conversation links
---
**The Web UI makes exploring personas intuitive, visual, and engaging! π¨**
|