Commit e3c83b4
authored
feat: new app (#188)
* new app ui
* refactor(expo-example): clean up SetupAdapter and chat settings
- Remove ProviderType, use model.provider for grouping instead
- Move display info (label, accentColor, icon) into SetupAdapter
- Add builtIn flag to indicate if model can be deleted
- Implement pending settings for new chats before first message
- Refactor addMessage to addMessages for atomic batch updates
- Replace Map.groupBy with manual implementation for compatibility
* feat(expo-example): add maxSteps setting for tool call iterations
- Add maxSteps to ChatSettings type and defaults
- Add UI control in settings sheet (1-20 range)
- Use maxSteps in streamText stopWhen condition
* feat: persist chats/models, hide mic when unavailable, handle unavailable provider
- Persist custom models and chats across reloads using atomWithStorage with AsyncStorage
- Hide microphone button when transcription is not available (iOS < 26)
- Add isAvailable() method to AppleTranscriptionModel
- Handle unavailable provider in ChatScreen with friendly message and model picker
- Grey out unavailable models in Choose Model sheet
- Add systemYellow color for warning states
* fix: restore provider name labels in Choose Model sheet
* fix: apply code review fixes for PR #188
## Summary of Fixes Applied
| Issue | Description | Status |
|-------|-------------|--------|
| #1 | Stale messages in handleSend | Not a bug - code already includes user message |
| #2 | ModelLifecycleManager cleanup | Fixed - added cleanup on unmount |
| #3 | Missing abort for streaming | Fixed - added AbortController + SDK abortSignal |
| #4 | Audio listener accumulation | Fixed - recreate recorder each session |
| #5 | Unnecessary `!` assertion | Skipped (style) |
| #6 | Silent error swallowing | Skipped (per request) |
| #7 | stopRecording not awaited | Fixed - made handlePress async |
| #8 | State update after delay | Skipped |
| #9 | setCurrentChatId inside setChats | Fixed - separated state updates |
| #10 | Incorrect date calculation | Fixed - use calendar days |
| #11 | No URL validation | Fixed - added `.gguf` check |
| #12 | Date serialization | Fixed - store as ISO strings |
| #13 | No duplicate check | Skipped |
| #14 | stopPropagation non-standard | Fixed - removed |
* refactor(expo-example): remove unnecessary useMemo/useCallback for React Compiler
React Compiler will auto-memoize these patterns:
- groupedChats derived state in CustomDrawerContent
- scrollToBottom, handleDelete, renderRightActions callbacks
- adaptersByProvider and enabledTools derived computations
* up
* docs: add PR screenshots
* docs: add agents.md style guide (#189)
* re-organize and clean-up
* refactor: extract ChatScreen into smaller components
- Split monolithic ChatScreen (~1300 lines) into focused components:
ChatHeader, ChatMessages, ChatInputBar, ModelPickerSheet, SettingsSheet
- Add providerStore for centralized adapter/model management
- Change isAvailable() from async to sync using expo-file-system
- Add Suspense boundaries with fallback components for progressive loading
- Move download progress tracking to providerStore
* final ui fixes, god damn1 parent 823cb08 commit e3c83b4
43 files changed
Lines changed: 2898 additions & 1636 deletions
File tree
- .github/assets
- apps/expo-example
- src
- components
- adapters
- config
- screens/apple
- ChatScreen
- PlaygroundScreen
- SpeechScreen
- TranscribeScreen
- store
- theme
- utils
- packages/apple-llm/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Loading
Loading
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 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 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
| 4 | + | |
8 | 5 | | |
9 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
14 | | - | |
15 | | - | |
| 12 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | | - | |
34 | 40 | | |
35 | | - | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
41 | 48 | | |
42 | | - | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
48 | | - | |
49 | | - | |
50 | | - | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
0 commit comments