S-22 About: remove the open-source licences row (OQ-5 answered no; D-099)

AboutScreen loses onOpenLicences, AboutActions its onOpenLicences, the
:app call site its no-op lambda. settings_about_licences was unused in
every module afterwards and is dropped from both strings.xml files and
docs/ux/strings.csv. The 24 S-22 goldens are re-recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
This commit is contained in:
2026-10-18 21:25:36 +02:00
parent 75b549fb4f
commit a0c25b0db5
5 changed files with 5 additions and 41 deletions
@@ -380,8 +380,7 @@ private fun NavGraphBuilder.settings(shell: Shell, updateCheckAvailable: Boolean
composable(Routes.DEVICES) { DevicesScreen(onBack = shell::back) }
composable(Routes.INVITES) { InvitesScreen(onBack = shell::back) }
composable(Routes.ABOUT) {
// The open-source licences screen does not exist yet (no strings for it outside :app; M8 report).
AboutScreen(onBack = shell::back, onOpenLicences = {}, updateCheckAvailable = updateCheckAvailable)
AboutScreen(onBack = shell::back, updateCheckAvailable = updateCheckAvailable)
}
}
@@ -1,14 +1,12 @@
package se.hagstedt.kvitt.feature.settings.about
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.rememberScrollState
@@ -22,12 +20,8 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.clearAndSetSemantics
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.role
import androidx.compose.ui.text.style.TextAlign
import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -41,7 +35,6 @@ import se.hagstedt.kvitt.design.component.KvittScaffold
import se.hagstedt.kvitt.design.component.KvittTopAppBar
import se.hagstedt.kvitt.design.component.NeedsConnectionHint
import se.hagstedt.kvitt.design.component.SegmentedGroup
import se.hagstedt.kvitt.design.component.SegmentedItemScope
import se.hagstedt.kvitt.design.component.TopBarNavigation
import se.hagstedt.kvitt.design.component.UpdateBanner
import se.hagstedt.kvitt.design.icon.KvittIcon
@@ -53,23 +46,21 @@ import se.hagstedt.kvitt.core.design.R as DesignR
/**
* S-22 About. [updateCheckAvailable] false hides "Sök efter uppdatering" (debug builds never check, AC-16.5; `:app`
* passes its build type). [onOpenLicences] opens the open-source licences screen (`:app`).
* passes its build type). No open-source licences row (OQ-5 answered "no", D-099).
*/
@Composable
fun AboutScreen(
onBack: () -> Unit,
onOpenLicences: () -> Unit,
updateCheckAvailable: Boolean,
modifier: Modifier = Modifier,
viewModel: AboutViewModel = hiltViewModel(),
) {
val state by viewModel.state.collectAsStateWithLifecycle()
AboutContent(state, AboutActions(onBack, onOpenLicences, viewModel::check, viewModel::install, viewModel::later, viewModel::onMessageShown), updateCheckAvailable, modifier)
AboutContent(state, AboutActions(onBack, viewModel::check, viewModel::install, viewModel::later, viewModel::onMessageShown), updateCheckAvailable, modifier)
}
class AboutActions(
val onBack: () -> Unit = {},
val onOpenLicences: () -> Unit = {},
val onCheck: () -> Unit = {},
val onInstall: () -> Unit = {},
val onLater: () -> Unit = {},
@@ -106,11 +97,10 @@ fun AboutContent(state: AboutScreenState?, actions: AboutActions, updateCheckAva
if (!state.bannerHidden && state.update !is UpdateState.None) {
UpdateBanner(state.update, state.online, actions.onInstall, actions.onLater, actions.onInstall)
}
SegmentedGroup(3) { item ->
SegmentedGroup(2) { item ->
when (item.index) {
0 -> FactRow(item, KvittIcon.Dns, stringResource(R.string.settings_about_server), about.serverUrl)
1 -> FactRow(item, KvittIcon.Memory, stringResource(R.string.settings_about_server_version), about.serverVersion ?: stringResource(R.string.settings_about_server_version_unknown))
else -> LicencesRow(item, actions.onOpenLicences)
else -> FactRow(item, KvittIcon.Memory, stringResource(R.string.settings_about_server_version), about.serverVersion ?: stringResource(R.string.settings_about_server_version_unknown))
}
}
if (updateCheckAvailable) {
@@ -132,25 +122,3 @@ fun AboutContent(state: AboutScreenState?, actions: AboutActions, updateCheckAva
}
}
}
/** "Licenser för öppen källkod" as a fact row with a chevron (design-spec S-22). */
@Composable
private fun LicencesRow(item: SegmentedItemScope, onClick: () -> Unit) {
val label = stringResource(R.string.settings_about_licences)
Row(
Modifier
.fillMaxWidth()
.clip(item.shape)
.background(item.fill)
.clickable(onClick = onClick)
.clearAndSetSemantics { contentDescription = label; role = Role.Button }
.heightIn(min = KvittTheme.spacing.rowMin)
.padding(horizontal = KvittTheme.spacing.rowHorizontal, vertical = KvittTheme.spacing.rowVertical),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(KvittTheme.spacing.rowTileGap),
) {
KvittIconImage(KvittIcon.Description, null, tint = MaterialTheme.colorScheme.onSurfaceVariant)
Text(label, Modifier.weight(1f), style = MaterialTheme.typography.bodyLarge)
KvittIconImage(KvittIcon.ChevronRight, null, tint = MaterialTheme.colorScheme.onSurfaceVariant)
}
}
@@ -178,7 +178,6 @@
<!-- label; value from /health -->
<string name="settings_about_server_version">Serverversion</string>
<string name="settings_about_server_version_unknown">Okänd</string>
<string name="settings_about_licences">Licenser för öppen källkod</string>
<string name="settings_category_archived_snackbar">%1$s arkiverades</string>
<string name="settings_category_unarchived_snackbar">%1$s återställdes</string>
<string name="settings_recurring_summary_none">Inga</string>
@@ -178,7 +178,6 @@
<!-- label; value from /health -->
<string name="settings_about_server_version">Server version</string>
<string name="settings_about_server_version_unknown">Unknown</string>
<string name="settings_about_licences">Open-source licences</string>
<string name="settings_category_archived_snackbar">%1$s was archived</string>
<string name="settings_category_unarchived_snackbar">%1$s was restored</string>
<string name="settings_recurring_summary_none">None</string>
-1
View File
@@ -569,7 +569,6 @@ settings_about_version,Kvitt %1$s (%2$d),Kvitt %1$s (%2$d),module=settings; vers
settings_about_server,Server,Server,module=settings
settings_about_server_version,Server version,Serverversion,module=settings; label; value from /health
settings_about_server_version_unknown,Unknown,Okänd,module=settings
settings_about_licences,Open-source licences,Licenser för öppen källkod,module=settings
settings_category_archived_snackbar,%1$s was archived,%1$s arkiverades,module=settings; S-15 snackbar after Arkivera; %1$s category name; M7f
settings_category_unarchived_snackbar,%1$s was restored,%1$s återställdes,module=settings; S-15 snackbar after Återställ från arkiv; %1$s category name; M7f
settings_recurring_summary_none,None,Inga,module=settings; S-13 recurring row subtitle without templates; M7f
Can't render this file because it contains an unexpected character in line 161 and column 79.