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

Code before:
    override func viewWillAppear() {
        super.viewWillAppear()

        viewIsReady = false
        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()
    }

    override func viewDidAppear() {
        viewIsReady = true
        fixInspectorToolbarBackground()
    }

    // 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
            if proposedWidth <= CodeEditWindowController.minSidebarWidth / 2 {

Review comment (suggestion):
Maybe call this `hideInspectorToolbarBackground` to be more specific?
```suggestion
        hideInspectorToolbarBackground()
```

Code after:
    override func viewWillAppear() {
        super.viewWillAppear()

        viewIsReady = false
        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()
    }

    override func viewDidAppear() {
        viewIsReady = true
        hideInspectorToolbarBackground()
    }

    // 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
            if proposedWidth <= CodeEditWindowController.minSidebarWidth / 2 {