The user reported the drawer's Recent Tags list eventually rendered,
but only after a couple of minutes. Root cause was inside
NoteRepositoryImpl:
1. hashtagUsageSnapshot() called noteBox.get(x.noteId) once per
cross-ref row. Most notes have multiple hashtags, so each note
was fetched many times — O(M) Box.get calls where M is the xref
count.
2. observeHashtagsByRecentUse() called trySend(snapshot()) BEFORE
setting up the ObjectBox subscription, then also inside the
observer. The first emission doubled the work; if the first
trySend ran before the upstream was warm, the data path itself
was slow.
Two surgical fixes inside NoteRepositoryImpl.kt:
- hashtagUsageSnapshot(): batch-load notes by id (one Box.get per
distinct noteId, not per xref) and tags by id (one Box.get per
distinct tagId). Net reads drop from (M + N) to
(distinct noteIds + distinct tagIds) — typically a 5–20×
reduction.
- observeHashtagsByRecentUse(): rely solely on the ObjectBox
observer's first fire (ObjectBox delivers the current query
state immediately on subscribe). Drop the manual pre-subscribe
trySend.
VERSION
- app/build.gradle.kts: versionCode 7 → 8, versionName '0.3.0.2' →
'0.3.0.3'.
- README.md changelog: new 0.3.0.3 row.
- Incido Development Plan.txt §10: new 0.3.0.3 row.
VERIFIED
- ./gradlew assembleDebug assembleRelease both green.
- versionCode=8, versionName='0.3.0.3'.
- No INTERNET permission.
- Release signed (v2 scheme verified).
v0.3.0.0 bundles four user-facing features, the plan-compliance polish
that was deferred from v0.2, and a permanent change to how we name
releases going forward.
VERSION SCHEME (app/build.gradle.kts)
- versionName = '0.3.0.0' (MAJOR.MINOR.MAINTENANCE.EMERGENCY)
- versionCode = 5
- New gradle taskGraph validator fails the build if versionName
doesn't match ^\d+\.\d+\.\d+\.\d+$ — we can't accidentally
regress the scheme.
- History re-keyed across README, Plan §10, CONTRIBUTING.md.
HASHTAGS
- value class Hashtag (domain/model) with normalise/parseOrNull
helpers; pattern: ^[a-z0-9][a-z0-9._-]{0,30}$
- data class HashtagUsage (name, noteCount, lastUsedAt)
- sealed class NoteFilter { Home, Favorites, Untagged, ByTag(name) }
- Note gains hashtags: List<String> (sorted ascending)
- Repository:
- new entities HashtagEntity (@Index on name) and
NoteHashtagCrossRef (many-to-many junction)
- new methods: observeFavorites / observeUntagged /
observeNotesForHashtag / observeHashtagsByRecentUse /
observeAllHashtags / searchHashtags / addHashtag / removeHashtag
- search() now matches content OR hashtag-name (case-insensitive)
- ObjectBox queries use explicit StringOrder + type annotations
(kapt's stubs are finicky around Property<String> overloads)
UI
- CenterAlignedTopAppBar on both list and editor screens
- List:
- Hamburger top-left opens a ModalNavigationDrawer (Home /
Favorites / Untagged / divider / scrollable Recent tags)
- Drawer selection drives a NoteFilter state held at root
- Search bar visible only when filter == Home
- NoteCard redesign — 14 dp vertical gradient stripe +
tinted surface (12 % colour blend) + 10 dp corner chip
- Empty-state copy is filter-aware
- Editor:
- Persistent hashtag chip row above the text field
- Tag # icon in the top bar + '+ add' chip opens a ModalBottomSheet
- Autocomplete suggestions live from repository.searchHashtags
- '+ Create name' button when the typed value is valid + new
- Snackbar 'Maximum 5 tags reached.' when the cap is hit
- Reconciled on save via addHashtag / removeHashtag diff
DOCS
- README v0.3.0.0 section + re-keyed changelog
- Development Plan §10 history re-keyed (0.1.0.0 / 0.1.1.0 /
0.2.0.0 / 0.2.0.1 / 0.3.0.0)
- CONTRIBUTING.md release-process note updated for the new scheme
VERIFIED
- ./gradlew assembleDebug assembleRelease both green
- Debug 25.7 MB, release 19.8 MB (v2-signed)
- versionCode=5, versionName='0.3.0.0'
- No INTERNET permission
- Validator regression: setting versionName='0.3' causes
assembleDebug to fail with the new scheme error message