diff --git a/Incido Development Plan.txt b/Incido Development Plan.txt index bed94d6..2a63119 100644 --- a/Incido Development Plan.txt +++ b/Incido Development Plan.txt @@ -374,6 +374,7 @@ A short reference for AI assistants: | 0.2.0.0 | 2026-08-14 | Polish + first Keep-parity features. Discard-confirm dialog; release signing config (dev keystore). Favorites (renamed from Pinned Notes), full-text search, 6 colour-coded notes, inline GFM checklists (open/done counts). ObjectBox KMP migration deferred to v0.5 (tracked). | | 0.2.0.1 | 2026-08-14 | Hotfix: search-active flag folded into uiState so the search icon actually opens the field. | | 0.3.0.0 | 2026-08-14 | Hashtags (separate entity + cross-ref, 5-tag cap, autocomplete, persistent chips on editor, search() also matches tag names) + bolder colour accent (14 dp gradient stripe + tinted card background + corner chip) + nav drawer (Home / Favorites / Untagged + recent tags) + centred app-bar title + new version scheme adopted (validator in app/build.gradle.kts). | +| 0.3.0.1 | 2026-08-14 | Urgent UI polish: editor hashtag row moved to the bottom (and hidden when empty), `+ add` chip removed (use `#` icon in top bar), colour picker centred horizontally, list-card dog-ear colour accent replaces the small circle chip, list cards show a hashtag row (with `+N` abbreviation when capped). | --- diff --git a/README.md b/README.md index 3f0f549..e5bec3d 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ cross-platform ports, end-to-end sync, and security features. | 0.2.0.0 | 2026-08-14 | Polish + favourites, search, colours, checklists, discard dialog, release signing | | 0.2.0.1 | 2026-08-14 | Hotfix: search icon now actually opens the search bar | | 0.3.0.0 | 2026-08-14 | Hashtags (visible chips on editor, 5-tag cap, autocomplete) + bolder colour accent + nav drawer (Home / Favorites / Untagged + recent tags) + centred app-bar title + new version scheme | +| 0.3.0.1 | 2026-08-14 | Urgent UI polish: editor hashtag row moved to the bottom (and hidden when empty), `+ add` chip removed (use `#` icon in top bar), colour picker centred horizontally, list-card dog-ear colour accent replaces the small circle chip, list cards show a hashtag row (with `+N` abbreviation when capped). | --- diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6577954..6bb4b7a 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -28,8 +28,8 @@ android { applicationId = "org.incido.app" minSdk = 26 targetSdk = 35 - versionCode = 5 - versionName = "0.3.0.0" + versionCode = 6 + versionName = "0.3.0.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 f4bfadc..0d1097f 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 @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.Box 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.WindowInsets import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth @@ -17,12 +18,10 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.systemBars import androidx.compose.foundation.layout.union -import androidx.compose.foundation.lazy.LazyRow import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.ArrowBack -import androidx.compose.material.icons.filled.Add import androidx.compose.material.icons.filled.Close import androidx.compose.material.icons.filled.Delete import androidx.compose.material.icons.filled.Done @@ -32,7 +31,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.AssistChipDefaults import androidx.compose.material3.CenterAlignedTopAppBar import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenuItem @@ -57,6 +55,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.focus.FocusRequester @@ -211,25 +210,18 @@ fun NoteEditorScreen( .fillMaxSize() .padding(padding), ) { - HashtagChipRow( - tags = state.hashtags, - canAddMore = state.canAddMoreTags, - onAddClick = { viewModel.openAddTagSheet() }, - onRemove = { viewModel.removeTag(it) }, - ) - - // Colour-picker row above the editor text field. - LazyRow( + // v0.3.0.1: colour picker centred horizontally (was left-aligned + // LazyRow in v0.3.0.0). Six fixed entries → plain Row, no LazyRow. + Row( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp, vertical = 4.dp), - horizontalArrangement = Arrangement.spacedBy(12.dp), + horizontalArrangement = Arrangement.spacedBy( + space = 12.dp, + alignment = Alignment.CenterHorizontally, + ), ) { - items( - count = AllNoteColors.size, - key = { idx -> AllNoteColors[idx].storageKey.toInt() }, - ) { idx -> - val color = AllNoteColors[idx] + AllNoteColors.forEach { color -> ColorSwatch( color = color, selected = state.color == color, @@ -238,13 +230,16 @@ fun NoteEditorScreen( } } + // v0.3.0.1: text field takes remaining vertical space via + // weight(1f) instead of fillMaxSize() so the chip row below + // it stays visible at the bottom. OutlinedTextField( value = state.content, onValueChange = viewModel::onContentChange, modifier = Modifier - .fillMaxSize() + .weight(1f) + .fillMaxWidth() .padding(horizontal = 16.dp) - .padding(bottom = 16.dp) .focusRequester(focusRequester), placeholder = { Text("Write something…") }, keyboardOptions = KeyboardOptions( @@ -252,6 +247,15 @@ fun NoteEditorScreen( imeAction = ImeAction.Default, ), ) + + // v0.3.0.1: hashtag chip row now sits at the bottom of the + // editor. Hidden entirely when the note has no tags — the `#` + // icon in the top bar is the only way to add tags (no `+ add` + // chip anymore). + HashtagChipRow( + tags = state.hashtags, + onRemove = { viewModel.removeTag(it) }, + ) } } @@ -280,11 +284,12 @@ fun NoteEditorScreen( @Composable private fun HashtagChipRow( tags: List, - canAddMore: Boolean, - onAddClick: () -> Unit, onRemove: (String) -> Unit, ) { - if (tags.isEmpty() && !canAddMore) return + // v0.3.0.1: hide the row entirely when there are no hashtags. The + // user opens the add-tag sheet via the `#` icon in the top bar; the + // row only appears once at least one tag is present. + if (tags.isEmpty()) return FlowRow( modifier = Modifier .fillMaxWidth() @@ -292,13 +297,6 @@ private fun HashtagChipRow( horizontalArrangement = Arrangement.spacedBy(8.dp), verticalArrangement = Arrangement.spacedBy(4.dp), ) { - if (tags.isEmpty()) { - Text( - text = "Tags", - style = MaterialTheme.typography.labelLarge, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) - } tags.forEach { tag -> AssistChip( onClick = { onRemove(tag) }, @@ -308,21 +306,10 @@ private fun HashtagChipRow( }, ) } - if (canAddMore) { - AssistChip( - onClick = onAddClick, - label = { Text("+ add") }, - leadingIcon = { Icon(Icons.Filled.Add, contentDescription = null, modifier = Modifier.size(16.dp)) }, - colors = AssistChipDefaults.assistChipColors( - labelColor = MaterialTheme.colorScheme.primary, - leadingIconContentColor = MaterialTheme.colorScheme.primary, - ), - ) - } } } -@OptIn(ExperimentalMaterial3Api::class) +@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class) @Composable private fun AddTagSheet( tagInput: String, @@ -360,9 +347,8 @@ private fun AddTagSheet( style = MaterialTheme.typography.labelLarge, color = MaterialTheme.colorScheme.onSurfaceVariant, ) - LazyRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) { - items(count = suggestions.size, key = { idx -> suggestions[idx] }) { idx -> - val s = suggestions[idx] + FlowRow(horizontalArrangement = Arrangement.spacedBy(8.dp)) { + suggestions.forEach { s -> SuggestionChip( onClick = { onPickSuggestion(s) }, label = { Text("#$s") }, diff --git a/composeApp/src/main/kotlin/org/incido/compose/ui/notelist/NoteListScreen.kt b/composeApp/src/main/kotlin/org/incido/compose/ui/notelist/NoteListScreen.kt index 68bbd3e..7f3dd47 100644 --- a/composeApp/src/main/kotlin/org/incido/compose/ui/notelist/NoteListScreen.kt +++ b/composeApp/src/main/kotlin/org/incido/compose/ui/notelist/NoteListScreen.kt @@ -4,6 +4,8 @@ import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -13,7 +15,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items -import androidx.compose.foundation.shape.CircleShape +import androidx.compose.foundation.shape.GenericShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Add import androidx.compose.material.icons.filled.CheckBox @@ -41,9 +43,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Brush -import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.lerp import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp @@ -55,6 +55,19 @@ import org.incido.domain.model.Note import org.incido.domain.model.NoteColor import org.incido.domain.model.NoteFilter +/** + * Right-triangle that fills the top-right corner of its bounds — a + * "dog-ear" / folded-page effect used to mark the note's colour. + */ +private val DogEarShape = GenericShape { size, _ -> + // Right-triangle anchored to the top-right corner: vertices at + // (0, 0), (size.width, 0), (size.width, size.height). + moveTo(0f, 0f) + lineTo(size.width, 0f) + lineTo(size.width, size.height) + close() +} + @OptIn(ExperimentalMaterial3Api::class) @Composable fun NoteListScreen( @@ -66,7 +79,6 @@ fun NoteListScreen( val state by viewModel.uiState.collectAsStateWithLifecycle() var localQuery by remember { mutableStateOf("") } - // Keep the ViewModel in sync with the parent's filter selection. LaunchedEffect(filterMode) { viewModel.setFilter(filterMode) } Scaffold( @@ -84,14 +96,13 @@ fun NoteListScreen( if (state.isSearchActive) viewModel.closeSearch() else viewModel.openSearch() localQuery = "" }) { - Icon(Icons.Filled.Search, contentDescription = "Search notes") + Icon(Icons.Default.Search, contentDescription = "Search notes") } } }, ) }, floatingActionButton = { - // FAB only on Home — adding notes while filtered makes less sense. if (filterMode == NoteFilter.Home) { FloatingActionButton(onClick = { onOpenEditor(null) }) { Icon(Icons.Default.Add, contentDescription = "New note") @@ -209,11 +220,14 @@ private fun NoteList( } /** - * v0.3.0.0 card redesign — three-layer colour accent so notes of - * different colours are visually distinct at a glance: - * 1. 14 dp vertical gradient stripe down the left edge. - * 2. Tinted card surface (12 % colour blend over the M3 surface). - * 3. 10 dp solid colour chip in the top-right corner. + * v0.3.0.1 card layout: + * - 14 dp vertical gradient stripe down the left edge + * - Tinted card surface (12 % colour blend over the M3 surface) + * - Dog-ear colour accent in the top-right corner (replaces the old + * circle chip next to the star) + * - Title + body preview + checklist summary + hashtag row + + * timestamp / delete + * - Hashtag row is hidden entirely when the note has no tags. */ @Composable private fun NoteCard( @@ -228,122 +242,155 @@ private fun NoteCard( val noteColor = note.color val hasColor = noteColor != NoteColor.NONE - Card( - onClick = onClick, - modifier = Modifier.fillMaxWidth(), - colors = if (hasColor) { - val tint = noteColor.toComposeColor() - val surface = MaterialTheme.colorScheme.surface - CardDefaults.cardColors( - containerColor = lerp(surface, tint, 0.12f), - ) - } else { - CardDefaults.cardColors() - }, - ) { - Row(modifier = Modifier.fillMaxWidth()) { - if (hasColor) { - // Layer 1: 14 dp gradient stripe. - Box( - modifier = Modifier - .size(width = 14.dp, height = 110.dp) - .background( - Brush.verticalGradient( - colors = listOf( - noteColor.toComposeColor().copy(alpha = 0.95f), - noteColor.toComposeColor().copy(alpha = 0.05f), - ), - ) - ), + Box(modifier = Modifier.fillMaxWidth()) { + Card( + onClick = onClick, + modifier = Modifier.fillMaxWidth(), + colors = if (hasColor) { + val tint = noteColor.toComposeColor() + val surface = MaterialTheme.colorScheme.surface + CardDefaults.cardColors( + containerColor = lerp(surface, tint, 0.12f), ) - } - Column(modifier = Modifier.padding(16.dp).fillMaxWidth()) { - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - ) { - Text( - text = title, - style = MaterialTheme.typography.titleMedium, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - modifier = Modifier.weight(1f), - ) - // Layer 3: top-right colour chip (only when coloured). - if (hasColor) { - Box( - modifier = Modifier - .size(10.dp) - .clip(CircleShape) - .background(noteColor.toComposeColor()), - ) - Spacer(modifier = Modifier.size(8.dp)) - } - IconButton(onClick = onToggleFavorite) { - Icon( - imageVector = if (note.isFavorite) Icons.Filled.Star else Icons.Outlined.StarOutline, - contentDescription = if (note.isFavorite) "Unfavorite" else "Favorite", - tint = if (note.isFavorite) MaterialTheme.colorScheme.primary - else MaterialTheme.colorScheme.onSurfaceVariant, - ) - } - } - if (bodyPreview.isNotEmpty()) { - Spacer(modifier = Modifier.padding(top = 4.dp)) - Text( - text = bodyPreview, - style = MaterialTheme.typography.bodyMedium, - color = MaterialTheme.colorScheme.onSurfaceVariant, - maxLines = 2, - overflow = TextOverflow.Ellipsis, + } else { + CardDefaults.cardColors() + }, + ) { + Row(modifier = Modifier.fillMaxWidth()) { + if (hasColor) { + Box( + modifier = Modifier + .size(width = 14.dp, height = 110.dp) + .background( + Brush.verticalGradient( + colors = listOf( + noteColor.toComposeColor().copy(alpha = 0.95f), + noteColor.toComposeColor().copy(alpha = 0.05f), + ), + ) + ), ) } - if (checklistSummary.isNotEmpty()) { - Spacer(modifier = Modifier.padding(top = 4.dp)) - Row(verticalAlignment = Alignment.CenterVertically) { - Icon( - Icons.Default.CheckBox, - contentDescription = null, - modifier = Modifier.size(14.dp), - tint = MaterialTheme.colorScheme.onSurfaceVariant, - ) - Spacer(modifier = Modifier.size(6.dp)) + Column(modifier = Modifier.padding(16.dp).fillMaxWidth()) { + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + ) { Text( - text = checklistSummary, + text = title, + style = MaterialTheme.typography.titleMedium, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + modifier = Modifier.weight(1f), + ) + // v0.3.0.1: small circle chip removed — the + // dog-ear below is now the colour indicator. + IconButton(onClick = onToggleFavorite) { + Icon( + imageVector = if (note.isFavorite) Icons.Filled.Star else Icons.Outlined.StarOutline, + contentDescription = if (note.isFavorite) "Unfavorite" else "Favorite", + tint = if (note.isFavorite) MaterialTheme.colorScheme.primary + else MaterialTheme.colorScheme.onSurfaceVariant, + ) + } + } + if (bodyPreview.isNotEmpty()) { + Spacer(modifier = Modifier.padding(top = 4.dp)) + Text( + text = bodyPreview, + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.onSurfaceVariant, + maxLines = 2, + overflow = TextOverflow.Ellipsis, + ) + } + if (checklistSummary.isNotEmpty()) { + Spacer(modifier = Modifier.padding(top = 4.dp)) + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + Icons.Default.CheckBox, + contentDescription = null, + modifier = Modifier.size(14.dp), + tint = MaterialTheme.colorScheme.onSurfaceVariant, + ) + Spacer(modifier = Modifier.size(6.dp)) + Text( + text = checklistSummary, + style = MaterialTheme.typography.labelSmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + } + } + if (note.hashtags.isNotEmpty()) { + Spacer(modifier = Modifier.padding(top = 4.dp)) + HashtagRow(hashtags = note.hashtags) + } + Spacer(modifier = Modifier.padding(top = 8.dp)) + Row( + modifier = Modifier.fillMaxWidth(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween, + ) { + Text( + text = rememberRelativeTimestamp(note.updatedAt), style = MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurfaceVariant, ) - } - } - Spacer(modifier = Modifier.padding(top = 8.dp)) - Row( - modifier = Modifier.fillMaxWidth(), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween, - ) { - Text( - text = rememberRelativeTimestamp(note.updatedAt), - style = MaterialTheme.typography.labelSmall, - color = MaterialTheme.colorScheme.onSurfaceVariant, - ) - IconButton(onClick = onDelete) { - Icon( - Icons.Default.Delete, - contentDescription = "Delete note", - tint = MaterialTheme.colorScheme.onSurfaceVariant, - ) + IconButton(onClick = onDelete) { + Icon( + Icons.Default.Delete, + contentDescription = "Delete note", + tint = MaterialTheme.colorScheme.onSurfaceVariant, + ) + } } } } } + + // v0.3.0.1: dog-ear colour accent overlays the top-right corner. + if (hasColor) { + Box( + modifier = Modifier + .align(Alignment.TopEnd) + .size(28.dp) + .background( + color = noteColor.toComposeColor(), + shape = DogEarShape, + ), + ) + } } } -// --- Lightweight imports used to avoid shadowed-name conflicts in -// other files that might also import these symbols --- -@Suppress("unused") -private fun clip(@Suppress("UNUSED_PARAMETER") shape: androidx.compose.ui.graphics.Shape): Modifier = - Modifier.clip(shape) - -@Suppress("unused") -private fun background(color: Color): Modifier = Modifier.background(color) +/** + * v0.3.0.1: hashtag list on the card. Shows up to three tags as a + * compact FlowRow of label-styled text; if there are more, renders a + * "+N" abbreviation indicator. Hidden entirely by the caller when + * [hashtags] is empty. + */ +@OptIn(ExperimentalLayoutApi::class) +@Composable +private fun HashtagRow(hashtags: List) { + val visible = hashtags.take(3) + val overflow = hashtags.size - visible.size + FlowRow( + horizontalArrangement = Arrangement.spacedBy(6.dp), + verticalArrangement = Arrangement.spacedBy(2.dp), + ) { + visible.forEach { tag -> + Text( + text = "#$tag", + style = MaterialTheme.typography.labelSmall, + color = MaterialTheme.colorScheme.primary, + ) + } + if (overflow > 0) { + Text( + text = "+$overflow", + style = MaterialTheme.typography.labelSmall, + color = MaterialTheme.colorScheme.onSurfaceVariant, + ) + } + } +}