Commit e0add4e
committed
feat: Implement circular arrow key navigation
The previous implementation of arrow key navigation was incomplete, only handling a few specific transitions. This made navigating the grid of actions with the keyboard feel broken and unintuitive.
This commit replaces the sparse `if/else` logic with a comprehensive `switch` statement for each arrow key direction (`up`, `down`, `left`, `right`). This ensures that navigation is circular and predictable from any focused action button, wrapping around the 2x2 grid as expected.1 parent 95dd03a commit e0add4e
1 file changed
Lines changed: 36 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
134 | 135 | | |
135 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
136 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
137 | 144 | | |
138 | 145 | | |
139 | 146 | | |
140 | 147 | | |
141 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
142 | 152 | | |
143 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
144 | 156 | | |
| 157 | + | |
| 158 | + | |
145 | 159 | | |
146 | 160 | | |
147 | 161 | | |
148 | 162 | | |
149 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
150 | 169 | | |
151 | | - | |
| 170 | + | |
152 | 171 | | |
| 172 | + | |
| 173 | + | |
153 | 174 | | |
154 | 175 | | |
155 | 176 | | |
156 | 177 | | |
157 | | - | |
| 178 | + | |
| 179 | + | |
158 | 180 | | |
159 | | - | |
| 181 | + | |
160 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
161 | 189 | | |
162 | 190 | | |
163 | 191 | | |
| |||
0 commit comments