Fix voice note fragment handling and narrow macOS sidebar

- Fix fragment processing bug where fragments were logged but not handled
- Remove redundant 'Processing fragment directly' check that prevented handling
- Make macOS sidebar narrower (300px max or 40% of width, whichever is smaller)
- iOS sidebar remains at 70% width for better touch interaction
This commit is contained in:
jack
2025-07-03 23:33:44 +02:00
parent 8346ecd2a7
commit 7e8c5d0153
2 changed files with 5 additions and 7 deletions
+1 -7
View File
@@ -997,13 +997,7 @@ extension BluetoothMeshService: CBPeripheralDelegate {
let packetSenderID = String(data: packet.senderID.trimmingNullBytes(), encoding: .utf8) ?? "unknown"
print("[PERIPHERAL] Received data from localPeerID: \(localPeerID), packetSenderID: \(packetSenderID), packet type: \(packet.type)")
// Handle fragments directly if it's a fragment type
if packet.type == MessageType.fragmentStart.rawValue ||
packet.type == MessageType.fragmentContinue.rawValue ||
packet.type == MessageType.fragmentEnd.rawValue {
print("[PERIPHERAL] Processing fragment directly")
}
// Always handle received packets
handleReceivedPacket(packet, from: packetSenderID, peripheral: peripheral)
}
+4
View File
@@ -85,7 +85,11 @@ struct ContentView: View {
}
sidebarView
#if os(macOS)
.frame(width: min(300, geometry.size.width * 0.4))
#else
.frame(width: geometry.size.width * 0.7)
#endif
.transition(.move(edge: .trailing))
}
.offset(x: showSidebar ? -sidebarDragOffset : geometry.size.width - sidebarDragOffset)