<commit_before>import SwiftUI

struct ChannelSelectionView: View {
    @State var outputConfig = Engine.shared.outputConfig
    
    var outputs = ChannelPair.array()
    var audioInterfaceName = Engine.shared.audioInterfaceName()
    
    var body: some View {
        Form {
            Section(header: Text(audioInterfaceName)) {
                ForEach(outputs, id: \.self) { config in
                    Button {
                        Engine.shared.outputConfig = outputConfig
                        outputConfig = config
                    } label: {
                        let selected = outputConfig.left == config.left && outputConfig.right == config.right
                        OutputCell(label: config.name, selected: selected)
                    }
                }
            }
            
            if !outputs.contains(outputConfig) {
                Section(header: Text("Unavailable")) {
                    HStack {
                        Text(outputConfig.name)
                            .font(Font.body.monospacedDigit())
                        Spacer()
                        Image(systemName: "checkmark")
                    }
                    .disabled(true)
                    .foregroundColor(.secondary)
                }
            }
        }
        .navigationBarTitle("Output Channels")
    }
}

struct OutputCell: View {
    let label: String
    @State var selected: Bool
    
    var body: some View {
        HStack {
            Text(label)
                .font(Font.body.monospacedDigit())
                .foregroundColor(.primary)
            Spacer()
            Image(systemName: "checkmark")
                .opacity(selected ? 1 : 0)<commit_msg>Make checkmark bold in ChannelSelectionView.<commit_after>import SwiftUI

struct ChannelSelectionView: View {
    @State var outputConfig = Engine.shared.outputConfig
    
    var outputs = ChannelPair.array()
    var audioInterfaceName = Engine.shared.audioInterfaceName()
    
    var body: some View {
        Form {
            Section(header: Text(audioInterfaceName)) {
                ForEach(outputs, id: \.self) { config in
                    Button {
                        Engine.shared.outputConfig = outputConfig
                        outputConfig = config
                    } label: {
                        let selected = outputConfig.left == config.left && outputConfig.right == config.right
                        OutputCell(label: config.name, selected: selected)
                    }
                }
            }
            
            if !outputs.contains(outputConfig) {
                Section(header: Text("Unavailable")) {
                    HStack {
                        Text(outputConfig.name)
                            .font(Font.body.monospacedDigit())
                        Spacer()
                        Image(systemName: "checkmark")
                    }
                    .disabled(true)
                    .foregroundColor(.secondary)
                }
            }
        }
        .navigationBarTitle("Output Channels")
    }
}

struct OutputCell: View {
    let label: String
    @State var selected: Bool
    
    var body: some View {
        HStack {
            Text(label)
                .font(Font.body.monospacedDigit())
                .foregroundColor(.primary)
            Spacer()
            Image(systemName: "checkmark")
                .font(Font.body.bold())
                .opacity(selected ? 1 : 0)
{'fraction_non_alphanumeric': 0.08464398055476123, 'fraction_numerical': 0.001143837575064341, 'mean_word_length': 1.2365728900255755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1552022', 'n_tokens_mistral': 848, 'n_tokens_neox': 791, 'n_words': 166}