Designing GNOME UI
Design GNOME UIs that are HIG-compliant, polished, and user-centered.
Core principle: No UI code without design decisions. Pattern selection and quality verification happen before implementation.
Quality layers: Compliance (follows HIG) → Polish (feels premium) → Rigor (handles edge cases)
Companion skill: For app architecture (lifecycle, threading, GSettings, actions, packaging), use developing-gtk-apps.
What's New (libadwaita 1.6-1.8)
| Need |
Widget/API |
Notes |
| Exclusive toggles (view mode) |
AdwToggleGroup |
Replaces multiple GtkToggleButton |
| Loading indicator |
AdwSpinner |
Works with animations disabled |
| Persistent bottom controls |
AdwBottomSheet |
Music player, persistent actions |
| Wrapping content (tags) |
AdwWrapBox |
Auto-wraps like text |
| Inline view switching |
AdwInlineViewSwitcher |
For cards, sidebars |
| Keyboard shortcuts |
AdwShortcutsDialog |
Replaces deprecated GtkShortcutsWindow |
| System accent color |
Automatic |
Apps follow desktop preference via portal |
| System fonts |
AdwStyleManager |
Access monospace/document fonts |
Deprecations: .dim-label → use .dimmed class
# AdwToggleGroup - view mode switching
toggle_group = Adw.ToggleGroup()
toggle_group.add(Adw.Toggle(icon_name="view-grid-symbolic", name="grid"))
toggle_group.add(Adw.Toggle(icon_name="view-list-symbolic", name="list"))
toggle_group.connect("notify::active-name", lambda g, p: set_view(g.get_active_name()))
header.pack_start(toggle_group)
# AdwBottomSheet - music player controls
bottom_sheet = Adw.BottomSheet()
bottom_sheet.set_content(main_content)
bottom_sheet.set_sheet(player_controls)
bottom_sheet.set_open(True) # Show sheet
window.set_content(bottom_sheet)
# AdwWrapBox - tag display
wrap_box = Adw.WrapBox(spacing=6)
for tag in ["Python", "GTK", "GNOME", "libadwaita"]:
chip = Gtk.Label(label=tag)
chip.add_css_class("chip") # Custom styling
wrap_box.append(chip)
# System fonts (1.7+) - for code editors, document views
style_manager = Adw.StyleManager.get_default()
mono_font = style_manager.get_monospace_font_name() # User's preferred mono font
doc_font = style_manager.get_document_font_name() # User's preferred document font
# Also available as CSS: --monospace-font-family, --document-font-family
The Process
digraph gnome_ui_process {
rankdir=LR;
node [shape=box];
"UI Task" -> "1. Context" -> "2. Patterns" -> "3. Details" -> "4. Checklist" -> "Implement";
"4. Checklist" -> "2. Patterns" [label="issues" style=dashed];
}
- Context: User goal, app type, constraints (screen size, input)
- Patterns: Select containers, navigation, controls, feedback
- Details: Typography, spacing, icons, writing style
- Checklist: Verify compliance, polish, rigor before code
Container Selection
digraph containers {
rankdir=TB;
node [shape=box];
"Building what?" [shape=diamond];
"AdwApplicationWindow + HeaderBar" [style=filled fillcolor=lightgreen];
"AdwPreferencesWindow" [style=filled fillcolor=lightgreen];
"AdwDialog" [style=filled fillcolor=lightgreen];
"Building what?" -> "AdwApplicationWindow + HeaderBar" [label="main window"];
"Building what?" -> "AdwPreferencesWindow" [label="settings"];
"Building what?" -> "AdwDialog" [label="modal action"];
}
| Scenario |
Default |
Notes |
| App window |
AdwApplicationWindow + AdwHeaderBar |
Remember user size, start ~800x600 |
| Settings |
AdwPreferencesWindow |
Handles groups, search, subpages |
| List of items |
AdwPreferencesGroup with rows |
Boxed list style |
| Primary action |
Single button, header bar end |
suggested-action class if emphasized |
| Destructive action |
destructive-action class |
Requires undo or confirmation |
Navigation Selection
| Structure |
Default Pattern |
| Single view |
None needed |
| 2-4 views |
AdwViewSwitcher in header bar |
| Many/dynamic views |
AdwNavigationSplitView (sidebar) |
| Hierarchical |
AdwNavigationView (drill-down) |
Control Defaults
| Need |
Default |
Avoid |
| On/Off |
AdwSwitchRow |
Checkbox for settings |
| Choose one (few) |
AdwComboRow |
Radio buttons outside dialogs |
| Choose one (many) |
AdwComboRow + search |
Long unsearchable dropdowns |
| Text input |
AdwEntryRow |
Bare GtkEntry |
| Multiline text |
GtkTextView + card class |
Bare unstyled text view |
| Number |
AdwSpinRow |
Text entry for numbers |
| Date |
GtkCalendar in popover |
Text entry for dates |
| Action in list |
AdwActionRow + suffix button |
Multiple buttons per row |
| Search |
GtkSearchBar + toggle button |
Always-visible search box |
Search Bar Pattern
# Search bar slides down from header, toggle with button or Ctrl+F
search_bar = Gtk.SearchBar()
search_entry = Gtk.SearchEntry()
search_bar.set_child(search_entry)
search_bar.connect_entry(search_entry)
search_bar.set_key_capture_widget(window) # Type-to-search
# Toggle button in header bar
search_btn = Gtk.ToggleButton(icon_name="system-search-symbolic")
search_btn.set_tooltip_text("Search")
search_bar.bind_property("search-mode-enabled", search_btn, "active",
GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE)
header.pack_end(search_btn)
toolbar_view.add_top_bar(search_bar)
Form Validation Pattern
# Use error CSS class on invalid fields
def validate_entry(row):
text = row.get_text()
if not text or len(text) < 3:
row.add_css_class("error")
row.set_tooltip_text("Name must be at least 3 characters")
return False
row.remove_css_class("error")
row.set_tooltip_text("")
return True
name_row.connect("changed", lambda r: validate_entry(r))
Validation timing: On change for format checks, on focus-out for expensive checks, on submit for final validation.
List Widget Selection
| Content |
Widget |
Why |
| Settings/preferences |
AdwPreferencesGroup |
Boxed list style, handles rows |
| Navigation list (sidebar) |
GtkListBox |
Selection support, activatable rows |
| Large/dynamic data |
GtkListView |
Virtual scrolling, performance |
| Grid of items |
GtkGridView |
Thumbnail grids, icon views |
Selection modes: Use Gtk.SingleSelection for navigation, Gtk.MultiSelection for bulk actions. Toggle selection mode with header bar button + action bar for bulk operations. See reference for code patterns.
Iconography
Rules:
- Symbolic icons only (outline, monochrome) - never full-color in UI
- Source from GNOME Icon Library (
icon-library app)
- Header bar: icon-only buttons, always add tooltips
- Naming:
action-object-symbolic (e.g., list-add-symbolic)
- Dynamic icons: Update icon name based on state (e.g.,
user-trash-symbolic → user-trash-full-symbolic)
| Action |
Icon |
| Add/New |
list-add-symbolic |
| Delete |
user-trash-symbolic |
| Settings |
emblem-system-symbolic |
| Menu |
open-menu-symbolic |
| Search |
system-search-symbolic |
| Edit |
document-edit-symbolic |
| Back |
go-previous-symbolic |
| Drill-down |
go-next-symbolic |
| Sync |
emblem-synchronizing-symbolic |
| Offline |
network-offline-symbolic |
| Warning |
dialog-warning-symbolic |
| Error |
dialog-error-symbolic |
| Select mode |
selection-mode-symbolic |
| Check/Done |
emblem-ok-symbolic |
| Close |
window-close-symbolic |
| Refresh |
view-refresh-symbolic |
Feedback Selection
digraph feedback {
rankdir=TB;
node [shape=box];
"What happened?" [shape=diamond];
"Transient or persistent?" [shape=diamond];
"AdwToast" [style=filled fillcolor=lightgreen label="AdwToast (default)"];
"AdwBanner" [style=filled fillcolor=lightyellow];
"AdwDialog" [style=filled fillcolor=lightpink];
"Progress/Spinner" [style=filled fillcolor=lightblue];
"What happened?" -> "Transient or persistent?" [label="state/error"];
"What happened?" -> "AdwDialog" [label="needs decision"];
"What happened?" -> "Progress/Spinner" [label="ongoing operation"];
"Transient or persistent?" -> "AdwToast" [label="transient event"];
"Transient or persistent?" -> "AdwBanner" [label="persistent state"];
}
| Scenario |
Default |
Details |
| Action done |
AdwToast |
Short message, optional undo |
| Destructive action |
AdwToast + undo |
Prefer over confirmation dialog |
| Error (recoverable) |
AdwToast |
Brief, auto-retry silently |
| Error (blocking) |
AdwDialog |
Explain problem and required fix |
| Persistent state |
AdwBanner |
Offline, degraded mode, auth required |
| Needs decision |
AdwDialog |
Conflicts, irreversible actions |
| Short wait (<5s) |
AdwSpinner |
No progress bar |
| Long operation (>30s) |
Progress bar + text |
"13 of 42 processed" |
Error escalation: Toast (transient) → Banner (persists) → Dialog (requires action)
- Network blip: Toast, auto-retry
- Prolonged offline: Banner with "Retry" button
- Auth expired: Dialog + Banner until resolved
Dialog rules:
- Cancel button first (left), action button last (right)
- Specific verbs ("Delete", "Save"), never "OK" or "Yes"
- Destructive actions use
destructive-action style
Context menus: Use GtkPopoverMenu for right-click actions (remove, rename, properties). Keep menus short; move complex actions to dialogs.
Empty State Pattern
# Show placeholder when list is empty
empty_state = Adw.StatusPage(
icon_name="folder-symbolic",
title="No Projects",
description="Create a project to get started"
)
create_btn = Gtk.Button(label="Create Project")
create_btn.add_css_class("pill")
create_btn.add_css_class("suggested-action")
empty_state.set_child(create_btn)
# Use stack to switch between list and empty state
stack.add_named(list_view, "content")
stack.add_named(empty_state, "empty")
stack.set_visible_child_name("empty" if model.get_n_items() == 0 else "content")
Quality Checklist
Create TodoWrite items for each applicable check before implementing.
Layer 1: Compliance
Layer 2: Polish
Layer 3: Rigor
Accessibility Quick Check
# Test high contrast
GTK_THEME=Adwaita:hc ./myapp
# Test large text (set in GNOME Settings > Accessibility first)
# Test with screen reader
orca &
./myapp
# Keyboard-only: unplug mouse, navigate entire app with Tab/Enter/Space
Code: Set accessible labels for icon-only buttons and images:
button.update_property([Gtk.AccessibleProperty.LABEL], ["Add new item"])
image.update_property([Gtk.AccessibleProperty.LABEL], ["Project thumbnail"])
Red Flags - STOP
- Custom styling where libadwaita has a pattern
- Multiple "suggested" or "destructive" buttons per view
- Confirmation dialogs for reversible actions (use undo)
- Text over images or textured backgrounds
- Non-GNOME icons without strong justification
- Missing tooltips on icon-only header bar buttons
- Generic labels ("OK", "Yes", "No", "Submit")
- Frozen UI during operations (missing loading states)
Non-GTK Apps (Qt/PySide6)
When styling Qt apps for GNOME:
- Use Adwaita-qt or manual QSS matching Adwaita colors
- Follow same patterns conceptually (header bar → toolbar, etc.)
- Match spacing, typography scale, and icon style
- Test alongside native GNOME apps for consistency
Reference Files
| Need |
File |
| Basic UI patterns |
gnome-hig-reference.md |
| Advanced patterns |
gnome-advanced-patterns.md |
gnome-hig-reference.md - Read for most apps:
- Container, navigation, control, feedback patterns with code
- Search bar, form validation, filter models, grid views, selection modes
- File chooser dialogs, dark/light mode, responsive breakpoints
- Primary menu structure, About dialog, Shortcuts window
- Typography, writing style, CSS color variables, common mistakes
- Accessibility testing commands (high contrast, screen reader)
- Phone/tablet breakpoints, adaptive layouts
gnome-advanced-patterns.md - Read when building:
- Drag & drop (reordering, file drops, cross-widget DnD)
- Undo/Redo (command pattern, history management)
- Tabs (AdwTabView, multi-document apps)
- System notifications (GNotification vs Toast)
- Media display (image viewers, video controls, pinch-to-zoom gestures)
- Split/Paned views (resizable panels)
- Welcome/Onboarding (first-run, feature callouts)
- Popovers (tool palettes, color pickers)
- Keyboard shortcuts (mnemonics, shortcut controllers)
1---
2name: designing-gnome-ui
3description: Use when designing, implementing, or modifying UI for GNOME apps; before writing UI code; when reviewing existing UI for HIG compliance; when working with GTK 4/libadwaita or styling Qt/PySide6 for GNOME
4metadata:
5 source: https://skillmd.com/skills/aibot88/designing-gnome-ui
6---
7
8# Designing GNOME UI
9
10Design GNOME UIs that are HIG-compliant, polished, and user-centered.
11
12**Core principle:** No UI code without design decisions. Pattern selection and quality verification happen before implementation.
13
14**Quality layers:** Compliance (follows HIG) → Polish (feels premium) → Rigor (handles edge cases)
15
16**Companion skill:** For app architecture (lifecycle, threading, GSettings, actions, packaging), use `developing-gtk-apps`.
17
18## What's New (libadwaita 1.6-1.8)
19
20| Need | Widget/API | Notes |
21|------|------------|-------|
22| Exclusive toggles (view mode) | `AdwToggleGroup` | Replaces multiple `GtkToggleButton` |
23| Loading indicator | `AdwSpinner` | Works with animations disabled |
24| Persistent bottom controls | `AdwBottomSheet` | Music player, persistent actions |
25| Wrapping content (tags) | `AdwWrapBox` | Auto-wraps like text |
26| Inline view switching | `AdwInlineViewSwitcher` | For cards, sidebars |
27| Keyboard shortcuts | `AdwShortcutsDialog` | Replaces deprecated `GtkShortcutsWindow` |
28| System accent color | Automatic | Apps follow desktop preference via portal |
29| System fonts | `AdwStyleManager` | Access monospace/document fonts |
30
31**Deprecations:** `.dim-label` → use `.dimmed` class
32
33```python
34# AdwToggleGroup - view mode switching
35toggle_group = Adw.ToggleGroup()
36toggle_group.add(Adw.Toggle(icon_name="view-grid-symbolic", name="grid"))
37toggle_group.add(Adw.Toggle(icon_name="view-list-symbolic", name="list"))
38toggle_group.connect("notify::active-name", lambda g, p: set_view(g.get_active_name()))
39header.pack_start(toggle_group)
40
41# AdwBottomSheet - music player controls
42bottom_sheet = Adw.BottomSheet()
43bottom_sheet.set_content(main_content)
44bottom_sheet.set_sheet(player_controls)
45bottom_sheet.set_open(True) # Show sheet
46window.set_content(bottom_sheet)
47
48# AdwWrapBox - tag display
49wrap_box = Adw.WrapBox(spacing=6)
50for tag in ["Python", "GTK", "GNOME", "libadwaita"]:
51 chip = Gtk.Label(label=tag)
52 chip.add_css_class("chip") # Custom styling
53 wrap_box.append(chip)
54
55# System fonts (1.7+) - for code editors, document views
56style_manager = Adw.StyleManager.get_default()
57mono_font = style_manager.get_monospace_font_name() # User's preferred mono font
58doc_font = style_manager.get_document_font_name() # User's preferred document font
59# Also available as CSS: --monospace-font-family, --document-font-family
60```
61
62## The Process
63
64```dot
65digraph gnome_ui_process {
66 rankdir=LR;
67 node [shape=box];
68
69 "UI Task" -> "1. Context" -> "2. Patterns" -> "3. Details" -> "4. Checklist" -> "Implement";
70 "4. Checklist" -> "2. Patterns" [label="issues" style=dashed];
71}
72```
73
741. **Context:** User goal, app type, constraints (screen size, input)
752. **Patterns:** Select containers, navigation, controls, feedback
763. **Details:** Typography, spacing, icons, writing style
774. **Checklist:** Verify compliance, polish, rigor before code
78
79## Container Selection
80
81```dot
82digraph containers {
83 rankdir=TB;
84 node [shape=box];
85
86 "Building what?" [shape=diamond];
87 "AdwApplicationWindow + HeaderBar" [style=filled fillcolor=lightgreen];
88 "AdwPreferencesWindow" [style=filled fillcolor=lightgreen];
89 "AdwDialog" [style=filled fillcolor=lightgreen];
90
91 "Building what?" -> "AdwApplicationWindow + HeaderBar" [label="main window"];
92 "Building what?" -> "AdwPreferencesWindow" [label="settings"];
93 "Building what?" -> "AdwDialog" [label="modal action"];
94}
95```
96
97| Scenario | Default | Notes |
98|----------|---------|-------|
99| App window | `AdwApplicationWindow` + `AdwHeaderBar` | Remember user size, start ~800x600 |
100| Settings | `AdwPreferencesWindow` | Handles groups, search, subpages |
101| List of items | `AdwPreferencesGroup` with rows | Boxed list style |
102| Primary action | Single button, header bar end | `suggested-action` class if emphasized |
103| Destructive action | `destructive-action` class | Requires undo or confirmation |
104
105## Navigation Selection
106
107| Structure | Default Pattern |
108|-----------|-----------------|
109| Single view | None needed |
110| 2-4 views | `AdwViewSwitcher` in header bar |
111| Many/dynamic views | `AdwNavigationSplitView` (sidebar) |
112| Hierarchical | `AdwNavigationView` (drill-down) |
113
114## Control Defaults
115
116| Need | Default | Avoid |
117|------|---------|-------|
118| On/Off | `AdwSwitchRow` | Checkbox for settings |
119| Choose one (few) | `AdwComboRow` | Radio buttons outside dialogs |
120| Choose one (many) | `AdwComboRow` + search | Long unsearchable dropdowns |
121| Text input | `AdwEntryRow` | Bare `GtkEntry` |
122| Multiline text | `GtkTextView` + `card` class | Bare unstyled text view |
123| Number | `AdwSpinRow` | Text entry for numbers |
124| Date | `GtkCalendar` in popover | Text entry for dates |
125| Action in list | `AdwActionRow` + suffix button | Multiple buttons per row |
126| Search | `GtkSearchBar` + toggle button | Always-visible search box |
127
128### Search Bar Pattern
129
130```python
131# Search bar slides down from header, toggle with button or Ctrl+F
132search_bar = Gtk.SearchBar()
133search_entry = Gtk.SearchEntry()
134search_bar.set_child(search_entry)
135search_bar.connect_entry(search_entry)
136search_bar.set_key_capture_widget(window) # Type-to-search
137
138# Toggle button in header bar
139search_btn = Gtk.ToggleButton(icon_name="system-search-symbolic")
140search_btn.set_tooltip_text("Search")
141search_bar.bind_property("search-mode-enabled", search_btn, "active",
142 GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE)
143header.pack_end(search_btn)
144toolbar_view.add_top_bar(search_bar)
145```
146
147### Form Validation Pattern
148
149```python
150# Use error CSS class on invalid fields
151def validate_entry(row):
152 text = row.get_text()
153 if not text or len(text) < 3:
154 row.add_css_class("error")
155 row.set_tooltip_text("Name must be at least 3 characters")
156 return False
157 row.remove_css_class("error")
158 row.set_tooltip_text("")
159 return True
160
161name_row.connect("changed", lambda r: validate_entry(r))
162```
163
164**Validation timing:** On change for format checks, on focus-out for expensive checks, on submit for final validation.
165
166## List Widget Selection
167
168| Content | Widget | Why |
169|---------|--------|-----|
170| Settings/preferences | `AdwPreferencesGroup` | Boxed list style, handles rows |
171| Navigation list (sidebar) | `GtkListBox` | Selection support, activatable rows |
172| Large/dynamic data | `GtkListView` | Virtual scrolling, performance |
173| Grid of items | `GtkGridView` | Thumbnail grids, icon views |
174
175**Selection modes:** Use `Gtk.SingleSelection` for navigation, `Gtk.MultiSelection` for bulk actions. Toggle selection mode with header bar button + action bar for bulk operations. See reference for code patterns.
176
177## Iconography
178
179**Rules:**
180- Symbolic icons only (outline, monochrome) - never full-color in UI
181- Source from GNOME Icon Library (`icon-library` app)
182- Header bar: icon-only buttons, always add tooltips
183- Naming: `action-object-symbolic` (e.g., `list-add-symbolic`)
184- **Dynamic icons:** Update icon name based on state (e.g., `user-trash-symbolic` → `user-trash-full-symbolic`)
185
186| Action | Icon |
187|--------|------|
188| Add/New | `list-add-symbolic` |
189| Delete | `user-trash-symbolic` |
190| Settings | `emblem-system-symbolic` |
191| Menu | `open-menu-symbolic` |
192| Search | `system-search-symbolic` |
193| Edit | `document-edit-symbolic` |
194| Back | `go-previous-symbolic` |
195| Drill-down | `go-next-symbolic` |
196| Sync | `emblem-synchronizing-symbolic` |
197| Offline | `network-offline-symbolic` |
198| Warning | `dialog-warning-symbolic` |
199| Error | `dialog-error-symbolic` |
200| Select mode | `selection-mode-symbolic` |
201| Check/Done | `emblem-ok-symbolic` |
202| Close | `window-close-symbolic` |
203| Refresh | `view-refresh-symbolic` |
204
205## Feedback Selection
206
207```dot
208digraph feedback {
209 rankdir=TB;
210 node [shape=box];
211
212 "What happened?" [shape=diamond];
213 "Transient or persistent?" [shape=diamond];
214 "AdwToast" [style=filled fillcolor=lightgreen label="AdwToast (default)"];
215 "AdwBanner" [style=filled fillcolor=lightyellow];
216 "AdwDialog" [style=filled fillcolor=lightpink];
217 "Progress/Spinner" [style=filled fillcolor=lightblue];
218
219 "What happened?" -> "Transient or persistent?" [label="state/error"];
220 "What happened?" -> "AdwDialog" [label="needs decision"];
221 "What happened?" -> "Progress/Spinner" [label="ongoing operation"];
222 "Transient or persistent?" -> "AdwToast" [label="transient event"];
223 "Transient or persistent?" -> "AdwBanner" [label="persistent state"];
224}
225```
226
227| Scenario | Default | Details |
228|----------|---------|---------|
229| Action done | `AdwToast` | Short message, optional undo |
230| Destructive action | `AdwToast` + undo | Prefer over confirmation dialog |
231| Error (recoverable) | `AdwToast` | Brief, auto-retry silently |
232| Error (blocking) | `AdwDialog` | Explain problem and required fix |
233| Persistent state | `AdwBanner` | Offline, degraded mode, auth required |
234| Needs decision | `AdwDialog` | Conflicts, irreversible actions |
235| Short wait (<5s) | `AdwSpinner` | No progress bar |
236| Long operation (>30s) | Progress bar + text | "13 of 42 processed" |
237
238**Error escalation:** Toast (transient) → Banner (persists) → Dialog (requires action)
239- Network blip: Toast, auto-retry
240- Prolonged offline: Banner with "Retry" button
241- Auth expired: Dialog + Banner until resolved
242
243**Dialog rules:**
244- Cancel button first (left), action button last (right)
245- Specific verbs ("Delete", "Save"), never "OK" or "Yes"
246- Destructive actions use `destructive-action` style
247
248**Context menus:** Use `GtkPopoverMenu` for right-click actions (remove, rename, properties). Keep menus short; move complex actions to dialogs.
249
250### Empty State Pattern
251
252```python
253# Show placeholder when list is empty
254empty_state = Adw.StatusPage(
255 icon_name="folder-symbolic",
256 title="No Projects",
257 description="Create a project to get started"
258)
259create_btn = Gtk.Button(label="Create Project")
260create_btn.add_css_class("pill")
261create_btn.add_css_class("suggested-action")
262empty_state.set_child(create_btn)
263
264# Use stack to switch between list and empty state
265stack.add_named(list_view, "content")
266stack.add_named(empty_state, "empty")
267stack.set_visible_child_name("empty" if model.get_n_items() == 0 else "content")
268```
269
270## Quality Checklist
271
272**Create TodoWrite items for each applicable check before implementing.**
273
274### Layer 1: Compliance
275
276- [ ] Correct container type and header bar structure
277- [ ] Navigation pattern matches content structure
278- [ ] Standard widgets used (not custom where native exists)
279- [ ] Symbolic icons from GNOME Icon Library
280- [ ] Typography uses style classes (`title-1`, `heading`, `body`, `caption`)
281- [ ] Libadwaita spacing defaults (no custom margins)
282- [ ] Header capitalization for labels, sentence for descriptions
283
284### Layer 2: Polish
285
286- [ ] Clear visual hierarchy - important elements prominent
287- [ ] Controls and text properly aligned
288- [ ] Consistent patterns throughout
289- [ ] Empty states have placeholder page (icon + message + action)
290- [ ] Loading states show spinner/skeleton, never frozen UI
291- [ ] Smooth resize and view transitions
292- [ ] Comfortable density - not cramped, not sparse
293
294### Layer 3: Rigor
295
296- [ ] All controls keyboard-accessible (Tab, Enter, Space)
297- [ ] All elements have accessible names for screen readers
298- [ ] Works with high contrast (`GTK_THEME=Adwaita:hc`)
299- [ ] Works with 200% text scaling
300- [ ] Error handling for every input/action
301- [ ] Edge cases handled (empty lists, long text, missing data)
302- [ ] Destructive actions have undo where possible
303- [ ] Responsive: works at 800x600, adapts to larger
304
305## Accessibility Quick Check
306
307```bash
308# Test high contrast
309GTK_THEME=Adwaita:hc ./myapp
310
311# Test large text (set in GNOME Settings > Accessibility first)
312
313# Test with screen reader
314orca &
315./myapp
316
317# Keyboard-only: unplug mouse, navigate entire app with Tab/Enter/Space
318```
319
320**Code:** Set accessible labels for icon-only buttons and images:
321```python
322button.update_property([Gtk.AccessibleProperty.LABEL], ["Add new item"])
323image.update_property([Gtk.AccessibleProperty.LABEL], ["Project thumbnail"])
324```
325
326## Red Flags - STOP
327
328- Custom styling where libadwaita has a pattern
329- Multiple "suggested" or "destructive" buttons per view
330- Confirmation dialogs for reversible actions (use undo)
331- Text over images or textured backgrounds
332- Non-GNOME icons without strong justification
333- Missing tooltips on icon-only header bar buttons
334- Generic labels ("OK", "Yes", "No", "Submit")
335- Frozen UI during operations (missing loading states)
336
337## Non-GTK Apps (Qt/PySide6)
338
339When styling Qt apps for GNOME:
340- Use Adwaita-qt or manual QSS matching Adwaita colors
341- Follow same patterns conceptually (header bar → toolbar, etc.)
342- Match spacing, typography scale, and icon style
343- Test alongside native GNOME apps for consistency
344
345## Reference Files
346
347| Need | File |
348|------|------|
349| Basic UI patterns | `gnome-hig-reference.md` |
350| Advanced patterns | `gnome-advanced-patterns.md` |
351
352**gnome-hig-reference.md** - Read for most apps:
353- Container, navigation, control, feedback patterns with code
354- Search bar, form validation, **filter models**, grid views, selection modes
355- File chooser dialogs, dark/light mode, responsive breakpoints
356- Primary menu structure, About dialog, Shortcuts window
357- Typography, writing style, **CSS color variables**, common mistakes
358- **Accessibility testing** commands (high contrast, screen reader)
359- **Phone/tablet breakpoints**, adaptive layouts
360
361**gnome-advanced-patterns.md** - Read when building:
362- Drag & drop (reordering, file drops, cross-widget DnD)
363- Undo/Redo (command pattern, history management)
364- Tabs (AdwTabView, multi-document apps)
365- System notifications (GNotification vs Toast)
366- Media display (image viewers, video controls, **pinch-to-zoom gestures**)
367- Split/Paned views (resizable panels)
368- Welcome/Onboarding (first-run, feature callouts)
369- Popovers (tool palettes, color pickers)
370- **Keyboard shortcuts** (mnemonics, shortcut controllers)