Commit 761c110
fix(ui): improve dialog button visibility and close-on-click-outside (#703)
* fix(ui): improve dialog button visibility and add close-on-click-outside (#682)
- Theme-aware secondary button colors: light mode uses warm gray fill,
dark mode uses dark neutral fill, ensuring buttons are always visible
against the dialog background
- Extract DIALOG_BUTTON_MIN_SIZE constant (96×36) for consistent sizing
- Add .strong() to all dialog button labels for better scannability
- Add clicked_outside_window() utility in new modal_overlay module
- Apply close-on-click-outside to all non-destructive/non-sensitive dialogs
- Standardize WalletUnlockPopup Cancel button (was transparent, now themed)
- Standardize WalletUnlockPopup button layout to right-to-left (primary right)
- Update DataContractJsonPopup: primary Close button, DashColors constants,
add Escape key handling
- Project-wide pass: update ~12 ad-hoc dialogs across identities, wallets,
contracts, tools, DPNS, DashPay, and tokens screens to use ComponentStyles
- Add manual test scenarios document
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor(ui): replace ad-hoc identity removal dialog with ConfirmationDialog
Replace hand-rolled egui::Window confirmation dialog in identities_screen
with the shared ConfirmationDialog component. This ensures consistent
button styling (theme-aware secondary buttons, danger mode) and behavior
(Escape key, X button close) via the reusable component.
Net reduction of 74 lines — all styling, overlay, and dismiss logic now
handled by ConfirmationDialog.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(ui): darken secondary button fill and text for better light-mode contrast
Fill: (235,238,243) → (215,220,228)
Text: (60,70,85) → (45,55,72)
Stroke: (200,206,215) → (185,192,205)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(ui): revert secondary button fill, keep darker text, darken border more
Fill: reverted to (235,238,243)
Text: kept at (45,55,72)
Stroke: (185,192,205) → (170,178,192)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(ui): align secondary button colors with default widget (column header) styling
Secondary buttons now use the same fill/text/stroke as egui's default
inactive widget style (used by column title buttons), ensuring visual
consistency across the app.
Light: fill (240,242,247), text (17,25,33), stroke (226,232,240)
Dark: fill (18,18,18), text (240,240,240), stroke (60,60,60)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(ui): ensure secondary button fill contrasts against dialog background
Previous fill (240,242,247) was identical to window_fill, making buttons
invisible on dialogs. New fill (218,222,230) is ~20 points darker.
Light: fill (218,222,230), text BLACK, stroke (195,200,212)
Dark: fill (50,52,58), text (240,240,240), stroke (72,75,82)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor(ui): replace ad-hoc dialogs with ConfirmationDialog in key_info and masternode_list_diff
Replace custom confirmation dialog implementations with the shared
ConfirmationDialog component for consistency and reduced duplication.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(ui): extract button helpers, zeroize keys, add modal overlays, scope Enter key
- Extract ComponentStyles::{primary,secondary,danger}_button() helpers,
replacing ~38 copy-pasted button construction sites across 13 files
- Use Zeroizing<String> for private key WIF in dialogs and asset lock screen
- Replace .clear() with .zeroize() for SK wallet unlock password
- Add modal overlay + click-outside-to-close to Send Dash, Reward
Calculation, and Avatar popups
- Scope Enter key confirmation to only fire when no widget has focus
(ConfirmationDialog and InfoPopup)
- Standardize button order: Cancel left, Action right across all dialogs
- Add Cancel button to Send Dash confirmation dialog
- Update manual test scenarios with correct RGB values and expanded
coverage (5 → 13 dialog types)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(ui): address PR review comments — Enter guard, ComboBox dismiss, alias ordering
- Gate Enter-to-confirm on confirm_text.is_some() so hidden confirm
buttons can't be triggered via keyboard
- Add !combo_open guard to SelectionDialog outside-click handler,
preventing ComboBox dropdown clicks from closing the dialog
- Add outside-click dismissal to Token Configuration Details and
Select Properties popups
- Reorder alias rename: persist to DB first, update in-memory only
on success, show MessageBanner on failure
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor(ui): generalize button helpers to accept WidgetText, add kittest coverage
- Change ComponentStyles::{primary,secondary,danger}_button() to accept
`impl Into<WidgetText>` instead of `&str`, preserving existing RichText
formatting when provided
- Collapse 6 branching sites in ConfirmationDialog, SelectionDialog, and
InfoPopup that manually handled RichText vs plain text
- Add 17 kittest tests for ConfirmationDialog (rendering, NOTHING
sentinel, danger mode, open/closed state, ComponentResponse)
- Add 13 kittest tests for InfoPopup (rendering, paragraph splitting,
markdown mode, is_open tracking, show() return value)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor(ui): centralize pointer cursor in ComponentStyles button helpers
Add add_primary_button(), add_secondary_button(), add_danger_button(),
and add_primary_button_enabled() helpers that bake in PointingHand cursor,
eliminating ~43 redundant .on_hover_cursor() calls across 15 files.
Also adds TODO(#707) for PasswordInput in wallet_unlock_popup.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor(ui): add toolbar_button helper, move clicked_outside_window to helpers
- Add ComponentStyles::toolbar_button() and add_toolbar_button() for
top-panel action buttons with network accent colors
- Add generic ComponentStyles::add_button() for custom-styled buttons
- Migrate top_panel.rs to use toolbar_button helpers, removing ad-hoc
styling and manual text measurement
- Move clicked_outside_window() from components/modal_overlay.rs to
helpers.rs (it's a utility function, not a component)
- Delete now-empty modal_overlay module
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(ui): address PR review comments — disabled button visuals, InfoPopup Enter guard
- add_primary_button_enabled() now shows distinct grey fill/text when
disabled instead of looking active (CMT-007)
- Remove unnecessary focused() guard from InfoPopup Enter handler since
InfoPopup has no input fields (CMT-009)
- Add INTENTIONAL(CMT-010) comments documenting accepted WidgetText
match behavior across all button helpers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 20f81c7 commit 761c110
25 files changed
Lines changed: 1467 additions & 586 deletions
File tree
- docs/ai-design/2026-03-09-dialog-button-visibility
- src/ui
- components
- contracts_documents
- dashpay
- dpns
- identities
- keys
- tokens/tokens_screen
- tools
- wallets
- wallets_screen
- tests/kittest
Lines changed: 333 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments