Redesign top bar to support screen-specific dynamic content (move ModelSettingsSelector & tool config to top bar) #135
Labels
No labels
Epic 5
MCP
P1
PR-0
PR-1
api
api-layer
architecture
area:backend
area:frontend
arrow
authentication
backend
bug
chat
client
clipboard
common-module
compose
cross-cutting
cross-cutting-requirement
data-layer
data-models
database
desktop-client
documentation
duplicate
enhancement
epic
epic-1
epic-2
epic-3
epic-4
epic-5
epic-6
epic-7
epic-llm-config
error-handling
feature
frontend
good first issue
help wanted
implementation
infrastructure
installer
invalid
kotlin
ktor
llm
medium-priority
message
multiplatform
needs-review
needs-triage
packaging
performance
phase-1
phase-2
phase-3
phase-4
phase-5
phase3
phase:3
priority: high
question
refactor
refactoring
resource-sharing
security
server
server-module
services
session
session-management
settings
setup
shutdown
state
storage
streaming
sub-issue
tests
tooling
type:task
ui
ui/ux
user-accounts
user-management
ux
viewmodel
websocket
windows
windows-integration
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Torvian.eu/chatbot#135
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
We should make the top app bar in
MainApplicationFlowcapable of showing screen-specific controls. For example, when the Chat screen is active the top bar should host theModelSettingsSelector(currently inChatArea) and the tool configuration button (currently inInputArea). This will make the UI more consistent and keep frequently used session-level controls always visible.Why
Proposed approach (high level)
Add a top-bar slot in
MainApplicationFlowfor screen-provided composable content. Two primary options:MainApplicationFlowand updated by screens.CompositionLocalfor a@Composable RowScope.() -> Unitthat screens can set viaCompositionLocalProvider.Implement a small API for screens to populate the top-bar content. Example:
val setTopBarContent = remember { mutableStateOf<(@Composable RowScope.() -> Unit)?>(null) }ChatScreencan set content when active and clear it when leaving.Create a
ChatTopBarContentcomposable (or similar) that wrapsModelSettingsSelectorand the tool config UI (extracted fromInputArea).Remove
ModelSettingsSelectorfromChatArea.SuccessStateDisplayand the tool config button fromInputArea; rely on the top-bar content instead.Ensure proper lifecycle: set the content when the screen becomes active and clear it when the screen is removed.
Files likely to touch
ModelSettingsSelectorfrom SuccessStateDisplay)ChatTopBarContent.ktunderchatareato host the extracted top-bar composable.Implementation notes and choices
I recommend using the CompositionLocal approach (
CompositionLocalProvider) because it avoids threading a setter through many composables and feels idiomatic for multi-module Compose apps. However, the mutable-state setter is simpler and explicit. Either is fine; include a brief comment explaining the choice.Ensure the top-bar content is a
RowScope.() -> Unitto allow the app baractionsto host it naturally. If the content is wider than available space, consider horizontal scrolling or an overflow menu.Acceptance criteria
ModelSettingsSelectorand the tool configuration button.ModelSettingsSelectoris removed from the bodyChatAreaso it isn't duplicated.InputAreaand now appears in the top bar.Testing steps
Build/run the desktop app (quick target):
./gradlew app:desktopMainClassesto compile the desktop app UI code../gradlew app:desktopTestto run desktop tests.Manual smoke test:
Suggested labels and assignees
enhancement,ui,refactorrwachters(optional)Notes / follow-ups
TopBarContentAPI indocs/.If you want, I can open a PR that implements the CompositionLocal approach and updates the relevant files.