make ::
    MonadA m =>
    Sugar.GetField (Name m) m (ExprGuiT.SugarExpr m) ->
    Sugar.Payload m ExprGuiT.Payload ->
    ExprGuiM m (ExpressionGui m)
make (Sugar.GetField recExpr tagG mDelField) pl =
    ExpressionGui.stdWrapParentExpr pl $ \myId ->
    do
        recExprEdit <- ExprGuiM.makeSubexpression 11 recExpr
        dotLabel <- ExpressionGui.makeLabel "." (Widget.toAnimId myId)
        config <- ExprGuiM.readConfig
        let delEventMap =
                mDelField
                <&> fmap WidgetIds.fromEntityId
                & maybe mempty
                (Widget.keysEventMapMovesCursor (Config.delKeys config) delDoc)
        tagEdit <-
            TagEdit.makeRecordTag
            (pl ^. Sugar.plData . ExprGuiT.plNearestHoles) tagG
            <&> ExpressionGui.egWidget %~ Widget.weakerEvents delEventMap
        return $ ExpressionGui.hbox [recExprEdit, dotLabel, tagEdit]
    & ExprGuiM.assignCursor myId tagId
    where
        tagId = WidgetIds.fromEntityId (tagG ^. Sugar.tagInstance)
        delDoc = E.Doc ["Edit", "Delete GetField"]
make ::
    MonadA m =>
    Sugar.GetField (Name m) m (ExprGuiT.SugarExpr m) ->
    Sugar.Payload m ExprGuiT.Payload ->
    ExprGuiM m (ExpressionGui m)
make (Sugar.GetField recExpr tagG mDelField) pl =
    ExpressionGui.stdWrapParentExpr pl $ \myId ->
    do
        recExprEdit <- ExprGuiM.makeSubexpression 11 recExpr
        dotLabel <- ExpressionGui.makeLabel "." (Widget.toAnimId myId)
        config <- ExprGuiM.readConfig
        let delEventMap =
                mDelField
                <&> fmap WidgetIds.fromEntityId
                & maybe mempty
                (Widget.keysEventMapMovesCursor (Config.delKeys config) delDoc)
        tagEdit <-
            TagEdit.makeRecordTag
            (pl ^. Sugar.plData . ExprGuiT.plNearestHoles) tagG
            <&> ExpressionGui.egWidget %~ Widget.weakerEvents delEventMap
        return $ ExpressionGui.hbox [recExprEdit, dotLabel, tagEdit]
    & ExprGuiM.assignCursor myId tagId
    where
        tagId = WidgetIds.fromEntityId (tagG ^. Sugar.tagInstance)
        delDoc = E.Doc ["Edit", "Delete GetField"]
make (Sugar.GetField recExpr tagG mDelField) pl =
    ExpressionGui.stdWrapParentExpr pl $ \myId ->
    do
        recExprEdit <- ExprGuiM.makeSubexpression 11 recExpr
        dotLabel <- ExpressionGui.makeLabel "." (Widget.toAnimId myId)
        config <- ExprGuiM.readConfig
        let delEventMap =
                mDelField
                <&> fmap WidgetIds.fromEntityId
                & maybe mempty
                (Widget.keysEventMapMovesCursor (Config.delKeys config) delDoc)
        tagEdit <-
            TagEdit.makeRecordTag
            (pl ^. Sugar.plData . ExprGuiT.plNearestHoles) tagG
            <&> ExpressionGui.egWidget %~ Widget.weakerEvents delEventMap
        return $ ExpressionGui.hbox [recExprEdit, dotLabel, tagEdit]
    & ExprGuiM.assignCursor myId tagId
    where
        tagId = WidgetIds.fromEntityId (tagG ^. Sugar.tagInstance)
        delDoc = E.Doc ["Edit", "Delete GetField"]