Skip to content

Commit

Permalink
error view
Browse files Browse the repository at this point in the history
  • Loading branch information
bcpeinhardt committed Nov 24, 2024
1 parent e5f1c3d commit 52066a3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
font-family: monospace;
margin: 1px;
border: none;
width: 7rem;
}

td {
Expand Down
23 changes: 11 additions & 12 deletions priv/static/squared_away.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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"]
])
)
]),
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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 }
Expand All @@ -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: $ }
Expand All @@ -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 }
Expand Down Expand Up @@ -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 }
Expand All @@ -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: $ }
Expand All @@ -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 }
Expand Down
7 changes: 4 additions & 3 deletions src/squared_away.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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"),
]),
],
[
Expand Down

0 comments on commit 52066a3

Please sign in to comment.