Skip to content

Commit 0497ce3

Browse files
authored
Merge pull request #4403 from CruGlobal/settingsRestructure
Restructure settings UI package hierarchy
2 parents b6eca20 + 8639474 commit 0497ce3

86 files changed

Lines changed: 105 additions & 157 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/record-screenshots/SKILL.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,26 @@ If there are multiple candidates at any step, show them and ask the user which c
9797

9898
### 7. Apply the snapshot changes locally
9999

100-
Stage the snapshot files from the remote commit:
100+
The CI commit may add new snapshots, delete old ones (e.g. when a package was renamed), or both. Handle all cases:
101101

102102
```bash
103-
# Get the list of files changed by the screenshot commit
103+
# Get the full diff between local HEAD and the remote screenshot commit
104104
git diff --name-only HEAD origin/<branch>
105+
git diff --name-status HEAD origin/<branch>
106+
```
107+
108+
For files marked **A** (added) or **M** (modified) — stage them at the remote version:
109+
```bash
110+
git checkout origin/<branch> -- <file> [<file> ...]
111+
```
105112

106-
# Stage those files at the remote version
107-
git checkout origin/<branch> -- $(git diff --name-only HEAD origin/<branch>)
113+
For files marked **D** (deleted) — remove them:
114+
```bash
115+
git rm <file> [<file> ...]
108116
```
109117

118+
Do not use a single `git checkout origin/<branch> -- $(git diff --name-only ...)` shortcut, as it cannot handle deletions (checking out a deleted file would re-create it instead of removing it).
119+
110120
### 8. Create a fixup commit
111121

112122
```bash

app/src/main/kotlin/org/cru/godtools/ui/languages/LanguageName+Previews.kt renamed to app/src/main/kotlin/org/cru/godtools/ui/common/LanguageName+Previews.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.cru.godtools.ui.languages
1+
package org.cru.godtools.ui.common
22

33
import androidx.compose.foundation.layout.Column
44
import androidx.compose.material3.HorizontalDivider

app/src/main/kotlin/org/cru/godtools/ui/languages/LanguageName.kt renamed to app/src/main/kotlin/org/cru/godtools/ui/common/LanguageName.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.cru.godtools.ui.languages
1+
package org.cru.godtools.ui.common
22

33
import androidx.compose.runtime.Composable
44
import androidx.compose.runtime.remember

app/src/main/kotlin/org/cru/godtools/ui/languages/LocalizedName.kt renamed to app/src/main/kotlin/org/cru/godtools/ui/common/LocalizedName.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.cru.godtools.ui.languages
1+
package org.cru.godtools.ui.common
22

33
import androidx.compose.foundation.text.InlineTextContent
44
import androidx.compose.foundation.text.appendInlineContent
@@ -17,7 +17,7 @@ import androidx.compose.ui.text.style.TextOverflow
1717
import androidx.compose.ui.text.withStyle
1818
import androidx.compose.ui.unit.sp
1919

20-
private const val LANGUAGE_NAME_GAP = "[gap]"
20+
private const val NAME_GAP = "[gap]"
2121

2222
@Composable
2323
internal fun LocalizedName(name: String, secondName: String, modifier: Modifier = Modifier) {
@@ -28,15 +28,15 @@ internal fun LocalizedName(name: String, secondName: String, modifier: Modifier
2828
remember(name, secondName, color, secondNameColor) {
2929
buildAnnotatedString {
3030
withStyle(SpanStyle(color = color)) { append(name) }
31-
appendInlineContent(LANGUAGE_NAME_GAP, " ")
31+
appendInlineContent(NAME_GAP, " ")
3232
withStyle(SpanStyle(color = secondNameColor)) { append(secondName) }
3333
}
3434
},
3535
maxLines = 1,
3636
overflow = TextOverflow.Ellipsis,
3737
inlineContent = remember {
3838
mapOf(
39-
LANGUAGE_NAME_GAP to InlineTextContent(
39+
NAME_GAP to InlineTextContent(
4040
Placeholder(
4141
width = 8.sp,
4242
height = 1.sp,

app/src/main/kotlin/org/cru/godtools/ui/dashboard/lessons/LessonFilters.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import androidx.compose.ui.res.stringResource
1313
import androidx.compose.ui.unit.dp
1414
import org.cru.godtools.R
1515
import org.cru.godtools.base.LocalAppLanguage
16+
import org.cru.godtools.ui.common.LanguageName
1617
import org.cru.godtools.ui.dashboard.filters.LazyFilterMenu
17-
import org.cru.godtools.ui.languages.LanguageName
1818

1919
@Composable
2020
@OptIn(ExperimentalLayoutApi::class)

app/src/main/kotlin/org/cru/godtools/ui/dashboard/tools/ToolFilters.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ import org.cru.godtools.R
3232
import org.cru.godtools.base.LocalAppLanguage
3333
import org.cru.godtools.base.ui.util.getToolCategoryName
3434
import org.cru.godtools.model.Language
35+
import org.cru.godtools.ui.common.LanguageName
3536
import org.cru.godtools.ui.dashboard.filters.FilterMenu
3637
import org.cru.godtools.ui.dashboard.filters.FilterMenuItem
3738
import org.cru.godtools.ui.dashboard.filters.LazyFilterMenu
3839
import org.cru.godtools.ui.dashboard.tools.ToolFiltersStateProducer.Filters
39-
import org.cru.godtools.ui.languages.LanguageName
4040
import org.jetbrains.annotations.VisibleForTesting
4141

4242
private val DROPDOWN_MAX_HEIGHT = 700.dp

app/src/main/kotlin/org/cru/godtools/ui/drawer/DrawerMenuLayout.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ import org.cru.godtools.ui.account.delete.DeleteAccountScreen
6868
import org.cru.godtools.ui.account.startAccountActivity
6969
import org.cru.godtools.ui.drawer.DrawerMenuScreen.Event
7070
import org.cru.godtools.ui.drawer.DrawerMenuScreen.State
71-
import org.cru.godtools.ui.languages.LanguageSettingsScreen
72-
import org.cru.godtools.ui.languages.country.CountrySettingsScreen
7371
import org.cru.godtools.ui.login.startLoginActivity
72+
import org.cru.godtools.ui.settings.country.CountrySettingsScreen
73+
import org.cru.godtools.ui.settings.language.LanguageSettingsScreen
7474

7575
@Composable
7676
fun DrawerMenuLayout(

app/src/main/kotlin/org/cru/godtools/ui/languages/LanguageSettingsViewModel.kt

Lines changed: 0 additions & 43 deletions
This file was deleted.

app/src/main/kotlin/org/cru/godtools/ui/languages/country/CountrySettingsConfirmationOverlay.kt renamed to app/src/main/kotlin/org/cru/godtools/ui/settings/country/CountrySettingsConfirmationOverlay.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.cru.godtools.ui.languages.country
1+
package org.cru.godtools.ui.settings.country
22

33
import androidx.compose.material3.AlertDialog
44
import androidx.compose.material3.ExperimentalMaterial3Api

app/src/main/kotlin/org/cru/godtools/ui/languages/country/CountrySettingsLayout.kt renamed to app/src/main/kotlin/org/cru/godtools/ui/settings/country/CountrySettingsLayout.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.cru.godtools.ui.languages.country
1+
package org.cru.godtools.ui.settings.country
22

33
import androidx.compose.foundation.background
44
import androidx.compose.foundation.clickable
@@ -44,9 +44,9 @@ import kotlinx.coroutines.launch
4444
import org.ccci.gto.android.common.compose.foundation.layout.padding
4545
import org.cru.godtools.R
4646
import org.cru.godtools.base.ui.theme.GodToolsTheme
47-
import org.cru.godtools.ui.languages.LocalizedName
48-
import org.cru.godtools.ui.languages.country.CountrySettingsPresenter.UiEvent
49-
import org.cru.godtools.ui.languages.country.CountrySettingsPresenter.UiState
47+
import org.cru.godtools.ui.common.LocalizedName
48+
import org.cru.godtools.ui.settings.country.CountrySettingsPresenter.UiEvent
49+
import org.cru.godtools.ui.settings.country.CountrySettingsPresenter.UiState
5050

5151
internal const val TEST_TAG_ACTION_BACK = "action_navigate_back"
5252
internal const val TEST_TAG_CANCEL_SEARCH = "action_cancel_search"

0 commit comments

Comments
 (0)