malliaridis commented on code in PR #2605: URL: https://github.com/apache/solr/pull/2605#discussion_r1708066620
########## solr/compose-ui/src/commonMain/kotlin/org/apache/solr/composeui/components/main/MainComponent.kt: ########## @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.solr.composeui.components.main + +import com.arkivanov.decompose.router.stack.ChildStack +import com.arkivanov.decompose.value.Value +import kotlinx.coroutines.flow.StateFlow +import org.apache.solr.composeui.components.environment.EnvironmentComponent +import org.apache.solr.composeui.components.logging.LoggingComponent +import org.apache.solr.composeui.components.navigation.NavigationComponent +import org.apache.solr.composeui.ui.navigation.MainMenu + +/** + * Main component of the application that is used as base for users with access. + * + * Note that this component can be accessed if the user is either authenticated or if the Solr + * instance accessed does not have any authentication enabled. + */ +interface MainComponent : NavigationComponent { + + /** + * Child stack that holds the navigation state. + */ + val childStack: Value<ChildStack<*, Child>> + + /** + * Handles navigation requests from a navigation menu. + * + * @param menuItem The destination to navigate to. + */ + fun onNavigate(menuItem: MainMenu) + + /** + * Child interface that defines all available children of the [MainComponent]. + */ + sealed interface Child { + + // TODO Uncomment once DashboardComponent available Review Comment: Placeholders for the planned UI screens / components, yes. Since this is just a POC, I added a few commented out lines to show how it would look if the other screens would be added, so that it makes more sense when looking at the child interface. The navigation, which the Child interface is part of, is one of the more complicated parts in the UI, since it has to handle back and forth navigation and update the components' states accordingly (like pause running background tasks, stop animations and so on). The libraries' documentation provide a more detailed overview and explaination on that. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
