From ef5a45201e7e2ceb832c6e0eb767feda340b1338 Mon Sep 17 00:00:00 2001 From: Incido Developer Date: Thu, 20 Aug 2026 04:06:47 +1200 Subject: [PATCH] =?UTF-8?q?fix(editor):=20v0.3.6.1=20=E2=80=94=20left-anch?= =?UTF-8?q?or=20editor=20title,=20balance=20colour-chooser=20spacing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two emergency-patch UX fixes on the New/Edit screen: 1. Title left-aligned against the back arrow. NoteEditorScreen used CenterAlignedTopAppBar, but with six actions on the right (camera, attach, tag, favourite, save, more) the visually-centred title landed right next to the action cluster. Swap for Material 3's standard TopAppBar so 'New' / 'Edit' sits flush right of the back arrow on the left. 2. Colour chooser is now equally spaced between the title bar and the top of the note. The picker Row had padding(vertical = 4.dp) (4dp above + 4dp below), but the OutlinedTextField below has an intrinsic top inset (~16dp) inside its border, so the perceived gap from the picker to the first line of the note dwarfed the gap from the title bar's bottom to the picker's top. Remove the vertical = 4.dp and bracket the Row with two explicit Spacer(Modifier.height(12.dp)) siblings so the picker sits 12dp from the title bar AND 12dp from the field's top border. versionCode 27 → 28 versionName 0.3.6.0 → 0.3.6.1 APP_VERSION 0.3.6.0 → 0.3.6.1 --- Incido Development Plan.txt | 2 ++ README.md | 5 +++-- app/build.gradle.kts | 22 +++++++++---------- .../compose/ui/editor/NoteEditorScreen.kt | 17 +++++++++++--- .../compose/ui/settings/SettingsViewModel.kt | 2 +- 5 files changed, 31 insertions(+), 17 deletions(-) diff --git a/Incido Development Plan.txt b/Incido Development Plan.txt index 5ac6f3d..6e5a1bc 100644 --- a/Incido Development Plan.txt +++ b/Incido Development Plan.txt @@ -365,6 +365,8 @@ A short reference for AI assistants: | Version | Date | Notes | |---------|------|-------| +| 0.3.6.1 | 2026-08-19 | **Emergency hotfix** — two UX bugs in the v0.3.6.0 New/Edit screen. **1. Top-bar title crowded the action buttons.** `NoteEditorScreen` used `CenterAlignedTopAppBar`, but with six actions on the right (camera, attach, tag, favourite, save, more) the visually-centred title ended up pressed against the action cluster — users read it as "the title is on the right". Fix: swap the top bar for `TopAppBar` (Material 3's left-aligned variant) so "New"/"Edit" sits flush right of the back arrow on the left and the action cluster keeps the right edge. Import swap; no behavioural change for the actions or title text. **2. Colour chooser was not equally spaced.** The picker `Row` had `padding(vertical = 4.dp)` (4dp above + 4dp below), but the `OutlinedTextField` below it has an intrinsic top inset (~16dp) inside its border, so the perceived gap from the picker to the first line of the note dwarfed the gap from the title bar's bottom to the picker's top — to the user, "the picker is jammed up against the title bar". Fix: remove the row's `vertical = 4.dp` and bracket it with two explicit `Spacer(Modifier.height(12.dp))` siblings (one before the row, one after) so the picker sits 12dp from the title bar AND 12dp from the field's top border. The asymmetric `OutlinedTextField` internal padding is now matched on both sides of the picker, giving visually equal breathing room up and down. versionCode 27→28, versionName "0.3.6.0"→"0.3.6.1", SettingsViewModel.APP_VERSION bumped in lockstep. | +| 0.3.6.0 | 2026-08-19 | **Maintenance release** — share-into titles + encryption-key recovery. **1. Share webpages into Incido with a subject line.** `Intent.EXTRA_SUBJECT` from an inbound `ACTION_SEND` is now routed through `NoteEditorViewModel.initialSharedSubject` and prepended to the new note's content as a first line ("Page title") above the shared body/URL (already supported since v0.3.1.0). Browsers fill `EXTRA_SUBJECT` with the page title when the user shares a URL, so the resulting note reads naturally as a bookmark without ever leaving the device — fully offline, no `INTERNET` permission. **2. Export / Import encryption key.** New rows in Settings → Security expose the underlying AES-256 wrapping key as a passphrase-protected `.inckey` envelope (PBKDF2 200k iters + AES-GCM): "Export encryption key" writes the wrapped blob to a user-chosen SAF uri, "Import encryption key" reads it back, validates the passphrase, and atomically replaces the active key — with a clear warning dialog listing the consequences ("your existing encrypted notes will become unverifiable"). The 32-byte raw key never appears on screen or in logs; only the wrapped envelope crosses the SAF boundary. versionCode 26→27, versionName "0.3.5.1"→"0.3.6.0", SettingsViewModel.APP_VERSION bumped in lockstep. | | 0.3.5.1 | 2026-08-17 | **Emergency hotfix** — two UX bugs in v0.3.5.0. **1. "Encrypted" badge silently failed to appear on the first enable.** Audit found `EncryptionVerifier.checkNow()` early-returned with `if (_checking.value) return` whenever a verify-all was in flight. The startup pass launched from `AppContainer.init` could still be running when the user toggled Encrypt-at-rest in Settings; the post-migration re-check then silently dropped, the startup pass eventually wrote its stale (pre-encryption, empty verified-id) result back to the StateFlow, and the cards never earned the badge until the second toggle or a relaunch let a fresh check actually run. Fix: drop the `_checking` skip-guard and replace it with a `kotlinx.coroutines.sync.Mutex` that serializes checks in invocation order. Every `checkNow()` call now takes its turn and the last call's result wins, so the post-migration check always produces the fresh verified-id set; the startup pass is cheap (no encrypted rows yet → all skips) so user-triggered checks after a real migration only wait milliseconds. **2. "Encrypted" badge UX on note cards.** v0.3.5.0 rendered the indicator as a centred `Row` with a lock icon + "Encrypted" label at the card's bottom edge. Replace with a bare 14 dp `Lock` `Icon` sitting immediately to the LEFT of the timestamp inside the card's existing bottom Row — the row already uses `Alignment.CenterVertically`, so the icon is vertically centred with the date/time and lives in the same left-anchored position on every card regardless of card content (tag row, body preview, checklist summary). The icon keeps the existing `contentDescription = "Encrypted"`. versionCode 25→26, versionName "0.3.5.0"→"0.3.5.1", SettingsViewModel.APP_VERSION bumped in lockstep. | | 0.3.5.0 | 2026-08-17 | **Maintenance release** — real at-rest encryption, verified "Encrypted" badge, and screenshot blocking. **1. Real field-level encryption ("Encrypt in place" now works).** Audit of the v0.3.2.0 toggle found it was cosmetic: `ObjectBoxStore.init()` ignored the key (`@Suppress("UNUSED_PARAMETER")`), `AppContainer` always passed `encryptionKey = null`, and the OSS ObjectBox 4.0.3 `BoxStoreBuilder` exposes no encryption API at all (verified against the local artifact — page-level encryption is ObjectBox Sync/Pro only). Fix: application-layer field encryption. `NoteEntity` gains `cipherVersion` (0=plain, 1=AES-256-GCM) + `contentBlob`; `NoteAttachmentEntity` gains the same pair for `bytesBlob` — additive schema, auto-migrated. New `FieldCipher` abstraction in `:core:data` with `AesGcmFieldCipher` in `:composeApp` (fresh random 12-byte nonce per blob; GCM tag = integrity proof), keyed by the existing Keystore-wrapped 32-byte key from `ObjectBoxKeyProvider`. The repository consults a shared `CipherHolder` on every read/write (encrypt-on-write, decrypt-on-read, in-memory content search while encrypted); `NoteCryptoService` sweeps all rows in place with progress. Toggling encryption ON installs the cipher and encrypts every plaintext note + attachment row live (no restart); toggling OFF decrypts everything first, then removes the cipher and deletes the key; disabling Security entirely also runs the decrypt sweep so no data is orphaned. AES-256-GCM is the correct PQ-era choice for data at rest (NIST: Grover halves effective security → ~128-bit residual; no public-key crypto in this path). **2. Verified "Encrypted" badge on cards.** New `EncryptionVerifier` runs on every app open (and after each migration): full trial-decrypt of every `cipherVersion = 1` note row; the GCM auth tag passing is the proof of integrity. Only notes in the resulting verified-id set get a bottom-centre "Encrypted" label (with lock icon) on their card — never derived from the settings flag alone; rows that fail verification are reported and excluded. **3. Block screenshots toggle (default ON).** New `UserSettings.blockScreenshots` (DataStore-backed, defaults true); `MainActivity` applies/clears `FLAG_SECURE` from a startup snapshot + live settings-flow collection, blocking screenshots, screen recording, and app-switcher previews; Settings → Security gains the "Block screenshots" switch. Settings copy for encryption updated (no longer claims a restart is required). versionCode 24→25, versionName "0.3.4.0"→"0.3.5.0", SettingsViewModel.APP_VERSION bumped in lockstep. | | 0.3.4.0 | 2026-08-17 | **Maintenance release** — three changes. **1. Attachment indicator on note cards** — a paperclip icon (`Icons.Filled.AttachFile`) now appears on the right edge of every card whose note carries at least one attachment (any type — image, PDF, audio…). It is a non-interactive `Icon` (24 dp, `contentDescription = "Has attachments"`) aligned `Alignment.CenterEnd` with `padding(end = 16.dp)` so its glyph centre sits at 28 dp from the right edge — the same vertical column as the ⋮ overflow `IconButton` (top) and the favourite star (bottom), exactly halfway between them (both neighbours centre their 24 dp glyphs at 28 dp: 4 dp padding + 24 dp inside a 48 dp `IconButton`). Bare `Icon` rather than `IconButton` so it never intercepts the whole-card tap that opens the editor. **2. Light-theme readability over image thumbnails** — the card's 0.45-alpha black scrim always renders the background dark, but the overlay content kept the theme-driven colours, so in Light mode dark text sat on a dark photo (all but invisible). Fix: when a thumbnail is present every overlay switches to a forced light palette regardless of theme — title pure white; body preview, checklist summary, timestamp, ⋮ icon, unfilled star, paperclip and "+N" tag overflow white @ 85 %; hashtag chips white; favourited star a light amber (`#FFD54F`) so "favourited" stays distinguishable; the Card's `contentColor` is also set to white. Plain (no-thumbnail) cards are untouched and keep their existing tinted/surface colours. `HashtagRow` now takes caller-supplied `tagColor` / `overflowColor` params. **3. Auto-Lock = Immediate + file-picker hotfix** — with Auto-Lock set to "Immediately", attaching a file (paperclip → SAF picker), taking a photo (camera), opening an attachment in the system viewer, or exporting/importing a backup locked the app the moment the external activity returned: the picker backgrounds the Activity (`ON_STOP`), the return fires `ON_RESUME`, and the 0 ms timeout always re-locks. The lock gate then tore down the `NavHost` from composition, destroying the editor's `NavBackStackEntry` ViewModelStore — so the unsaved note vanished and the picker result never landed. Fix: `SecurityManager` gains an in-flight flag (`externalActivityInFlight`, `@Volatile`) set by a new `beginExternalActivity()` and consumed exactly once by `onAppForegrounded()`, which skips the re-lock check and clears `backgroundedAt` when the flag is set. Call sites: `NoteEditorScreen` (file picker launch, camera launch after permission grant, system-viewer `ACTION_VIEW` — `securityManager` threaded through `AttachmentStrip`/`AttachmentThumbnail`), `SettingsScreen` (backup export + import SAF launchers), with `IncidoApp` threading `resolvedSecurity` to both screens. Genuine background/foreground cycles still lock as configured; cold launch is unaffected (fresh process ⇒ flag always false). versionCode 23→24, versionName "0.3.3.8"→"0.3.4.0", SettingsViewModel.APP_VERSION bumped in lockstep. || 0.3.3.8 | 2026-08-17 | **Emergency hotfix** — the designed `incido.png` artwork (glass shield + fountain-pen nib) replaces the v0.1 placeholder launcher icon. The 2048×2048 source is downscaled (LANCZOS) into density-correct raster buckets: `mipmap-{mdpi…xxxhdpi}/ic_launcher.png` (48/72/96/144/192 px square) plus anti-aliased circular `ic_launcher_round.png` in the same buckets, and `drawable-{mdpi…xxxhdpi}/ic_launcher_foreground.png` (108/162/216/324/432 px) feeding the `mipmap-anydpi-v26` adaptive icons (`ic_launcher.xml` / `ic_launcher_round.xml`), whose stale `` placeholder reference is dropped and whose `ic_launcher_background` colour is re-tinted from `#6650A4` to the artwork's edge navy `#010435` so parallax exposure is seamless. The obsolete placeholder vector `drawable/ic_launcher_foreground.xml` is deleted; manifest `android:icon` / `android:roundIcon` references are unchanged. versionCode 22→23, versionName "0.3.3.7"→"0.3.3.8", SettingsViewModel.APP_VERSION bumped in lockstep. | diff --git a/README.md b/README.md index 8a3c6ac..435cddf 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Incido is a privacy-first, on-device note-taking application for Android. All data stays on your device by default — no accounts, no cloud, no trackers. -This repository contains the **v0.3.6.0** release: a single-user, offline +This repository contains the **v0.3.6.1** release: a single-user, offline note app with hashtags, favourites, full-text search, colour-coded notes, photo and file attachments, share-into from other apps and the web, at-rest AES-256-GCM encryption with screenshot blocking, PIN / @@ -15,7 +15,7 @@ encryption key for device migrations. The architecture is multi-module Android today and is structured so iOS / Desktop ports can happen later without UI rewrites. -**Current release:** v0.3.6.0 (see [Changelog](#changelog) below). +**Current release:** v0.3.6.1 (see [Changelog](#changelog) below). > **Version scheme (from v0.3.0.0 onwards):** `MAJOR.MINOR.MAINTENANCE.EMERGENCY` — > e.g. `0.3.0.0`. `MAJOR.MINOR.MAINTENANCE` are normal release numbers; @@ -106,6 +106,7 @@ cross-platform ports, end-to-end sync, and security features. | Version | Date | Highlights | |-----------|------------|------------| +| 0.3.6.1 | 2026-08-19 | **Editor top-bar title is now left-aligned.** On the New / Edit screen the title ("New" / "Edit") now sits next to the back arrow, away from the six action icons that crowd the right edge — it was previously centred via `CenterAlignedTopAppBar` and visually pushed toward the action cluster. **Colour picker is now symmetric between the title bar and the note top.** The picker is flanked by 12dp gaps above and below (was 4dp top + 4dp bottom) so the visual distance to the title bar matches the distance to the `OutlinedTextField`'s top edge, instead of being dwarfed by the field's intrinsic top inset. | | 0.3.6.0 | 2026-08-19 | **Share webpages to Incido.** Sharing a page from your browser (Share → Incido) now creates a note with the page title on the first line and the URL below — fully offline (the title comes from the browser's share data, Incido never touches the network). **Export encryption key.** Settings → Security gains "Export encryption key" — saves the AES-256 key that protects your encrypted notes to a passphrase-protected `.inckey` file for device migrations. **Import encryption key** restores that key on a fresh install, with a clear warning before the current key is replaced. | | 0.3.5.1 | 2026-08-17 | **"Encrypted" badge now appears the moment you flip the switch.** A race in `EncryptionVerifier.checkNow()` could silently drop the post-migration verification, leaving cards without the badge until a second toggle; replaced with a serializing Mutex so every check runs in invocation order. **"Encrypted" indicator is now a single lock icon next to the date** — consistent position on every card instead of a centred "lock + label" group at the bottom. | | 0.3.5.0 | 2026-08-17 | **Real at-rest encryption.** Note text and attachment bytes are now AES-256-GCM encrypted in place the moment you toggle "Encrypt notes at rest" — no restart required; keyed by the Keystore-wrapped 32-byte key. **Verified "Encrypted" badge.** Every encrypted note is trial-decrypted on app open and after each migration; only verified notes get the lock badge. **Block screenshots (default ON).** New toggle in Settings → Security prevents screenshots, screen recording, and app-switcher previews while Incido is open. | diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9e811cc..d81e146 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -28,17 +28,17 @@ android { applicationId = "org.incido.app" minSdk = 26 targetSdk = 35 - // v0.3.6.0: link-share titles + encryption-key recovery. - // - Shared URLs now seed the note with the page title (from - // the browser's EXTRA_SUBJECT) on the first line and the - // URL below — fully offline, no INTERNET permission. - // - New "Export / Import encryption key" rows in Settings → - // Security: back up the AES-256 key that protects your - // notes to a passphrase-protected .inckey file, and - // restore it on a fresh install. - // versionCode monotonic +1 from v0.3.5.1 (26). - versionCode = 27 - versionName = "0.3.6.0" + // v0.3.6.1: Emergency hotfix — editor screen UX. + // - Title in the editor's top bar now sits against the back + // arrow on the LEFT (was centred and crowding the six + // right-side action buttons). + // - Note colour chooser is now equally spaced between the + // title bar and the top edge of the note content (was + // dwarfed by the OutlinedTextField's intrinsic top inset, + // making the lower gap appear far larger). + // versionCode monotonic +1 from v0.3.6.0 (27). + versionCode = 28 + versionName = "0.3.6.1" } // --- Signing --- diff --git a/composeApp/src/main/kotlin/org/incido/compose/ui/editor/NoteEditorScreen.kt b/composeApp/src/main/kotlin/org/incido/compose/ui/editor/NoteEditorScreen.kt index 681925a..bf0038a 100644 --- a/composeApp/src/main/kotlin/org/incido/compose/ui/editor/NoteEditorScreen.kt +++ b/composeApp/src/main/kotlin/org/incido/compose/ui/editor/NoteEditorScreen.kt @@ -17,9 +17,11 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.ime import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size @@ -44,7 +46,6 @@ import androidx.compose.material.icons.filled.Tag import androidx.compose.material.icons.outlined.StarOutline import androidx.compose.material3.AlertDialog import androidx.compose.material3.AssistChip -import androidx.compose.material3.CenterAlignedTopAppBar import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.ExperimentalMaterial3Api @@ -59,6 +60,7 @@ import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SuggestionChip import androidx.compose.material3.Text import androidx.compose.material3.TextButton +import androidx.compose.material3.TopAppBar import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -282,7 +284,9 @@ fun NoteEditorScreen( contentWindowInsets = WindowInsets.systemBars.union(WindowInsets.ime), snackbarHost = { SnackbarHost(hostState = snackbarHost) }, topBar = { - CenterAlignedTopAppBar( + // v0.3.6.1 Emergency Patch: left-anchored title sits against the back arrow + // (CenterAlignedTopAppBar was crowded by the six right-side actions). + TopAppBar( title = { Text(if (state.isEditing) "Edit" else "New") }, navigationIcon = { IconButton(onClick = { tryClose() }) { @@ -367,10 +371,16 @@ fun NoteEditorScreen( .padding(padding), ) { // v0.3.0.1: colour picker centred horizontally. + // v0.3.6.1 Emergency Patch: equal 12dp Spacers above and below so + // the picker sits symmetrically between the title bar and the + // top edge of the note content (previously the row's + // `vertical = 4.dp` padding was dwarfed by the OutlinedTextField's + // intrinsic top inset, making the lower gap appear far larger). + androidx.compose.foundation.layout.Spacer(Modifier.height(12.dp)) Row( modifier = Modifier .fillMaxWidth() - .padding(horizontal = 16.dp, vertical = 4.dp), + .padding(horizontal = 16.dp), horizontalArrangement = Arrangement.spacedBy( space = 12.dp, alignment = Alignment.CenterHorizontally, @@ -384,6 +394,7 @@ fun NoteEditorScreen( ) } } + androidx.compose.foundation.layout.Spacer(Modifier.height(12.dp)) OutlinedTextField( value = state.content, diff --git a/composeApp/src/main/kotlin/org/incido/compose/ui/settings/SettingsViewModel.kt b/composeApp/src/main/kotlin/org/incido/compose/ui/settings/SettingsViewModel.kt index 22fa48b..8ebd945 100644 --- a/composeApp/src/main/kotlin/org/incido/compose/ui/settings/SettingsViewModel.kt +++ b/composeApp/src/main/kotlin/org/incido/compose/ui/settings/SettingsViewModel.kt @@ -333,7 +333,7 @@ class SettingsViewModel( /** The version string baked into backup payloads and shown on * the About card. Mirrors `app/build.gradle.kts` `versionName` * — if you bump one, bump both. */ - const val APP_VERSION = "0.3.6.0" + const val APP_VERSION = "0.3.6.1" val Factory: ViewModelProvider.Factory = viewModelFactory { initializer {