Commit 4360b63
fix(webapp): stop a negative contrast being thrown away on read, and hide the scale
Two things were wrong with Black's extra travel.
Saving below zero didn't stick. The preference blob is parsed with a zod schema
whose contrast field floored at 0, and every field there uses
`.catch(undefined)` so an out-of-range value degrades quietly rather than
failing the whole blob. The write reached the database intact; the read then
discarded it and fell back to the default, which is why the handle sprang back
to 0% a moment after release - and why it seemed to hold if the save hadn't
settled yet. The floor now follows the offset.
The negative range was also on show. Black's floor is -30 in the ramp, and the
slider now presents that as 0%: it works in 0-100 whatever the theme, adding the
offset on the way in and taking it off on the way out. So Black's "Default" tick
sits at the left end where the lines are faintest, nothing below it is reachable
by dragging, and no negative number is ever displayed. -30 is also the floor now
rather than -100, since below it the rules disappear entirely.
One consequence: Black's window is the same width in the ramp as before but
shifted down, so its strongest setting is 70 rather than 100. That end is the
last thing this theme needs, and the slider reads 0-100 on every theme as a
result.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 2110993 commit 4360b63
3 files changed
Lines changed: 45 additions & 37 deletions
File tree
- apps/webapp/app
- routes/account._index
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
| 83 | + | |
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
| |||
98 | 97 | | |
99 | 98 | | |
100 | 99 | | |
101 | | - | |
102 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | 884 | | |
891 | 885 | | |
892 | 886 | | |
| |||
921 | 915 | | |
922 | 916 | | |
923 | 917 | | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
924 | 930 | | |
925 | 931 | | |
926 | 932 | | |
| |||
1107 | 1113 | | |
1108 | 1114 | | |
1109 | 1115 | | |
1110 | | - | |
| 1116 | + | |
1111 | 1117 | | |
1112 | 1118 | | |
1113 | 1119 | | |
1114 | 1120 | | |
1115 | | - | |
| 1121 | + | |
1116 | 1122 | | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
| 1123 | + | |
1121 | 1124 | | |
1122 | 1125 | | |
1123 | 1126 | | |
1124 | | - | |
| 1127 | + | |
1125 | 1128 | | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
1129 | 1132 | | |
1130 | 1133 | | |
1131 | 1134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
| |||
50 | 55 | | |
51 | 56 | | |
52 | 57 | | |
53 | | - | |
54 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
55 | 63 | | |
56 | 64 | | |
57 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | 56 | | |
63 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
64 | 63 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
70 | 67 | | |
71 | | - | |
| 68 | + | |
72 | 69 | | |
73 | 70 | | |
74 | 71 | | |
75 | 72 | | |
76 | | - | |
| 73 | + | |
77 | 74 | | |
0 commit comments