Commit 7743a2b
authored
🤖 feat: responsive ChatInput controls with compact display (#517)
Changes chat controls to use compact display on narrow viewports instead
of hiding elements entirely.
## Changes
### 1. **1M Context Label**
- Changed from "1M Context" to just "1M" (always, not viewport
dependent)
- Reduces horizontal space usage while keeping meaning clear
### 2. **Thinking Slider**
- Wide viewports (>550px): Full slider with visual feedback
- Narrow viewports (≤550px): Compact clickable badge that cycles through
levels (off → low → medium → high → off)
- Badge maintains the same visual styling (color, glow) as the slider
label
- Tooltip explains click-to-cycle behavior
### 3. **Mode Switch**
- Wide viewports (>550px): Shows both "Exec" and "Plan" buttons in
toggle group
- Narrow viewports (≤550px): Shows only the active mode as a clickable
badge that cycles to the other mode
- Maintains same color styling (exec mode = blue, plan mode = purple)
## Technical Implementation
- Added `compact` prop to `ThinkingSliderComponent` and `ToggleGroup`
components
- Both full and compact versions are rendered in DOM, CSS handles
show/hide with `max-[550px]:hidden` and `max-[550px]:flex`
- Compact controls use click-to-cycle pattern for toggling between
states
- All controls remain fully functional at any viewport size
## Testing
- ✅ `make typecheck` passes
- ✅ `make lint` passes
- ✅ `make test` passes (955 tests)
- Verified responsive behavior at 400px, 500px, 550px, and 800px
viewport widths
_Generated with `cmux`_1 parent c1f6440 commit 7743a2b
File tree
4 files changed
+86
-34
lines changed- src/components
4 files changed
+86
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
91 | 110 | | |
92 | 111 | | |
93 | 112 | | |
| |||
847 | 866 | | |
848 | 867 | | |
849 | 868 | | |
850 | | - | |
| 869 | + | |
851 | 870 | | |
852 | | - | |
| 871 | + | |
853 | 872 | | |
854 | 873 | | |
855 | 874 | | |
856 | 875 | | |
857 | 876 | | |
858 | | - | |
859 | | - | |
| 877 | + | |
| 878 | + | |
860 | 879 | | |
861 | 880 | | |
| 881 | + | |
862 | 882 | | |
863 | 883 | | |
864 | 884 | | |
| |||
875 | 895 | | |
876 | 896 | | |
877 | 897 | | |
| 898 | + | |
| 899 | + | |
878 | 900 | | |
879 | 901 | | |
880 | 902 | | |
| |||
886 | 908 | | |
887 | 909 | | |
888 | 910 | | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
| 911 | + | |
897 | 912 | | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
910 | 920 | | |
911 | 921 | | |
912 | 922 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
127 | 134 | | |
128 | 135 | | |
129 | 136 | | |
| |||
154 | 161 | | |
155 | 162 | | |
156 | 163 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
161 | 169 | | |
162 | | - | |
163 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
164 | 178 | | |
165 | 179 | | |
166 | | - | |
| 180 | + | |
167 | 181 | | |
168 | 182 | | |
169 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
16 | 44 | | |
17 | 45 | | |
18 | 46 | | |
| |||
0 commit comments