Commit 949ea47
refactor(ui): unify action buttons to use ComponentStyles helpers (#708)
* 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>
* refactor(ui): unify action buttons to use ComponentStyles::add_primary_button
Replace all ad-hoc blue (ACTION_BUTTON_BLUE) and green action buttons
across 23 files with ComponentStyles::add_primary_button(), giving
consistent DASH_BLUE styling, pointer cursor, and min size throughout
the app. Net -139 lines of duplicated button construction code.
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: Lukasz Klimek <842586+lklimek@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 761c110 commit 949ea47
23 files changed
Lines changed: 72 additions & 211 deletions
File tree
- src/ui
- contracts_documents
- tokens
- tools
- wallets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 260 | + | |
266 | 261 | | |
267 | 262 | | |
268 | 263 | | |
| |||
338 | 333 | | |
339 | 334 | | |
340 | 335 | | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
| 336 | + | |
347 | 337 | | |
348 | 338 | | |
349 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
| 179 | + | |
187 | 180 | | |
188 | 181 | | |
189 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
926 | 926 | | |
927 | 927 | | |
928 | 928 | | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
| 929 | + | |
936 | 930 | | |
937 | 931 | | |
938 | 932 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
246 | 242 | | |
247 | 243 | | |
248 | 244 | | |
| |||
557 | 553 | | |
558 | 554 | | |
559 | 555 | | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
| 556 | + | |
567 | 557 | | |
568 | 558 | | |
569 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 251 | + | |
257 | 252 | | |
258 | 253 | | |
259 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
| 261 | + | |
267 | 262 | | |
268 | 263 | | |
269 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 137 | + | |
141 | 138 | | |
142 | 139 | | |
143 | 140 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
| 642 | + | |
648 | 643 | | |
649 | 644 | | |
650 | 645 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
589 | 589 | | |
590 | 590 | | |
591 | 591 | | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
| 592 | + | |
597 | 593 | | |
598 | 594 | | |
599 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
597 | 597 | | |
598 | 598 | | |
599 | 599 | | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
| 600 | + | |
606 | 601 | | |
607 | 602 | | |
608 | 603 | | |
| |||
0 commit comments