Commit e7e906c
feat(desktop): focus composer input when opening a new tab (#493)
Opening a new tab (the "+" button, /new, reopening a closed tab, or a
folder pick that routes through newThread) now auto-focuses that tab's
composer textarea so the user can type immediately.
The Workspace keeps a single ThreadView/Composer instance and swaps the
threadId prop on tab switches (no remount), so a plain autoFocus won't
fire. Instead newThread/rehydrateLast set a one-shot pendingFocusId in
the store; the Composer focuses when it matches its threadId and clears
it via consumeComposerFocus. Routing through the signal means focus is
grabbed only for newly-opened tabs, not on manual switches back to an
existing tab.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent bcc6d2d commit e7e906c
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
239 | 244 | | |
240 | 245 | | |
241 | 246 | | |
| |||
295 | 300 | | |
296 | 301 | | |
297 | 302 | | |
| 303 | + | |
298 | 304 | | |
299 | 305 | | |
300 | 306 | | |
| |||
667 | 673 | | |
668 | 674 | | |
669 | 675 | | |
| 676 | + | |
| 677 | + | |
670 | 678 | | |
671 | 679 | | |
672 | 680 | | |
| |||
735 | 743 | | |
736 | 744 | | |
737 | 745 | | |
| 746 | + | |
738 | 747 | | |
739 | 748 | | |
740 | 749 | | |
741 | 750 | | |
742 | 751 | | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
743 | 758 | | |
744 | 759 | | |
745 | 760 | | |
| |||
0 commit comments