Commit f5244eb
committed
feat(lp): pencil toggle for edit mode with pro upsell for free users
Turn the live-preview toolbar's play button into an edit-mode toggle:
- Icon: fa-play → fa-pencil; title "Toggle Preview Mode (F8)" →
"Toggle Edit Mode (F8)" via new LIVE_PREVIEW_MODE_TOGGLE_EDIT string.
- Invert the .selected semantics — the button now lights amber when
LiveDevelopment.getCurrentMode() === LIVE_EDIT_MODE (not when in
preview). _initializeMode reconciles .selected against the real mode
on every livePreviewMode pref change, so state and visuals stay
synchronized.
- Click handler routes through LiveDevelopment.setMode(LIVE_EDIT_MODE)
instead of PreferencesManager.set, so we pick up the entitlement
gate for free: setMode returns false for users without the live-edit
entitlement, and we then invoke
KernalModeTrust.ProDialogs.showProUpsellDialog(UPSELL_TYPE_LIVE_EDIT)
— the same dialog the mode dropdown's "Edit Mode" item opens
(main.js:459-466). Pro users in edit drop back to preview; pro users
not in edit enter edit.
- F8 keybinding routes through the same click handler, so it gets the
same behavior and upsell for free.
No existing tests are affected — the two suites that touch
#previewModeLivePreviewButton only assert its visibility, never the
icon, the .selected class, or the click path.1 parent db412a1 commit f5244eb
3 files changed
Lines changed: 29 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
373 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
374 | 376 | | |
375 | 377 | | |
376 | 378 | | |
| |||
744 | 746 | | |
745 | 747 | | |
746 | 748 | | |
747 | | - | |
748 | | - | |
749 | | - | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
750 | 758 | | |
751 | 759 | | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
760 | 772 | | |
761 | 773 | | |
762 | 774 | | |
| |||
765 | 777 | | |
766 | 778 | | |
767 | 779 | | |
768 | | - | |
| 780 | + | |
769 | 781 | | |
770 | 782 | | |
771 | 783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| 547 | + | |
547 | 548 | | |
548 | 549 | | |
549 | 550 | | |
| |||
0 commit comments