From 52066a31cb2d07b219738dcb9cff605892c97fa3 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sun, 24 Nov 2024 16:27:53 -0600 Subject: [PATCH] error view --- index.html | 1 - priv/static/squared_away.mjs | 23 +++++++++++------------ src/squared_away.gleam | 7 ++++--- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/index.html b/index.html index 8bb68a0..bfff297 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,6 @@ font-family: monospace; margin: 1px; border: none; - width: 7rem; } td { diff --git a/priv/static/squared_away.mjs b/priv/static/squared_away.mjs index 20f977a..4b36330 100644 --- a/priv/static/squared_away.mjs +++ b/priv/static/squared_away.mjs @@ -7663,8 +7663,6 @@ var Model2 = class extends CustomType { this.errors_to_display = errors_to_display; } }; -var Noop = class extends CustomType { -}; var UserToggledFormulaMode = class extends CustomType { constructor(to2) { super(); @@ -7899,8 +7897,11 @@ function error_view(re) { toList([ ["background-color", "#ffe6e6"], ["color", "#b30000"], + ["margin-top", "10px"], + ["margin", "auto"], + ["width", "90vw"], ["padding", "20px"], - ["border-radius", "20px"] + ["box-sizing", "border-box"] ]) ) ]), @@ -8310,9 +8311,7 @@ function init2(_) { return [model, none()]; } function update(model, msg) { - if (msg instanceof Noop) { - return [model, none()]; - } else if (msg instanceof UserSetCellValue) { + if (msg instanceof UserSetCellValue) { let key = msg.key; let val = msg.val; let model$1 = model.withFields({ @@ -8431,7 +8430,7 @@ function update(model, msg) { throw makeError( "let_assert", "squared_away", - 262, + 260, "", "Pattern match failed, no pattern matched the value.", { value: maybe_expr } @@ -8446,7 +8445,7 @@ function update(model, msg) { throw makeError( "let_assert", "squared_away", - 270, + 268, "", "Pattern match failed, no pattern matched the value.", { value: $ } @@ -8473,7 +8472,7 @@ function update(model, msg) { throw makeError( "let_assert", "squared_away", - 290, + 288, "", "Pattern match failed, no pattern matched the value.", { value: $1 } @@ -8551,7 +8550,7 @@ function update(model, msg) { throw makeError( "let_assert", "squared_away", - 335, + 333, "", "Pattern match failed, no pattern matched the value.", { value: maybe_expr } @@ -8566,7 +8565,7 @@ function update(model, msg) { throw makeError( "let_assert", "squared_away", - 340, + 338, "", "Pattern match failed, no pattern matched the value.", { value: $ } @@ -8593,7 +8592,7 @@ function update(model, msg) { throw makeError( "let_assert", "squared_away", - 359, + 357, "", "Pattern match failed, no pattern matched the value.", { value: $1 } diff --git a/src/squared_away.gleam b/src/squared_away.gleam index 07398ee..44ba191 100644 --- a/src/squared_away.gleam +++ b/src/squared_away.gleam @@ -137,7 +137,6 @@ fn recalculate_col_width(model: Model, col: Int) -> Model { } type Msg { - Noop UserToggledFormulaMode(to: Bool) UserSetCellValue(key: grid.GridKey, val: String) UserFocusedOnCell(key: grid.GridKey) @@ -193,7 +192,6 @@ fn key_press_event(event, cell) { fn update(model: Model, msg: Msg) -> #(Model, effect.Effect(Msg)) { case msg { - Noop -> #(model, effect.none()) UserSetCellValue(key, val) -> { let model = Model(..model, src_grid: grid.insert(model.src_grid, key, val)) @@ -655,8 +653,11 @@ fn error_view(re: renderable_error.RenderableError) { attribute.style([ #("background-color", "#ffe6e6"), #("color", "#b30000"), + #("margin-top", "10px"), + #("margin", "auto"), + #("width", "90vw"), #("padding", "20px"), - #("border-radius", "20px"), + #("box-sizing", "border-box"), ]), ], [