Add Save as Copy button to message edit area #154
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#154
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?
Feature Description
Add a "Save as Copy" button to the message edit area (in addition to the existing Save/Cancel buttons). This action will save the edited message as a new message and create a new branch in the conversation tree (including for leaf messages).
Behavior
Implementation Plan
1. Add UI Action to ChatAreaActions interface
app/src/commonMain/kotlin/eu/torvian/chatbot/app/compose/chatarea/ChatAreaActions.ktonSaveEditingAsCopy()function after the existingonSaveEditing()function2. Implement SaveEditingAsCopy in EditMessageUseCase
app/src/commonMain/kotlin/eu/torvian/chatbot/app/viewmodel/chat/usecase/EditMessageUseCase.ktsuspend fun saveEditingAsCopy()that:InsertMessageUseCaseto create a new message withMessageInsertPosition.APPENDrelative to the parent3. Wire up in ChatViewModel
app/src/commonMain/kotlin/eu/torvian/chatbot/app/viewmodel/chat/ChatViewModel.ktfun saveEditingAsCopy()that delegates toeditMessageUC.saveEditingAsCopy()4. Wire up in ChatScreen
app/src/commonMain/kotlin/eu/torvian/chatbot/app/compose/ChatScreen.ktoverride fun onSaveEditingAsCopy() = chatViewModel.saveEditingAsCopy()to thechatAreaActionsobject5. Add Button to MessageContent Composable
app/src/commonMain/kotlin/eu/torvian/chatbot/app/compose/chatarea/MessageContent.ktMessageEditActionscomposable between Save and Cancel buttons6. Update Preview
app/src/commonMain/kotlin/eu/torvian/chatbot/app/compose/preview/ChatAreaPreview.ktonSaveEditingAsCopy()to the previewChatAreaActionsobjectNotes
MessageInsertPosition.APPENDto create new branch