fix: align select-all behavior and board-detail docs with filters

This commit is contained in:
2026-03-16 16:03:47 -04:00
parent dc493f5037
commit e6f47034bc
4 changed files with 25 additions and 9 deletions

View File

@@ -97,12 +97,16 @@ Kanbn4Droid is an unofficial app to connect to and manipulate data stored in sel
- Pressing "Delete" in the modal dialog MUST show a second confirmation modal asking if the user is sure, with buttons for "Cancel" and "I'm sure".
- Only on pressing "I'm sure" in the second confirmation modal dialog should a board delete request be sent to the API.
- Long-pressing any of the buttons must show a tooltip with the button name.
- The view has a floating + button that shows a modal dialog that allows creating a new card using the Kan.bn API.
- The new card is added to the top of the currently shown list.
- The modal dialog has a field for the card's name. This field is mandatory
- Below the card name field there is a markdown-enabled text area for an optional card description.
- Below the card description field there is an optional date field to set the card's due date.
- Below the card's due date field there is an optional multi-value selector that allows choosing the card's tags from the tags available for the current board.
- The view has a floating + button that allows choosing between two options: "Add new list", "Add new card"
- The Add new list option shows a modal dialog that asks for a list title. The modal dialog has two buttons at the bottom for "Cancel" and "Create"
- The list is created using the Kan.bn API.
- The new list is added at the end of the lists in the current board after the current last list.
- The Add new card option shows a modal dialog for creating a new card using the Kan.bn API.
- The new card is added to the top of the currently shown list.
- The modal dialog has a field for the card's name. This field is mandatory
- Below the card name field there is a markdown-enabled text area for an optional card description.
- Below the card description field there is an optional date field to set the card's due date.
- Below the card's due date field there is an optional multi-value selector that allows choosing the card's tags from the tags available for the current board.
- The title bar of the view has two icon-only buttons for "Filter by tag" (icon is three bars of decreasing width, widest on top) and "Search" (icon is a leaning looking glass)
- The filter by tag button opens a modal dialog that shows a multi-value selector that allows choosing from the tags available on the current board. The modal has a title that says "Filter by tag". The modal has buttons for "Cancel" and "Filter".
- The search button a modal dialog that shows a text field that has the placeholder value "Search". The modal has a title that seas "Search by title". The modal has buttons for "Cancel" and "Search".

View File

@@ -148,7 +148,7 @@ class BoardDetailViewModel(
fun selectAllOnCurrentPage() {
val current = _uiState.value
val pageCards = current.boardDetail
val pageCards = current.filteredBoardDetail
?.lists
?.getOrNull(current.currentPageIndex)
?.cards

View File

@@ -66,6 +66,6 @@
<string name="due_date">Due date</string>
<string name="clear_due_date">Clear date</string>
<string name="add_card_tags">Tags</string>
<string name="add_card_tags_placeholder">Tag selector will be wired in the next task.</string>
<string name="filter_tags_placeholder">Tag selector will be wired in the next task.</string>
<string name="add_card_tags_placeholder">Select one or more tags.</string>
<string name="filter_tags_placeholder">Select tags to include.</string>
</resources>

View File

@@ -51,6 +51,18 @@ class BoardDetailViewModelTest {
assertEquals(setOf("card-1", "card-2", "card-3"), viewModel.uiState.value.selectedCardIds)
}
@Test
fun selectAllWithActiveFilter_selectsOnlyVisibleCardsOnCurrentPage() = runTest {
val viewModel = newLoadedViewModel(this, FakeBoardDetailDataSource(), detailWithFilterFixture())
viewModel.openFilterDialog()
viewModel.updatePendingTagFilterIds(setOf("tag-b"))
viewModel.applyFilterDialog()
viewModel.selectAllOnCurrentPage()
assertEquals(setOf("card-2"), viewModel.uiState.value.selectedCardIds)
}
@Test
fun backPressWithSelection_clearsSelectionAndReturnsTrue() = runTest {
val viewModel = newLoadedViewModel(this, FakeBoardDetailDataSource(), detailWithTwoLists())