This repository was archived by the owner on Jan 30, 2026. It is now read-only.
Commit dab3dbb
authored
fix: don't disable input while waiting for session + persist drafts (#107)
* fix: don't disable input while waiting for session + persist drafts
Previously, the input was disabled when hasSession was false, showing
'Waiting for chat session to be established...' which could leave
users stuck unable to type.
Changes:
- Remove hasSession check from isDisabled condition
- Remove hasSession-based placeholder message
- Add localStorage persistence for message drafts per conversation
- Drafts are cleared automatically when message is sent
This allows users to start typing immediately while the session
establishes in the background. If they try to send before the session
is ready, they'll get an error toast rather than being blocked.
Fixes #58
* fix: remove unused _hasSession variable to fix TypeScript error
* fix: remove unused hasSession$ prop from ChatInput
Previously ChatInput accepted hasSession$ prop to control when input
was enabled. After the last change that removed the hasSession check
from isDisabled, this prop became unused but was still in the interface.
This commit:
- Removes hasSession$ from ChatInput Props interface
- Removes hasSession$ from component destructuring
- Removes hasSession$ prop from ConversationContent and WelcomeView
- Removes unused hasSession$ variable from WelcomeView
Fixes TypeScript error TS6133: 'hasSession$' is declared but never read
* fix: preserve draft in localStorage until overwritten to prevent data loss
Previously, drafts were cleared from localStorage immediately when the
message field became empty (after submit). This caused data loss if the
send operation failed, as the draft was already gone.
Now we only persist non-empty messages without auto-clearing. The draft
remains in localStorage until the user types a new message, ensuring
it's recoverable if send fails.
Addresses Greptile review feedback on PR #107.1 parent c21b7bc commit dab3dbb
File tree
3 files changed
+22
-12
lines changed- src/components
3 files changed
+22
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | 34 | | |
36 | 35 | | |
37 | 36 | | |
| |||
206 | 205 | | |
207 | 206 | | |
208 | 207 | | |
209 | | - | |
210 | 208 | | |
211 | 209 | | |
212 | 210 | | |
| |||
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
224 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
225 | 230 | | |
226 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
227 | 242 | | |
228 | 243 | | |
229 | 244 | | |
| |||
273 | 288 | | |
274 | 289 | | |
275 | 290 | | |
276 | | - | |
277 | | - | |
278 | 291 | | |
279 | 292 | | |
280 | 293 | | |
281 | 294 | | |
282 | | - | |
283 | | - | |
284 | | - | |
| 295 | + | |
285 | 296 | | |
286 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
287 | 300 | | |
288 | 301 | | |
289 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| |||
97 | 96 | | |
98 | 97 | | |
99 | 98 | | |
100 | | - | |
101 | 99 | | |
102 | 100 | | |
103 | 101 | | |
| |||
0 commit comments