Commit d3cc283
authored
🤖 fix: preserve SSH host when switching runtime modes (#855)
The regression was introduced in 7087ef4 when adding Local/Worktree/SSH
distinction. The onChange handler for runtime selection was changed
from:
```js
mode === LOCAL ? '' : props.sshHost
```
to:
```js
mode === SSH ? props.sshHost : ''
```
This cleared the SSH host when switching away from SSH mode, losing the
user's configured host when switching back.
## Fix
The SSH host is now stored in a separate localStorage key
(`lastSshHost:{projectPath}`) that persists independently of the runtime
mode. This ensures the SSH host is remembered when switching runtime
modes:
- SSH → Local → SSH
- SSH → Worktree → SSH
## Testing
- Existing tests pass
- All static checks pass
_Generated with `mux`_1 parent 7b5421c commit d3cc283
File tree
3 files changed
+30
-7
lines changed- src
- browser
- components/ChatInput
- hooks
- common/constants
3 files changed
+30
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
81 | | - | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
83 | 92 | | |
84 | 93 | | |
85 | 94 | | |
| |||
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
92 | | - | |
| 101 | + | |
93 | 102 | | |
94 | 103 | | |
95 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
99 | 112 | | |
100 | | - | |
| 113 | + | |
101 | 114 | | |
102 | 115 | | |
103 | 116 | | |
| |||
106 | 119 | | |
107 | 120 | | |
108 | 121 | | |
109 | | - | |
| 122 | + | |
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
129 | 139 | | |
130 | 140 | | |
131 | 141 | | |
| |||
0 commit comments