Skip to content

Commit e29796e

Browse files
committed
feat: add text search across all note versions
Filter the note versions dialog by version content, show match counts and highlighted excerpts, and step through highlighted matches in the preview.
1 parent 3b05618 commit e29796e

14 files changed

Lines changed: 534 additions & 24 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Search the text of all note versions from the note versions dialog. Only versions containing
13+
the search are listed, each with its match count and a highlighted excerpt; the preview
14+
highlights every match and lets you step between them.
15+
1016
## [1.7.0] - 2026-10-25
1117

1218
### Added

‎app/src/androidTest/kotlin/org/qownnotes/mobile/AppLaunchTest.kt‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,52 @@ class AppLaunchTest {
14021402
}
14031403
}
14041404

1405+
@Test
1406+
fun searchesTextAcrossNoteVersionsAndRestoresAMatch() {
1407+
importAccount("alice", "Existing note", "etag-1", 10, "Current content")
1408+
application.fakeBackend.noteVersions = listOf(
1409+
RemoteNoteVersion(3, "Wednesday", "Plain todo list"),
1410+
RemoteNoteVersion(2, "Tuesday", "Buy apples and bananas, then more Bananas"),
1411+
RemoteNoteVersion(1, "Monday", "Buy apples")
1412+
)
1413+
composeRule.onNodeWithText("Existing note").performClick()
1414+
composeRule.openNoteMenu()
1415+
composeRule.onNodeWithTag("note-versions").performClick()
1416+
composeRule.waitForText("Plain todo list")
1417+
1418+
composeRule.onNodeWithTag("note-version-search").performTextInput("banana")
1419+
composeRule.waitForTagToGo("note-version-3")
1420+
composeRule.onNodeWithTag("note-version-1").assertDoesNotExist()
1421+
composeRule.onNodeWithTag("note-version-2").assertIsDisplayed()
1422+
composeRule.onNodeWithTag("note-version-search-summary")
1423+
.assertTextContains("2 matches in 1 of 3 versions")
1424+
composeRule.onNodeWithTag("note-version-match-position").assertTextEquals("1 of 2")
1425+
composeRule.onNodeWithTag("note-version-next-match").performClick()
1426+
composeRule.onNodeWithTag("note-version-match-position").assertTextEquals("2 of 2")
1427+
composeRule.onNodeWithTag("note-version-next-match").performClick()
1428+
composeRule.onNodeWithTag("note-version-match-position").assertTextEquals("1 of 2")
1429+
1430+
composeRule.onNodeWithTag("note-version-search").performTextInput("s kiwi")
1431+
composeRule.waitForTag("note-version-search-empty")
1432+
composeRule.onNodeWithTag("restore-note-version").assertIsNotEnabled()
1433+
1434+
composeRule.onNodeWithTag("clear-note-version-search").performClick()
1435+
composeRule.waitForTag("note-version-3")
1436+
composeRule.onNodeWithTag("note-version-1").assertIsDisplayed()
1437+
composeRule.onNodeWithTag("note-version-2").assertIsSelected()
1438+
composeRule.onNodeWithText("Buy apples and bananas, then more Bananas").assertIsDisplayed()
1439+
1440+
composeRule.onNodeWithTag("note-version-search").performTextInput("apples")
1441+
composeRule.waitForTagToGo("note-version-3")
1442+
composeRule.onNodeWithTag("note-version-1").performClick()
1443+
composeRule.onNodeWithTag("restore-note-version").performClick()
1444+
composeRule.onNodeWithTag("confirm-restore-note-version").performClick()
1445+
1446+
composeRule.waitUntil(timeoutMillis = 10_000) {
1447+
runBlocking { notesOf("alice").single().content == "Buy apples" }
1448+
}
1449+
}
1450+
14051451
@Test
14061452
fun viewsAndRestoresRemoteTrash() {
14071453
importAccount("alice", "Existing note", "etag-1", 10)

0 commit comments

Comments
 (0)