-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix: show all personal spaces in filter on multi-personal (Kiteworks) accounts #4922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mvanhorn
wants to merge
2
commits into
owncloud:master
Choose a base branch
from
mvanhorn:fix/4674-kiteworks-space-filter
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+54
−9
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Bugfix: Fix spaces search on Kiteworks accounts | ||
|
|
||
| All matching personal spaces have been included in the spaces search filter for multi-personal accounts. | ||
|
|
||
| https://github.com/owncloud/android/issues/4674 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
owncloudApp/src/test/java/com/owncloud/android/presentation/spaces/SpacesListFragmentTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /** | ||
| * ownCloud Android client application | ||
| * | ||
| * @author Matt Van Horn | ||
| * Copyright (C) 2026 ownCloud GmbH. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License version 2, | ||
| * as published by the Free Software Foundation. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package com.owncloud.android.presentation.spaces | ||
|
|
||
| import com.owncloud.android.testutil.OC_SPACE_PERSONAL | ||
| import org.junit.Assert.assertEquals | ||
| import org.junit.Test | ||
|
|
||
| class SpacesListFragmentTest { | ||
| @Test | ||
| fun `filterSpaces filters multi-personal names and preserves single-personal pinning`() { | ||
| val personalSpaces = listOf(OC_SPACE_PERSONAL.copy(name = "Alice Personal"), OC_SPACE_PERSONAL.copy(name = "Bob Personal")) | ||
| val singlePersonalSpaces = listOf(OC_SPACE_PERSONAL.copy(name = "Project Personal")) | ||
| assertEquals(personalSpaces, personalSpaces.filterSpaces("personal", true) { true }) | ||
| assertEquals(listOf(personalSpaces[0]), personalSpaces.filterSpaces("alice", true) { true }) | ||
| assertEquals(singlePersonalSpaces, singlePersonalSpaces.filterSpaces("project", false) { true }) | ||
| } | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage: 0% on this branch — below the 85% gate. I searched the repo (no local checkout, used GitHub code search) and confirmed there is no
SpacesListFragmentTest, noSpacesListViewModelTest, and no reference tosearchFilter/isMultiPersonalanywhere insrc/testorsrc/androidTest. The PR description only lists manual QA steps.Root cause: the new
isMultiPersonalbranch (and the personal-space pinning it now skips) lives inline inside aFragmentlambda, and this codebase has no precedent for unit-testing Fragments directly (Robolectric isn't wired intoowncloudApp; the existing pattern is plain JUnit4 + MockK against ViewModels, seeowncloudApp/src/test/java/.../viewmodels/*ViewModelTest.kt).Suggested fix — extract to a pure, testable function so this exact branch can be unit tested without Robolectric:
SpacesListFragmentwould then callSpacesFilter.filterSpaces(uiState.spaces, uiState.searchFilter, isMultiPersonal) { shouldShowDisabledSpace(it) }. Proposed test (owncloudApp/src/test/java/com/owncloud/android/presentation/spaces/SpacesFilterTest.kt), covering multi-personal multi-match, single-personal pinning, no-match, and empty-filter cases:This also resolves the MVVM nit below: filtering is business logic and reads better as a pure function than inline in the Fragment's flow collector.
Generated by Claude Code