feat(wiki): 更新后的 What's New 卡片改为展示 Project Wiki(与设置页入口共用内容)

This commit is contained in:
atsunatsu committed 2026-09-29 01:25:50 +08:00
1 parent 473c3bf228
commit fb4f14f75d
5 files changed
+89 -69

No files matched your search

@@ -72,6 +72,7 @@ import com.rtbishop.look4sat.core.presentation.EmptyListCard
import com.rtbishop.look4sat.core.presentation.IconCard
import com.rtbishop.look4sat.core.presentation.MainTheme
import com.rtbishop.look4sat.core.presentation.NextPassRow
import com.rtbishop.look4sat.core.presentation.ProjectWikiBody
import com.rtbishop.look4sat.core.presentation.R
import com.rtbishop.look4sat.core.presentation.ScreenColumn
import com.rtbishop.look4sat.core.presentation.SharedDialog
@@ -143,17 +144,14 @@ private fun PassesScreen(
if (uiState.shouldSeeWhatsNew) {
val dismiss = { onAction(PassesAction.DismissWhatsNew) }
SharedDialog(
title = stringResource(R.string.pass_whatsnew_title),
title = stringResource(R.string.prefs_project_wiki),
onDismissRequest = dismiss,
onAccept = dismiss,
titleFontSize = 18
) { padding ->
// The changelog is long; keep the dialog frame fixed and let the
// The wiki is long; keep the dialog frame fixed and let the
// text scroll inside it (matches the update-checker page pattern).
Text(
text = stringResource(R.string.pass_whatsnew_message),
fontSize = 16.sp,
color = MaterialTheme.colorScheme.onSurface,
ProjectWikiBody(
modifier = Modifier
.padding(horizontal = padding)
.heightIn(max = 360.dp)
@@ -17,54 +17,22 @@
*/
package com.rtbishop.look4sat.feature.settings
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.rtbishop.look4sat.core.presentation.ProjectWikiBody
import com.rtbishop.look4sat.core.presentation.R
import com.rtbishop.look4sat.core.presentation.SheetDialogTitle
import com.rtbishop.look4sat.core.presentation.sheetDialogContainerColor
import com.rtbishop.look4sat.core.presentation.sheetDialogShape
import com.rtbishop.look4sat.core.presentation.SheetDialogTitle
/**
* The fork's Project Wiki: a short overview of what Look4Sat-BA7OPF adds over upstream
* and how to use those features. Shown in the update-checker screen and behind the
* Settings → Project Wiki entry. Text lives in string resources (no release-body parsing),
* so it always renders even when the GitHub page is unreachable.
*/
@Composable
fun ProjectWikiBody(modifier: Modifier = Modifier) {
Column(modifier = modifier, verticalArrangement = Arrangement.spacedBy(8.dp)) {
Text(
text = stringResource(R.string.project_wiki_intro),
fontSize = 13.sp
)
WikiSection(stringResource(R.string.project_wiki_section_logbook))
WikiEntry(stringResource(R.string.project_wiki_logbook_1))
WikiEntry(stringResource(R.string.project_wiki_logbook_2))
WikiEntry(stringResource(R.string.project_wiki_logbook_3))
WikiHow(stringResource(R.string.project_wiki_logbook_how))
WikiSection(stringResource(R.string.project_wiki_section_mutual))
WikiEntry(stringResource(R.string.project_wiki_mutual_1))
WikiHow(stringResource(R.string.project_wiki_mutual_how))
WikiSection(stringResource(R.string.project_wiki_section_grids))
WikiEntry(stringResource(R.string.project_wiki_grids_1))
WikiHow(stringResource(R.string.project_wiki_grids_how))
}
}
/** Settings → Project Wiki: the same content as the What's-New card, in a dialog. */
@Composable
fun ProjectWikiDialog(onDismiss: () -> Unit) {
AlertDialog(
@@ -86,28 +54,3 @@ fun ProjectWikiDialog(onDismiss: () -> Unit) {
}
)
}
@Composable
private fun WikiSection(text: String) {
Text(
text = text,
color = MaterialTheme.colorScheme.primary,
fontWeight = FontWeight.Medium,
fontSize = 13.sp
)
}
@Composable
private fun WikiEntry(text: String) {
Text(text = text, fontSize = 12.sp)
}
@Composable
private fun WikiHow(text: String) {
Text(
text = text,
fontSize = 12.sp,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.padding(start = 8.dp)
)
}