More massive workstuff for completion :P

This commit is contained in:
Lett Osprey 2026-04-10 19:36:28 +02:00
parent 7a8acf27a7
commit 3385118b14
20 changed files with 325 additions and 354 deletions

View file

@ -78,10 +78,10 @@ fn update(model: Model, msg: Msg) -> #(Model, Effect(Msg)) {
effect.none(),
)
}
GiveAnswer(name, question, answer) -> {
GiveAnswer(id, question, answer) -> {
actor.send(
model.handler.data,
message.GiveSingleAnswer(name:, question:, answer:),
message.GiveSingleAnswer(id:, question:, answer:),
)
let new_value = case list.key_find(model.answers, question) {
Ok(pair) -> {
@ -93,7 +93,7 @@ fn update(model: Model, msg: Msg) -> #(Model, Effect(Msg)) {
#(
Model(
..model,
state: GiveQuestion(name, ""),
state: GiveQuestion(id, ""),
answers: list.key_set(model.answers, question, new_value),
),
effect.none(),
@ -160,7 +160,7 @@ fn terminal_section(
html.div([attribute.class("terminal-label mb-4")], [
html.text(header),
]),
html.div([attribute.class("participants-grid")], list.map(answers, extract)),
html.div([attribute.class("singles-grid")], list.map(answers, extract)),
])
}

View file

@ -102,3 +102,16 @@ pub fn step_prompt(text: String, fetch: fn() -> Element(a)) {
]),
])
}
//fn xiew_player_list(items: List(String)) -> Element(Msg) {
// layout("Select or enter your player", None, case items {
// [] -> [html.text("No items in your list yet.")]
// _ -> {
// list.append(
// list.index_map(items, fn(item, index) {
// click_cell(index, item, SelectedPlayer)
// }),
// [input_cell("[#NEW PLAYER]", False, KeyPin)],
// )
// }
// })
//