Repository: CodeEditApp/CodeEdit
File: CodeEdit/Features/Documents/Controllers/CodeEditSplitViewController.swift (Swift)

Code before:
            if newValue, newValue != isSnapped {
                feedbackPerformer.perform(.alignment, performanceTime: .now)
            }
        }
    }

    // Dependencies
    private let feedbackPerformer: NSHapticFeedbackPerformer

    // MARK: - Initialization

    init(workspace: WorkspaceDocument, feedbackPerformer: NSHapticFeedbackPerformer) {
        self.workspace = workspace
        self.feedbackPerformer = feedbackPerformer
        super.init(nibName: nil, bundle: nil)
    }

    @available(*, unavailable)
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func viewWillAppear() {
        super.viewWillAppear()
        let width = workspace.getFromWorkspaceState(key: self.widthStateName) as? CGFloat
        splitView.setPosition(width ?? CodeEditWindowController.minSidebarWidth, ofDividerAt: .zero)
        setWidthFromState = true
    }

    // MARK: - NSSplitViewDelegate

    override func splitView(
        _ splitView: NSSplitView,
        constrainSplitPosition proposedPosition: CGFloat,
        ofSubviewAt dividerIndex: Int
    ) -> CGFloat {
        if dividerIndex == 0 {
            // Navigator
            if (CGFloat.minSnapWidth...CGFloat.maxSnapWidth).contains(proposedPosition) {
                isSnapped = true
                return .snapWidth
            } else {
                isSnapped = false
                if proposedPosition <= CodeEditWindowController.minSidebarWidth / 2 {
                    splitViewItems.first?.isCollapsed = true
                    return 0
                }
                return max(CodeEditWindowController.minSidebarWidth, proposedPosition)
            }
        } else if dividerIndex == 1 {
            let proposedWidth = view.frame.width - proposedPosition

Review comment (suggestion):
Shouldn't the default width for the sidebar be `snapWidth` instead of the minimum width? I believe this is also what we are doing for now.

Code after:

    // Properties
    private(set) var isSnapped: Bool = false {
        willSet {
            if newValue, newValue != isSnapped {
                feedbackPerformer.perform(.alignment, performanceTime: .now)
            }
        }
    }

    // Dependencies
    private let feedbackPerformer: NSHapticFeedbackPerformer

    // MARK: - Initialization

    init(workspace: WorkspaceDocument, feedbackPerformer: NSHapticFeedbackPerformer) {
        self.workspace = workspace
        self.feedbackPerformer = feedbackPerformer
        super.init(nibName: nil, bundle: nil)
    }

    @available(*, unavailable)
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func viewWillAppear() {
        super.viewWillAppear()
        let width = workspace.getFromWorkspaceState(key: self.widthStateName) as? CGFloat
        splitView.setPosition(width ?? .snapWidth, ofDividerAt: .zero)
        setWidthFromState = true

        if let firstSplitView = splitViewItems.first {
            firstSplitView.isCollapsed = workspace.getFromWorkspaceState(
                key: isNavigatorCollapsedStateName
            ) as? Bool ?? false
        }

        if let lastSplitView = splitViewItems.last {
            lastSplitView.isCollapsed = workspace.getFromWorkspaceState(
                key: isInspectorCollapsedStateName
            ) as? Bool ?? true
        }

        self.insertToolbarItemIfNeeded()
    }

    // MARK: - NSSplitViewDelegate

    override func splitView(
        _ splitView: NSSplitView,