@@ -332,6 +332,9 @@ function initializeFilename() {
332
332
const defaultName = `ChordsPy_${ getTimestamp ( ) } ` ;
333
333
filenameInput . value = defaultName ;
334
334
filenameInput . placeholder = defaultName ;
335
+ filenameInput . disabled = false ; // Ensure input is enabled initially
336
+ filenameInput . classList . remove ( 'bg-gray-100' , 'dark:bg-gray-700' , 'cursor-not-allowed' ) ;
337
+ filenameInput . classList . add ( 'dark:bg-gray-800' ) ;
335
338
}
336
339
337
340
// Sanitize filename input - replace spaces and dots with underscores
@@ -722,6 +725,11 @@ function toggleRecording() {
722
725
recordBtn . classList . remove ( 'bg-gray-500' ) ;
723
726
recordBtn . classList . add ( 'bg-red-500' , 'hover:bg-red-600' ) ;
724
727
recordingStatus . classList . add ( 'hidden' ) ;
728
+
729
+ // Enable filename input
730
+ filenameInput . disabled = false ;
731
+ filenameInput . classList . remove ( 'bg-gray-100' , 'dark:bg-gray-700' , 'cursor-not-allowed' ) ;
732
+ filenameInput . classList . add ( 'dark:bg-gray-800' ) ;
725
733
}
726
734
} )
727
735
. catch ( error => {
@@ -742,6 +750,11 @@ function toggleRecording() {
742
750
recordBtn . classList . remove ( 'bg-red-500' , 'hover:bg-red-600' ) ;
743
751
recordBtn . classList . add ( 'bg-gray-500' ) ;
744
752
recordingStatus . classList . remove ( 'hidden' ) ;
753
+
754
+ // Disable filename input
755
+ filenameInput . disabled = true ;
756
+ filenameInput . classList . add ( 'bg-gray-100' , 'dark:bg-gray-700' , 'cursor-not-allowed' ) ;
757
+ filenameInput . classList . remove ( 'dark:bg-gray-800' ) ;
745
758
}
746
759
} )
747
760
. catch ( error => {
@@ -803,6 +816,11 @@ function checkStreamStatus() {
803
816
recordBtn . classList . remove ( 'bg-gray-500' ) ;
804
817
recordBtn . classList . add ( 'bg-red-500' , 'hover:bg-red-600' ) ;
805
818
recordingStatus . classList . add ( 'hidden' ) ;
819
+
820
+ // Enable filename input if recording was stopped due to disconnection
821
+ filenameInput . disabled = false ;
822
+ filenameInput . classList . remove ( 'bg-gray-100' , 'dark:bg-gray-700' , 'cursor-not-allowed' ) ;
823
+ filenameInput . classList . add ( 'dark:bg-gray-800' ) ;
806
824
}
807
825
808
826
// Stop console updates
0 commit comments