Make the theme control one toggle instead of a three-rung picker Storing nothing IS system, and it is the default until someone chooses, so an explicit "system" button made the common case -- never touching this -- look like an unmade decision. One control now flips between light and dark and leaves the untouched state alone. The glyph names the destination rather than the current state, because the control is an action, not a status readout: sun while dark, moon while light. Which glyph shows cannot be decided in CSS -- with nothing stored the answer lives in the OS -- so the head script resolves the effective theme onto data-theme-effective and the stylesheet reads that. Both glyphs stay in the layout so the button does not resize as it flips and shove the breadcrumb beside it. The script now also stops following the OS once a preference exists, which the previous version got wrong: it repainted on every prefers-color-scheme change regardless of what the visitor had chosen. Two guards did their job while rewriting this. The CSP test caught the inline bootstrap losing its nonce -- the policy admits no unsafe-inline, so a nonce-less script is silently dead. And the script needs phx-no-curly-interpolation, since HEEx reads braces in a script body and this one is nothing but braces. The component test asserted the three rungs; it now asserts one control and that no rung survives, with a note explaining the change.
Make the theme control one toggle instead of a three-rung picker
Deploy story
What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.
Not deployed through the forge lane
No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.
Changed files
-
modified
assets/css/app.css -
modified
lib/openagents_web/components/layouts.ex -
modified
lib/openagents_web/components/layouts/root.html.heex -
modified
test/openagents_web/live/components_live_test.exs
Diff
4 files changed, +104 -77
assets/css/app.css modified +27 -11
@@ -588,21 +588,37 @@
| 588 | 588 |
|
| 589 | 589 |
|
| 590 | 590 |
|
| 591 |
|
|
| 592 |
|
|
| 593 |
|
|
| 594 |
|
|
| 595 |
|
|
| 591 |
|
|
| 592 |
|
|
| 593 |
|
|
| 594 |
|
|
| 595 |
|
|
| 596 |
|
|
| 597 |
|
|
| 596 | 598 |
|
| 597 | 599 |
|
| 598 |
|
|
| 600 |
|
|
| 599 | 601 |
|
| 600 | 602 |
|
| 601 | 603 |
|
| 602 |
|
|
| 603 |
|
|
| 604 |
|
|
| 605 |
|
|
| 606 |
|
|
| 604 |
|
|
| 605 |
|
|
| 606 |
|
|
| 607 |
|
|
| 608 |
|
|
| 609 |
|
|
| 610 |
|
|
| 611 |
|
|
| 612 |
|
|
| 613 |
|
|
| 614 |
|
|
| 615 |
|
|
| 616 |
|
|
| 617 |
|
|
| 618 |
|
|
| 619 |
|
|
| 620 |
|
|
| 621 |
|
|
| 622 |
|
|
| 607 | 623 |
|
| 608 | 624 |
|
lib/openagents_web/components/layouts.ex modified +24 -29
@@ -136,38 +136,33 @@ defmodule OpenAgentsWeb.Layouts do
| 136 | 136 |
|
| 137 | 137 |
|
| 138 | 138 |
|
| 139 |
|
|
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
|
| 145 |
|
|
| 146 |
|
|
| 147 |
|
|
| 148 |
|
|
| 139 |
|
|
| 140 |
|
|
| 141 |
|
|
| 142 |
|
|
| 143 |
|
|
| 144 |
|
|
| 145 |
|
|
| 146 |
|
|
| 147 |
|
|
| 148 |
|
|
| 149 |
|
|
| 150 |
|
|
| 149 | 151 |
|
| 150 | 152 |
|
| 151 | 153 |
|
| 152 |
|
|
| 153 |
|
|
| 154 |
|
|
| 155 |
|
|
| 156 |
|
|
| 157 |
|
|
| 158 |
|
|
| 159 |
|
|
| 160 |
|
|
| 161 |
|
|
| 162 |
|
|
| 163 |
|
|
| 164 |
|
|
| 165 |
|
|
| 166 |
|
|
| 167 |
|
|
| 168 |
|
|
| 169 |
|
|
| 170 |
|
|
| 154 |
|
|
| 155 |
|
|
| 156 |
|
|
| 157 |
|
|
| 158 |
|
|
| 159 |
|
|
| 160 |
|
|
| 161 |
|
|
| 162 |
|
|
| 163 |
|
|
| 164 |
|
|
| 165 |
|
|
| 171 | 166 |
|
| 172 | 167 |
|
| 173 | 168 |
|
lib/openagents_web/components/layouts/root.html.heex modified +37 -19
@@ -12,27 +12,45 @@
| 12 | 12 |
|
| 13 | 13 |
|
| 14 | 14 |
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 18 | 21 |
|
| 19 | 22 |
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
|
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 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 |
|
|
| 36 | 54 |
|
| 37 | 55 |
|
| 38 | 56 |
|
test/openagents_web/live/components_live_test.exs modified +16 -18
@@ -79,33 +79,31 @@ defmodule OpenAgentsWeb.ComponentsLiveTest do
| 79 | 79 |
|
| 80 | 80 |
|
| 81 | 81 |
|
| 82 |
|
|
| 82 |
|
|
| 83 |
|
|
| 84 |
|
|
| 85 |
|
|
| 86 |
|
|
| 83 | 87 |
|
| 84 | 88 |
|
| 85 | 89 |
|
| 86 | 90 |
|
| 87 | 91 |
|
| 88 |
|
|
| 89 |
|
|
| 90 |
|
|
| 91 |
|
|
| 92 |
|
|
| 93 |
|
|
| 94 |
|
|
| 95 |
|
|
| 96 |
|
|
| 92 |
|
|
| 93 |
|
|
| 97 | 94 |
|
| 98 | 95 |
|
| 99 |
|
|
| 96 |
|
|
| 100 | 97 |
|
| 101 | 98 |
|
| 102 |
|
|
| 103 |
|
|
| 104 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 103 |
|
|
| 104 |
|
|
| 105 | 105 |
|
| 106 |
|
|
| 107 |
|
|
| 108 |
|
|
| 109 |
|
|
| 106 |
|
|
| 107 |
|
|
| 110 | 108 |
|
| 111 | 109 |
|