<commit_before>module EditMode exposing (..)

import Context
import Project
import Todo
import Toolkit.Helpers exposing (..)
import Toolkit.Operators exposing (..)
import Ext.Function exposing (..)
import Ext.Function.Infix exposing (..)
import List.Extra as List
import Maybe.Extra as Maybe


type alias EditTodoModel =
    { todoId : Todo.Id
    , todoText : Todo.Text
    , projectName : Project.Name
    , contextName : Context.Name
    }


type alias EditContextModel =
    Context.Name


type alias NewTodoModel =
    Todo.Text


type EditMode
    = NewTodo NewTodoModel
    | EditTodo EditTodoModel
    | EditContext EditContextModel
    | None
    | SwitchView
    | SwitchToGroupedView


none =
    None


createNewTodoModel =
    NewTodo


createEditTodoModel todo projectName contextName =
    { todoId = Todo.getId todo
    , todoText = Todo.getText todo
    , projectName = projectName
    , contextName = contextName
    }
        |> EditTodo


updateEditTodoText text editTodoModel =
    (EditTodo ({ editTodoModel | todoText = text }))
<commit_msg>Feature: Edit/Delete Project/Context<commit_after>module EditMode exposing (..)

import Context
import Project
import Todo
import Toolkit.Helpers exposing (..)
import Toolkit.Operators exposing (..)
import Ext.Function exposing (..)
import Ext.Function.Infix exposing (..)
import List.Extra as List
import Maybe.Extra as Maybe


type alias EditTodoModel =
    { todoId : Todo.Id
    , todoText : Todo.Text
    , projectName : Project.Name
    , contextName : Context.Name
    }


type alias EditContextModel =
    Context.Name


type alias EditProjectModel =
    Project.Name


type alias NewTodoModel =
    Todo.Text


type EditMode
    = NewTodo NewTodoModel
    | EditTodo EditTodoModel
    | EditContext EditContextModel
    | EditProject EditProjectModel
    | None
    | SwitchView
    | SwitchToGroupedView


none =
    None


createNewTodoModel =
    NewTodo


createEditTodoModel todo projectName contextName =
    { todoId = Todo.getId todo
    , todoText = Todo.getText todo
    , projectName = projectName
    , contextName = contextName
    }
        |> EditTodo


updateEditTodoText text editTodoModel =
    (EditTodo ({ editTodoModel | todoText = text }))

{'fraction_non_alphanumeric': 0.07337807606263982, 'fraction_numerical': 0.0, 'mean_word_length': 3.110294117647059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '312733', 'n_tokens_mistral': 702, 'n_tokens_neox': 676, 'n_words': 178}