mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 11:18:24 +00:00
fix(desktop): wire Open Full Search via LocalOpenFullSearch CompositionLocal
- Add LocalOpenFullSearch CompositionLocal (navigates to Search column) - Provided at Main.kt level alongside LocalFeedSearchActive - FeedScreen reads it directly — no param threading needed - "Open full search" link in expanded header now actually opens Search column - Removed unused onOpenSearch param from DeckColumnContainer Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
b8f6751a68
commit
41a59a9499
@@ -452,7 +452,9 @@ fun main() {
|
||||
} else {
|
||||
KeyShortcut(Key.F, ctrl = true)
|
||||
},
|
||||
onClick = { feedSearchActiveState.value = !feedSearchActiveState.value },
|
||||
onClick = {
|
||||
feedSearchActiveState.value = !feedSearchActiveState.value
|
||||
},
|
||||
)
|
||||
Item(
|
||||
"App Drawer",
|
||||
@@ -620,6 +622,9 @@ fun main() {
|
||||
key(appRestartKey) {
|
||||
CompositionLocalProvider(
|
||||
com.vitorpamplona.amethyst.desktop.ui.theme.LocalFeedSearchActive provides feedSearchActiveState,
|
||||
com.vitorpamplona.amethyst.desktop.ui.theme.LocalOpenFullSearch provides {
|
||||
navigateToScreen?.invoke(DeckColumnType.Search)
|
||||
},
|
||||
) {
|
||||
App(
|
||||
layoutMode = layoutMode,
|
||||
|
||||
@@ -342,6 +342,7 @@ fun FeedScreen(
|
||||
val feedSearchActiveState = com.vitorpamplona.amethyst.desktop.ui.theme.LocalFeedSearchActive.current
|
||||
var searchActive by feedSearchActiveState
|
||||
val onSearchActiveChange: (Boolean) -> Unit = { searchActive = it }
|
||||
val openFullSearch = com.vitorpamplona.amethyst.desktop.ui.theme.LocalOpenFullSearch.current
|
||||
val relayStatuses by relayManager.relayStatuses.collectAsState()
|
||||
val connectedRelays by relayManager.connectedRelays.collectAsState()
|
||||
val followedUsers by localCache.followedUsers.collectAsState()
|
||||
@@ -789,7 +790,7 @@ fun FeedScreen(
|
||||
},
|
||||
onOpenFeedsDrawer = onOpenFeedsDrawer,
|
||||
onCompose = onCompose,
|
||||
onSearchClick = onSearchClick,
|
||||
onSearchClick = openFullSearch,
|
||||
relayManager = relayManager,
|
||||
localCache = localCache,
|
||||
onNavigateToProfile = onNavigateToProfile,
|
||||
|
||||
+3
@@ -53,6 +53,9 @@ val LocalIsDarkTheme = staticCompositionLocalOf { false }
|
||||
/** Mutable state for Cmd+F feed search. Provided at Main.kt level. */
|
||||
val LocalFeedSearchActive = compositionLocalOf { mutableStateOf(false) }
|
||||
|
||||
/** Callback to open the full Search column/screen. Provided at Main.kt level. */
|
||||
val LocalOpenFullSearch = compositionLocalOf<() -> Unit> { {} }
|
||||
|
||||
val MaterialTheme.spacing: AmethystSpacing
|
||||
@Composable @ReadOnlyComposable
|
||||
get() = LocalSpacing.current
|
||||
|
||||
Reference in New Issue
Block a user