Add visual save indicator button for rooms

- Add bookmark icon button in room header to toggle save status
- Use bookmark.fill when room is saved, bookmark when not
- Button shows yellow when saved, default color when not
- Integrate with existing /save command functionality
- Add savedRooms published property for reactive UI updates
This commit is contained in:
jack
2025-07-05 19:35:37 +02:00
parent e6aced4cb4
commit f7ebcd6032
2 changed files with 20 additions and 0 deletions
+10
View File
@@ -296,6 +296,16 @@ struct ContentView: View {
Spacer()
HStack(spacing: 8) {
// Save button
Button(action: {
viewModel.sendMessage("/save")
}) {
Image(systemName: viewModel.savedRooms.contains(currentRoom) ? "bookmark.fill" : "bookmark")
.font(.system(size: 16))
.foregroundColor(viewModel.savedRooms.contains(currentRoom) ? Color.yellow : textColor)
}
.buttonStyle(.plain)
// Password button for room creator only
if viewModel.roomCreators[currentRoom] == viewModel.meshService.myPeerID {
Button(action: {