Commit 33eb784
committed
fix: unlock font-size field for global editing without selection
The font-size input, increment, and decrement buttons were disabled
unless a text node was selected, blocking the global workflow: typing
a value with nothing selected should apply to every text box on the
page, and clearing it should reset all boxes to auto.
What changed:
- Switch the disabled guard from !selectedNode to !hasNodes so the
controls stay enabled whenever the page has text boxes.
- Route commits through applyStyleToSelected when a node is selected
and applyStyleToAll otherwise, so the existing per-node behavior is
preserved.
- Buffer the input in local state (globalFontSizeInput) while in
global scope, otherwise the controlled value resets to '' on each
keystroke because currentFontSize stays undefined with no selection.
User-visible behavior differences:
- With no text node selected, the font-size field is now editable
(previously greyed out). Typing a number applies it to every text
box on the page; clearing the field resets all boxes to auto.
- Selecting a single text box still applies changes only to that
node, unchanged.
How I verified:
- bun run format and bun run test:ui (158/158 passed, including new
tests covering the global behavior).
- Manually confirmed against a running app: with no text node
selected, typing 24 sets fontSize=24 on all 8 text boxes; clearing
the field reverts all to auto (null) in the backend scene.
Closes #649.
This patch was made with AI assistance (Devin/Claude). The code was
reviewed and tested before submission.1 parent 2107843 commit 33eb784
2 files changed
Lines changed: 116 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
151 | 159 | | |
152 | 160 | | |
153 | 161 | | |
| |||
565 | 573 | | |
566 | 574 | | |
567 | 575 | | |
568 | | - | |
| 576 | + | |
569 | 577 | | |
570 | | - | |
571 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
572 | 590 | | |
573 | 591 | | |
574 | 592 | | |
| |||
581 | 599 | | |
582 | 600 | | |
583 | 601 | | |
584 | | - | |
585 | | - | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
586 | 610 | | |
587 | 611 | | |
588 | | - | |
589 | | - | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
590 | 629 | | |
591 | | - | |
| 630 | + | |
592 | 631 | | |
593 | | - | |
| 632 | + | |
594 | 633 | | |
595 | 634 | | |
596 | 635 | | |
597 | 636 | | |
598 | 637 | | |
599 | 638 | | |
600 | 639 | | |
601 | | - | |
| 640 | + | |
602 | 641 | | |
603 | | - | |
604 | | - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
605 | 654 | | |
606 | 655 | | |
607 | 656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 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 | + | |
173 | 228 | | |
174 | 229 | | |
175 | 230 | | |
| |||
0 commit comments