Skip to content

Commit

Permalink
style deeper stack ap indications differently than first degree
Browse files Browse the repository at this point in the history
  • Loading branch information
disconcision committed Dec 29, 2024
1 parent 8640845 commit 9ce7709
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 29 deletions.
50 changes: 21 additions & 29 deletions src/haz3lcore/zipper/projectors/ProbeProj.re
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ let cur_ap_id = (info: info) =>
| _ => None
};

let resizable_val =
let depth_in_stack = (dyn_stack): option(int) =>
List.find_index(
({ap_id, _}: Probe.frame) => Some(ap_id) == cur_ap^,
dyn_stack,
);

let value_view =
(
~resizable=false,
info: info,
Expand Down Expand Up @@ -138,28 +144,23 @@ let resizable_val =
| _ => Effect.Ignore
};

//TODO(andrew): cleanup
let dyn_ind =
switch (info.statics) {
| _
when
Option.is_some(
List.find_opt(
({ap_id, _}: Probe.frame) => Some(ap_id) == cur_ap^,
closure.dyn_stack,
),
) => [
"dyn-cursor",
]
| _ => []
};

div(
~attrs=[
Attr.title(stack(closure.dyn_stack)),
Attr.title(
"dyn_stack:\n"
++ stack(closure.dyn_stack)
++ "\nstack:\n"
++ stack(closure.stack),
),
Attr.classes(
["val-resize"]
@ dyn_ind
@ (
switch (depth_in_stack(closure.dyn_stack)) {
| Some(0) => ["dyn-cursor"]
| Some(_) => ["dyn-cursor", "light"]
| None => []
}
)
@ (Option.is_some(cur_ap_id(info)) ? ["ap"] : [])
@ (show_indicator(closure.stack) ? ["cursor"] : []),
),
Expand Down Expand Up @@ -223,16 +224,7 @@ let closure_view =
["closure"] @ (show_indicator(closure.stack) ? ["cursor"] : []),
),
],
[
resizable_val(
~resizable=index == 0,
info,
model,
utility,
local,
closure,
),
]
[value_view(~resizable=index == 0, info, model, utility, local, closure)]
@ (is_var_ref(info) ? [] : [env_view(closure, utility)]),
);

Expand Down
3 changes: 3 additions & 0 deletions src/haz3lweb/www/style/projectors/probe.css
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
opacity: 100%;
background-color: var(--exp-ap);
}
.projector.probe .val-resize.dyn-cursor.light .code-text {
opacity: 60%;
}
.projector.probe.Pat .val-resize.dyn-cursor .code-text {
background-color: var(--pat-ap);
}
Expand Down

0 comments on commit 9ce7709

Please sign in to comment.