feat(trash): v0.3.7.0 — Trash / soft delete + release docs backfill
dev / Build debug APK (push) Successful in 1m7s
release / Build & attach release APK (push) Failing after 28s

- Deleting a note now soft-deletes it (trashed flag on NoteEntity,
  additive schema, auto-migrated); trashed notes are hidden from Home,
  Favorites, Untagged, tag views, and ordinary search.
- New Trash drawer entry lists soft-deleted notes; each Trash card's
  overflow menu exposes Restore and Delete permanently.
- NoteFilter gains a Trash case; repository gains moveToTrash /
  restoreFromTrash / deletePermanently; backups round-trip the
  trashed state.
- Version bump (lockstep): versionCode 30->31, versionName
  0.3.6.3->0.3.7.0, SettingsViewModel.APP_VERSION, README intro +
  changelog, ReleaseNotes.kt 5-most-recent window.
- Development Plan §10: fix the merged 0.3.4.0/0.3.3.8 table row and
  backfill the missing 0.3.6.2/0.3.6.3 rows; add the 0.3.7.0 row.
- README changelog: backfill the missing 0.3.6.2 row; promote the
  Unreleased Trash row to 0.3.7.0.
This commit is contained in:
Incido Developer committed 2026-08-20 11:52:43 +12:00
1 parent 4bbe29851a
commit a39c52cf89
17 files changed
+386 -165

No files matched your search

@@ -22,6 +22,8 @@ data class Note(
* so the UI can render them in stable order.
*/
val attachments: List<NoteAttachment> = emptyList(),
/** True only for notes moved to the Trash view; active-note queries exclude these rows. */
val isTrashed: Boolean = false,
) {
/** Convenience: the first image attachment, or `null` if none. */
val firstImageAttachment: NoteAttachment?
@@ -5,15 +5,17 @@ package org.incido.domain.model
* `NoteListScreen` body and the selected entry in the navigation
* drawer.
*
* - [Home] — every note (the default). The search bar is enabled.
* - [Favorites] — only notes with `isFavorite = true`. No search.
* - [Untagged] — only notes that have zero hashtags. No search.
* - [ByTag] — only notes tagged with [hashtag]. No search.
* - [Home] — every active note (the default). The search bar is enabled.
* - [Favorites] — only notes with `isFavorite = true`; ordinary search is enabled.
* - [Untagged] — only notes that have zero hashtags; ordinary search is enabled.
* - [ByTag] — only notes tagged with [hashtag]; text search is not offered.
* - [Trash] — only notes moved out of the active list; no edit actions.
*/
sealed class NoteFilter {
object Home : NoteFilter()
object Favorites : NoteFilter()
object Untagged : NoteFilter()
object Trash : NoteFilter()
data class ByTag(val hashtag: String) : NoteFilter()
/** Stable identifier used by the drawer for `selected` matching. */
@@ -21,6 +23,7 @@ sealed class NoteFilter {
Home -> "home"
Favorites -> "favorites"
Untagged -> "untagged"
Trash -> "trash"
is ByTag -> "tag:$hashtag"
}
}
@@ -14,9 +14,12 @@ import org.incido.domain.model.NoteAttachment
* (case-insensitive equality).
*/
interface NoteRepository {
/** Stream of all notes, newest-first, favourites pinned to the top. */
/** Stream of all active notes, newest-first, favourites pinned to the top. */
fun observeAll(): Flow<List<Note>>
/** Stream of every note, including trashed notes, for maintenance/backup flows. */
fun observeAllIncludingTrashed(): Flow<List<Note>>
/**
* Stream of notes whose [Note.content] contains [query] (case-insensitive)
* OR whose hashtags contain [query] as one of the names. Favourites
@@ -31,9 +34,15 @@ interface NoteRepository {
/** Persist a new note or update an existing one. Returns the persisted [Note]. */
suspend fun upsert(note: Note): Note
/** Delete a note by id. No-op if it doesn't exist. */
/** Permanently delete a note by id. No-op if it doesn't exist. */
suspend fun delete(id: Long)
/** Move a note to Trash without removing its row, tags, or attachments. */
suspend fun softDelete(id: Long)
/** Restore a trashed note to the active list. */
suspend fun restore(id: Long)
/** Toggle the favourite flag on a single note. */
suspend fun setFavorite(id: Long, isFavorite: Boolean)
@@ -44,6 +53,9 @@ interface NoteRepository {
/** Only notes that have zero hashtags, sorted by updatedAt DESC. */
fun observeUntagged(): Flow<List<Note>>
/** Only notes in Trash, sorted by updatedAt DESC. */
fun observeTrashed(): Flow<List<Note>>
/**
* Context-aware search across **favourites only** — matches
* [Note.content] (contains, case-insensitive) AND any of the note's
@@ -60,6 +72,9 @@ interface NoteRepository {
*/
fun searchUntagged(query: String): Flow<List<Note>>
/** Search only trashed notes by content or hashtag. */
fun searchTrashed(query: String): Flow<List<Note>>
/** Only notes tagged with [name] (normalised form), sorted by updatedAt DESC. */
fun observeNotesForHashtag(name: String): Flow<List<Note>>