fix: align select-all behavior and board-detail docs with filters
This commit is contained in:
16
AGENTS.md
16
AGENTS.md
@@ -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".
|
- 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.
|
- 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.
|
- 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 view has a floating + button that allows choosing between two options: "Add new list", "Add new card"
|
||||||
- The new card is added to the top of the currently shown list.
|
- 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 modal dialog has a field for the card's name. This field is mandatory
|
- The list is created using the Kan.bn API.
|
||||||
- Below the card name field there is a markdown-enabled text area for an optional card description.
|
- The new list is added at the end of the lists in the current board after the current last list.
|
||||||
- Below the card description field there is an optional date field to set the card's due date.
|
- The Add new card option shows a modal dialog for creating a new card using the Kan.bn API.
|
||||||
- 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 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 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 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".
|
- 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".
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ class BoardDetailViewModel(
|
|||||||
|
|
||||||
fun selectAllOnCurrentPage() {
|
fun selectAllOnCurrentPage() {
|
||||||
val current = _uiState.value
|
val current = _uiState.value
|
||||||
val pageCards = current.boardDetail
|
val pageCards = current.filteredBoardDetail
|
||||||
?.lists
|
?.lists
|
||||||
?.getOrNull(current.currentPageIndex)
|
?.getOrNull(current.currentPageIndex)
|
||||||
?.cards
|
?.cards
|
||||||
|
|||||||
@@ -66,6 +66,6 @@
|
|||||||
<string name="due_date">Due date</string>
|
<string name="due_date">Due date</string>
|
||||||
<string name="clear_due_date">Clear date</string>
|
<string name="clear_due_date">Clear date</string>
|
||||||
<string name="add_card_tags">Tags</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="add_card_tags_placeholder">Select one or more tags.</string>
|
||||||
<string name="filter_tags_placeholder">Tag selector will be wired in the next task.</string>
|
<string name="filter_tags_placeholder">Select tags to include.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -51,6 +51,18 @@ class BoardDetailViewModelTest {
|
|||||||
assertEquals(setOf("card-1", "card-2", "card-3"), viewModel.uiState.value.selectedCardIds)
|
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
|
@Test
|
||||||
fun backPressWithSelection_clearsSelectionAndReturnsTrue() = runTest {
|
fun backPressWithSelection_clearsSelectionAndReturnsTrue() = runTest {
|
||||||
val viewModel = newLoadedViewModel(this, FakeBoardDetailDataSource(), detailWithTwoLists())
|
val viewModel = newLoadedViewModel(this, FakeBoardDetailDataSource(), detailWithTwoLists())
|
||||||
|
|||||||
Reference in New Issue
Block a user