Commit 9115e8c
committed
Feature: Populate default entries in System Message Database on first launch
Modifies `SystemMessageEntryPreferences.kt` to ensure that a predefined
set of placeholder `SystemMessageEntry` items are saved to the database
the first time the application loads these entries (typically on first app
install).
Changes include:
- Added a SharedPreferences flag `KEY_DEFAULT_DB_ENTRIES_POPULATED` to
track if default entries have been populated.
- Updated `loadEntries()` to check this flag. If not set, three
placeholder entries (with titles like "Example Task: Web Browsing"
and guides containing "// TODO:" comments) are created and saved.
The flag is then set to true.
- This ensures you have some initial examples in the database without
affecting existing user-created entries on subsequent loads or app
updates where the flag is already set.
This change does not affect the active system message or its default,
only the database of available system message entries.
Testing Caveat:
I was unable to complete automated testing of this change due to
persistent Android SDK configuration issues in the test environment.1 parent 9c543c1 commit 9115e8c
1 file changed
Lines changed: 28 additions & 1 deletion
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
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 | + | |
35 | 62 | | |
36 | 63 | | |
37 | 64 | | |
| |||
0 commit comments