 
 /// Class for coordinating talk page reply compose views
 class TalkPageReplyComposeController {
+    
+    // viewController - the view controller that triggered the reply compose screen
+    // containerView - the view that contains the contentView. It has the drag handle and pan gesture attached.
+    // contentView - the view with the reply compose UI elements (close button, publish button, text views)
+    
+    private var viewController: ViewController?
     
     private var containerView: UIView?
     private var containerViewTopConstraint: NSLayoutConstraint?
     private var containerViewBottomConstraint: NSLayoutConstraint?
     private var containerViewHeightConstraint: NSLayoutConstraint?
     
+    // Pan Gesture tracking properties
+    private var safeAreaBackgroundView: UIView?
+    private var dragHandleView: UIView?
+    private var containerViewYUponDragBegin: CGFloat?
+    private var containerViewWasPinnedToTopUponDragBegin: Bool?
+    
     private var contentView: TalkPageReplyComposeContentView?
     
     private let containerPinnedTopSpacing = CGFloat(10)

    func apply(theme: Theme) {
        containerView?.backgroundColor = theme.colors.paperBackground
        containerView?.layer.shadowColor = theme.colors.shadow.cgColor
        contentView?.apply(theme: theme)
    }
}

        containerView.layer.cornerRadius = 8
    }
    
    func addDragHandle(to containerView: UIView) {
        let dragHandleView = UIView(frame: .zero)
        dragHandleView.translatesAutoresizingMaskIntoConstraints = false
        containerView.addSubview(dragHandleView)
        let dragHandleHeight = CGFloat(5)
        dragHandleView.cornerRadius = dragHandleHeight/2.5
        NSLayoutConstraint.activate([
            dragHandleView.topAnchor.constraint(equalTo: containerView.topAnchor, constant: 4),
            dragHandleView.widthAnchor.constraint(equalToConstant: 36),
            dragHandleView.heightAnchor.constraint(equalToConstant: dragHandleHeight),
            dragHandleView.centerXAnchor.constraint(equalTo: containerView.centerXAnchor)
        ])
        
        self.dragHandleView = dragHandleView
    }
    
    private func addContentView(to containerView: UIView) {
        let contentView = TalkPageReplyComposeContentView(frame: .zero)
        contentView.translatesAutoresizingMaskIntoConstraints = false
