diff --git a/src/haz3lcore/ProbePerform.re b/src/haz3lcore/ProbePerform.re index 8432287374..09728495a0 100644 --- a/src/haz3lcore/ProbePerform.re +++ b/src/haz3lcore/ProbePerform.re @@ -592,11 +592,11 @@ let go = | Some(id) => toggle_statics(~syntax, id, info_map, z) | None => z } - | StepInto(sample, ap_id) => - switch (step_into_sample(~syntax, ~sample, ~ap_id, info_map, z)) { - | Some(z) => z - | None => z - } + // | StepInto(sample, ap_id) => + // switch (step_into_sample(~syntax, ~sample, ~ap_id, info_map, z)) { + // | Some(z) => z + // | None => z + // } }; /* Check if id has either manual or ephermeral probe on it */ diff --git a/src/haz3lcore/projectors/implementations/ProbeProj.re b/src/haz3lcore/projectors/implementations/ProbeProj.re index 90b3190161..887c228ed5 100644 --- a/src/haz3lcore/projectors/implementations/ProbeProj.re +++ b/src/haz3lcore/projectors/implementations/ProbeProj.re @@ -526,9 +526,9 @@ let dropdown_id = (sample_id: int): string => "sample-dropdown-" ++ string_of_int(sample_id); /* Step into handler for sample context menu */ -let step_into_sample = - (~parent, ~sample: Sample.t, ~ap_id: Id.t): Ui_effect.t(unit) => - parent(Probe(StepInto(sample, ap_id))); +// let step_into_sample = +// (~parent, ~sample: Sample.t, ~ap_id: Id.t): Ui_effect.t(unit) => +// parent(Probe(StepInto(sample, ap_id))); /* Context actions for a sample (Pin/Unpin, Step Into, etc.) */ let sample_context_actions = @@ -557,26 +557,26 @@ let sample_context_actions = span(~attrs=[Attr.classes(["shortcut"])], [text("P")]), ], ), - /* Step Into action */ - div( - ~attrs=[ - Attr.classes(["action-item", "step-into-action"]), - Attr.on_pointerdown(_ - /* Stop propagation to prevent parent wrapper's Focus action - from moving cursor back to the probe after we jump */ - => - Effect.Many([ - Effect.Stop_propagation, - step_into_sample(~parent, ~sample, ~ap_id), - ]) - ), - ], - [ - div(~attrs=[Attr.classes(["step-into-icon"])], []), - text("Step into"), - span(~attrs=[Attr.classes(["shortcut"])], [text("Enter")]), - ], - ), + // /* Step Into action */ + // div( + // ~attrs=[ + // Attr.classes(["action-item", "step-into-action"]), + // Attr.on_pointerdown(_ + // /* Stop propagation to prevent parent wrapper's Focus action + // from moving cursor back to the probe after we jump */ + // => + // Effect.Many([ + // Effect.Stop_propagation, + // step_into_sample(~parent, ~sample, ~ap_id), + // ]) + // ), + // ], + // [ + // div(~attrs=[Attr.classes(["step-into-icon"])], []), + // text("Step into"), + // span(~attrs=[Attr.classes(["shortcut"])], [text("Enter")]), + // ], + // ), ], ), ]; @@ -1014,19 +1014,19 @@ let key_handler = print_endline("pin: no sample or ap_id"); Many([Stop_propagation, Prevent_default]); } - | D("Enter") => - /* Step into the indicated sample */ - switch (indicated_sample(~ap_id, di), ap_id) { - | (Some(sample), Some(ap_id)) => - Many([ - Stop_propagation, - Prevent_default, - step_into_sample(~parent, ~sample, ~ap_id), - ]) - | _ => - print_endline("step into: no sample or ap_id"); - Many([Stop_propagation, Prevent_default]); - } + // | D("Enter") => + // /* Step into the indicated sample */ + // switch (indicated_sample(~ap_id, di), ap_id) { + // | (Some(sample), Some(ap_id)) => + // Many([ + // Stop_propagation, + // Prevent_default, + // step_into_sample(~parent, ~sample, ~ap_id), + // ]) + // | _ => + // print_endline("step into: no sample or ap_id"); + // Many([Stop_propagation, Prevent_default]); + // } | _ => Many([Stop_propagation]) }; }; diff --git a/src/haz3lcore/zipper/action/Action.re b/src/haz3lcore/zipper/action/Action.re index fdad7e46a8..e5e66ad02a 100644 --- a/src/haz3lcore/zipper/action/Action.re +++ b/src/haz3lcore/zipper/action/Action.re @@ -8,7 +8,7 @@ type chunkiness = [@deriving (show({with_path: false}), sexp, yojson, eq)] type goal = | Hole(Direction.t) - | TileId([@equal (_, _) => true] Id.t) + // | TileId([@equal (_, _) => true] Id.t) | BindingSiteOfIndicatedVar; [@deriving (show({with_path: false}), sexp, yojson, eq)] @@ -87,8 +87,8 @@ type paste = type probe = | ToggleManual | ToggleAuto - | ToggleStatics - | StepInto(Language.Sample.t, Id.t); + | ToggleStatics; +// | StepInto(Language.Sample.t, Id.t); [@deriving (show({with_path: false}), sexp, yojson, eq)] type t = diff --git a/src/haz3lcore/zipper/action/Move.re b/src/haz3lcore/zipper/action/Move.re index 9d39f2c56f..af8e61596d 100644 --- a/src/haz3lcore/zipper/action/Move.re +++ b/src/haz3lcore/zipper/action/Move.re @@ -143,7 +143,7 @@ let move_dispatch = | Vertical(d) => vertical(~measured, ~col_target, d, z) | Point(goal) => to_point(~measured, ~goal, z) | Goal(Hole(d)) => to_next_grout(d, z) - | Goal(TileId(id)) => jump_to_id_indicated(z, id) + // | Goal(TileId(id)) => jump_to_id_indicated(z, id) | Goal(BindingSiteOfIndicatedVar) => let* ci = Indicated.ci_of(z, statics); let* binding_id = Language.Info.get_binding_site(ci); diff --git a/src/web/app/Page.re b/src/web/app/Page.re index 25f60d57e4..033d4ad095 100644 --- a/src/web/app/Page.re +++ b/src/web/app/Page.re @@ -113,7 +113,7 @@ module Update = { ( ~import_log, ~schedule_action, - ~globals: Globals.Model.t, + ~globals as _: Globals.Model.t, action: Globals.Update.t, model: Model.t, ) => { @@ -137,31 +137,31 @@ module Update = { settings, }, }; - | JumpToTile(id) => - let jump = - Editors.Selection.jump_to_tile( - ~settings=model.globals.settings, - id, - model.editors, - ); - switch (jump) { - | None => model |> Updated.raise_invalid_action - | Some((action, selection)) => - let* editors = - Editors.Update.update( - ~globals, - ~schedule_action=a => schedule_action(Editors(a)), - ~send_assistant_insertion_info= - assistant_callback(~schedule_action, model), - action, - model.editors, - ); - { - ...model, - editors, - selection, - }; - }; + // | JumpToTile(id) => + // let jump = + // Editors.Selection.jump_to_tile( + // ~settings=model.globals.settings, + // id, + // model.editors, + // ); + // switch (jump) { + // | None => model |> Updated.raise_invalid_action + // | Some((action, selection)) => + // let* editors = + // Editors.Update.update( + // ~globals, + // ~schedule_action=a => schedule_action(Editors(a)), + // ~send_assistant_insertion_info= + // assistant_callback(~schedule_action, model), + // action, + // model.editors, + // ); + // { + // ...model, + // editors, + // selection, + // }; + // }; | InitImportAll(file) => JsUtil.read_file(file, data => schedule_action(Globals(FinishImportAll(data))) diff --git a/src/web/app/editors/Editors.re b/src/web/app/editors/Editors.re index 8d5a0425b2..3bc2301a60 100644 --- a/src/web/app/editors/Editors.re +++ b/src/web/app/editors/Editors.re @@ -324,22 +324,22 @@ module Selection = { }; }; - let jump_to_tile = - (~settings, tile, model: Model.t): option((Update.t, t)) => - switch (model) { - | Scratch(m) => - ScratchMode.Selection.jump_to_tile(tile, m) - |> Option.map(((x, y)) => (Update.Scratch(x), Scratch(y))) - | Documentation(m) => - ScratchMode.Selection.jump_to_tile(tile, m) - |> Option.map(((x, y)) => (Update.Scratch(x), Scratch(y))) - | Tutorial(m) => - TutorialsMode.Selection.jump_to_tile(~settings, tile, m) - |> Option.map(((x, y)) => (Update.Tutorial(x), Tutorial(y))) - | Exercises(m) => - ExercisesMode.Selection.jump_to_tile(~settings, tile, m) - |> Option.map(((x, y)) => (Update.Exercises(x), Exercises(y))) - }; + // let jump_to_tile = + // (~settings, tile, model: Model.t): option((Update.t, t)) => + // switch (model) { + // | Scratch(m) => + // ScratchMode.Selection.jump_to_tile(tile, m) + // |> Option.map(((x, y)) => (Update.Scratch(x), Scratch(y))) + // | Documentation(m) => + // ScratchMode.Selection.jump_to_tile(tile, m) + // |> Option.map(((x, y)) => (Update.Scratch(x), Scratch(y))) + // | Tutorial(m) => + // TutorialsMode.Selection.jump_to_tile(~settings, tile, m) + // |> Option.map(((x, y)) => (Update.Tutorial(x), Tutorial(y))) + // | Exercises(m) => + // ExercisesMode.Selection.jump_to_tile(~settings, tile, m) + // |> Option.map(((x, y)) => (Update.Exercises(x), Exercises(y))) + // }; let default_selection = fun diff --git a/src/web/app/editors/cell/CellEditor.re b/src/web/app/editors/cell/CellEditor.re index 4294cb36a4..76ce5e3ac3 100644 --- a/src/web/app/editors/cell/CellEditor.re +++ b/src/web/app/editors/cell/CellEditor.re @@ -179,11 +179,10 @@ module Selection = { |> Option.map(x => Update.ResultAction(x)) }; }; - - let jump_to_tile = (tile, model: Model.t): option((Update.t, t)) => { - CodeEditable.Selection.jump_to_tile(tile, model.editor) - |> Option.map(x => (Update.MainEditor(x), MainEditor)); - }; + // let jump_to_tile = (tile, model: Model.t): option((Update.t, t)) => { + // CodeEditable.Selection.jump_to_tile(tile, model.editor) + // |> Option.map(x => (Update.MainEditor(x), MainEditor)); + // }; }; module View = { @@ -215,12 +214,12 @@ module View = { }, ~signal= fun - | MakeActive(a) => signal(MakeActive(Result(a))) - | JumpTo(id) => - Effect.Many([ - signal(MakeActive(MainEditor)), - inject(MainEditor(Perform(Move(Goal(TileId(id)))))), - ]), + | MakeActive(a) => signal(MakeActive(Result(a))), + // | JumpTo(id) => + // Effect.Many([ + // signal(MakeActive(MainEditor)), + // inject(MainEditor(Perform(Move(Goal(TileId(id)))))), + // ]), ~inject=a => inject(ResultAction(a)), ~selected={ switch (selected) { diff --git a/src/web/app/editors/code/CodeEditable.re b/src/web/app/editors/code/CodeEditable.re index 854d14cb18..7b6241d0a5 100644 --- a/src/web/app/editors/code/CodeEditable.re +++ b/src/web/app/editors/code/CodeEditable.re @@ -79,7 +79,7 @@ module Update = { | Cut | Reparse | Introduce - | Probe(StepInto(_)) + // | Probe(StepInto(_)) | Dump => true | Project(_) | Unselect(_) @@ -189,13 +189,12 @@ module Selection = { } }; }; - - let jump_to_tile = (id: Id.t, model: Model.t): option(Update.t) => { - switch (TermData.root_tile(id, model.editor.syntax.term_data)) { - | Some(_) => Some(Perform(Move(Goal(TileId(id))))) - | None => None - }; - }; + // let jump_to_tile = (id: Id.t, model: Model.t): option(Update.t) => { + // switch (TermData.root_tile(id, model.editor.syntax.term_data)) { + // | Some(_) => Some(Perform(Move(Goal(TileId(id))))) + // | None => None + // }; + // }; }; module View = { diff --git a/src/web/app/editors/mode/ExercisesMode.re b/src/web/app/editors/mode/ExercisesMode.re index 7d9068fe67..52109945b6 100644 --- a/src/web/app/editors/mode/ExercisesMode.re +++ b/src/web/app/editors/mode/ExercisesMode.re @@ -466,21 +466,20 @@ module Selection = { | (Theorem(_), _) => None }; }; - - let jump_to_tile = - (~settings, tile, model: Model.t): option((Update.t, t)) => { - let current = List.nth(model.exercises, model.current); - switch (current) { - | Implementation(e) => - ExerciseMode.Selection.jump_to_tile(~settings, tile, e) - |> Option.map(((x, y)) => (Update.Exercise(x), Implementation(y))) - | Theorem(e) => - TheoremExerciseMode.Selection.jump_to_tile(tile, e) - |> Option.map(((x, y)) => - (Update.TheoremExercise(x), TheoremExercise(y)) - ) - }; - }; + // let jump_to_tile = + // (~settings, tile, model: Model.t): option((Update.t, t)) => { + // let current = List.nth(model.exercises, model.current); + // switch (current) { + // | Implementation(e) => + // ExerciseMode.Selection.jump_to_tile(~settings, tile, e) + // |> Option.map(((x, y)) => (Update.Exercise(x), Implementation(y))) + // | Theorem(e) => + // TheoremExerciseMode.Selection.jump_to_tile(tile, e) + // |> Option.map(((x, y)) => + // (Update.TheoremExercise(x), TheoremExercise(y)) + // ) + // }; + // }; }; module View = { diff --git a/src/web/app/editors/mode/TutorialsMode.re b/src/web/app/editors/mode/TutorialsMode.re index 8e55d2a74c..0ad02bf15e 100644 --- a/src/web/app/editors/mode/TutorialsMode.re +++ b/src/web/app/editors/mode/TutorialsMode.re @@ -315,14 +315,14 @@ module Selection = { List.nth(model.exercises, model.current), ) |> Option.map(a => Update.Tutorial(a)); - let jump_to_tile = - (~settings, tile, model: Model.t): option((Update.t, t)) => - TutorialMode.Selection.jump_to_tile( - ~settings, - tile, - List.nth(model.exercises, model.current), - ) - |> Option.map(((x, y)) => (Update.Tutorial(x), y)); + // let jump_to_tile = + // (~settings, tile, model: Model.t): option((Update.t, t)) => + // TutorialMode.Selection.jump_to_tile( + // ~settings, + // tile, + // List.nth(model.exercises, model.current), + // ) + // |> Option.map(((x, y)) => (Update.Tutorial(x), y)); }; module View = { diff --git a/src/web/app/editors/result/EvalResult.re b/src/web/app/editors/result/EvalResult.re index 26eb3001ac..7f6a102fe9 100644 --- a/src/web/app/editors/result/EvalResult.re +++ b/src/web/app/editors/result/EvalResult.re @@ -366,8 +366,8 @@ module View = { open WebUtil.Node; type event = - | MakeActive(Selection.t) - | JumpTo(Id.t); + | MakeActive(Selection.t); + // | JumpTo(Id.t); let error_msg = (err: ProgramResult.error) => switch (err) { @@ -634,7 +634,7 @@ module View = { [ CellCommon.report_footer_view([ TestView.test_summary( - ~inject_jump=tile => signal(JumpTo(tile)), + // ~inject_jump=tile => signal(JumpTo(tile)), ~test_results, ), ]), diff --git a/src/web/app/explainthis/ExplainThis.re b/src/web/app/explainthis/ExplainThis.re index 62c55328fd..c503e0f625 100644 --- a/src/web/app/explainthis/ExplainThis.re +++ b/src/web/app/explainthis/ExplainThis.re @@ -105,7 +105,7 @@ let highlight = Attr.on_mouseleave(_ => globals.inject_global(Set(ExplainThis(SetHighlight(UnsetHover)))) ), - Attr.on_click(_ => globals.inject_global(JumpToTile(id))), + // Attr.on_click(_ => globals.inject_global(JumpToTile(id))), ]; (Node.span(~attrs, msg), mapping); }; diff --git a/src/web/app/globals/Globals.re b/src/web/app/globals/Globals.re index c38ede22e9..db2ddce226 100644 --- a/src/web/app/globals/Globals.re +++ b/src/web/app/globals/Globals.re @@ -57,7 +57,7 @@ module Action = { type t = | SetFontMetrics(FontMetrics.t) | Set(Settings.Update.t) - | JumpToTile(Haz3lcore.Id.t) // Perform(Select(Term(Id(id, Left)))) + // | JumpToTile(Haz3lcore.Id.t) // Perform(Select(Term(Id(id, Left)))) | InitImportAll([@opaque] Js_of_ocaml.Js.t(Js_of_ocaml.File.file)) | FinishImportAll(option(string)) | ExportForInit @@ -150,7 +150,7 @@ module Update = { switch (action) { | SetFontMetrics(_) => false | Set(action) => Settings.Update.can_undo(action) - | JumpToTile(_) => false + // | JumpToTile(_) => false | InitImportAll(_) => true | FinishImportAll(_) => true | ExportForInit => false diff --git a/src/web/app/helpful-assistant/ChatLSP.re b/src/web/app/helpful-assistant/ChatLSP.re index 2df5f0fcc2..296e7d6fff 100644 --- a/src/web/app/helpful-assistant/ChatLSP.re +++ b/src/web/app/helpful-assistant/ChatLSP.re @@ -242,7 +242,7 @@ module Composition = { let goto = ( ~ed: CodeWithStatics.Model.t, - ~loc: loc_of_goto, + ~loc as _: loc_of_goto, ~goto_var_of_kind: goto_var, ~name: string, ~schedule_action: Editors.Update.t => unit, @@ -278,23 +278,25 @@ module Composition = { // Return appropriate action based on whether we found a match let actions = switch (matching_id) { - | Some(id) => [ - Action.Move(Goal(TileId(id))), - // Moving left by token is essentially a hacky method to get - // off of a variable name (term), and triple/quad click on let binding - // itself (this properly highlights full variable name and - // definition when type annotation exists) - Action.Move(Local(Left, ByToken)), - switch (loc) { - // TODO: Implement structure-based navigation actions - | Definition => - Action.Select(Term(Id(Id.invalid, Direction.Left))) - | Body => Action.Select(Term(Id(Id.invalid, Direction.Left))) - | All => Action.Select(Term(Id(Id.invalid, Direction.Left))) - }, - Action.Copy, - ] - | None => [Action.Select(Term(Id(Id.invalid, Direction.Left)))] + // | Some(id) => [ + // Action.Move(Goal(TileId(id))), + // // Moving left by token is essentially a hacky method to get + // // off of a variable name (term), and triple/quad click on let binding + // // itself (this properly highlights full variable name and + // // definition when type annotation exists) + // Action.Move(Local(Left, ByToken)), + // switch (loc) { + // // TODO: Implement structure-based navigation actions + // | Definition => + // Action.Select(Term(Id(Id.invalid, Direction.Left))) + // | Body => Action.Select(Term(Id(Id.invalid, Direction.Left))) + // | All => Action.Select(Term(Id(Id.invalid, Direction.Left))) + // }, + // Action.Copy, + // ] + | Some(_) + // | None => [Action.Select(Term(Id(Id.invalid, Direction.Left)))] + | None => [] }; List.iter( diff --git a/src/web/app/probesystem/ProbeSidebar.re b/src/web/app/probesystem/ProbeSidebar.re index 5ac220d61e..32204adf05 100644 --- a/src/web/app/probesystem/ProbeSidebar.re +++ b/src/web/app/probesystem/ProbeSidebar.re @@ -5,14 +5,14 @@ open Haz3lcore; module StaticsBase = Language.StaticsBase; -let jump_to = (~globals: Globals.t, id: Id.t, _) => - globals.inject_global(ActiveEditor(Move(Goal(TileId(id))))); +// let jump_to = (~globals: Globals.t, id: Id.t, _) => +// globals.inject_global(ActiveEditor(Move(Goal(TileId(id))))); -let basic = (~globals: Globals.t, id: Id.t) => +let basic = (~globals as _: Globals.t, id: Id.t) => div( ~attrs=[ Attr.create("style", "cursor: pointer;"), - Attr.on_pointerdown(jump_to(~globals, id)), + // Attr.on_pointerdown(jump_to(~globals, id)), ], [text(Id.str3(id))], ); @@ -95,7 +95,7 @@ let fancy = div( ~attrs=[ Attr.class_("probe-entry"), - Attr.on_pointerdown(jump_to(~globals, id)), + // Attr.on_pointerdown(jump_to(~globals, id)), ], [term_view], ); diff --git a/src/web/app/sidebar/Sidebar.re b/src/web/app/sidebar/Sidebar.re index 8f1472b99e..19ea6ec11f 100644 --- a/src/web/app/sidebar/Sidebar.re +++ b/src/web/app/sidebar/Sidebar.re @@ -100,7 +100,7 @@ let persistent_view = (~globals: Globals.t) => ~attrs=[clss(["tabs"])], [ explain_this_tab(~globals), - assistant_tab(~globals), + // assistant_tab(~globals), probes_tab(~globals), ] @ ( diff --git a/src/web/exercises/Grading.re b/src/web/exercises/Grading.re index aba36fa9c3..a367b4ed46 100644 --- a/src/web/exercises/Grading.re +++ b/src/web/exercises/Grading.re @@ -119,7 +119,7 @@ module TestValidationReport = { let view = ( ~globals: Globals.t, - ~signal_jump, + // ~signal_jump, ~signal_editing_test_val_rep, ~signal_update_test_val, ~signal_textbox_active, @@ -246,7 +246,10 @@ module TestValidationReport = { @ Option.to_list( report.test_results |> Option.map(test_results => - TestView.test_bar(~inject_jump=signal_jump, ~test_results) + TestView.test_bar( + /*~inject_jump=signal_jump,*/ + ~test_results, + ) ), ), ), @@ -997,10 +1000,10 @@ module ImplGradingReport = { let individual_report = ( i, - ~signal_jump, + // ~signal_jump, ~hint: hint, ~status, - (id, _), + (_id, _), ~editing_impl_grd_rep, ~globals: Globals.t, ~select_textbox, @@ -1010,7 +1013,7 @@ module ImplGradingReport = { div( ~attrs=[ Attr.classes(["test-report"]), - Attr.on_click(_ => signal_jump(id)), + // Attr.on_click(_ => signal_jump(id)), ], [ div( @@ -1044,7 +1047,7 @@ module ImplGradingReport = { div( ~attrs=[ Attr.classes(["test-report"]), - Attr.on_click(_ => signal_jump(id)), + // Attr.on_click(_ => signal_jump(id)), ], [ div( @@ -1075,13 +1078,8 @@ module ImplGradingReport = { }; let individual_reports = - ( - ~signal_jump, - ~report, - ~editing_impl_grd_rep, - ~globals, - ~select_textbox, - ) => { + // ~signal_jump, + (~report, ~editing_impl_grd_rep, ~globals, ~select_textbox) => { switch (report.test_results) { | Some(test_results) when @@ -1094,7 +1092,7 @@ module ImplGradingReport = { |> List.mapi((i, (status, hint: hint)) => individual_report( i, - ~signal_jump, + // ~signal_jump, ~hint, ~status, List.nth(test_results.test_map, i), @@ -1113,7 +1111,7 @@ module ImplGradingReport = { ( ~globals: Globals.t, ~editing_impl_grd_rep, - ~signal_jump, + // ~signal_jump, ~inject_set_editing_impl_grd_rep, ~inject_update_impl_grd_rep, ~select_textbox, @@ -1130,7 +1128,7 @@ module ImplGradingReport = { [ CellCommon.caption("Implementation Grading", ~rest=subcaption), individual_reports( - ~signal_jump, + // ~signal_jump, ~report, ~editing_impl_grd_rep, ~globals, @@ -1256,7 +1254,7 @@ module ImplGradingReport = { report.test_results |> Option.map(test_results => TestView.test_bar( - ~inject_jump=signal_jump, + /*~inject_jump=signal_jump,*/ ~test_results, ) ), diff --git a/src/web/exercises/TutorialGrading.re b/src/web/exercises/TutorialGrading.re index 8eee586c98..3d477d603c 100644 --- a/src/web/exercises/TutorialGrading.re +++ b/src/web/exercises/TutorialGrading.re @@ -107,7 +107,7 @@ module TestValidationReport = { }; }; - let view = (~signal_jump, report: t, max_points: int) => { + let view = (/*~signal_jump,*/ report: t, max_points: int) => { CellCommon.report_footer_view([ div( ~attrs=[Attr.classes(["test-summary"])], @@ -121,7 +121,10 @@ module TestValidationReport = { @ Option.to_list( report.test_results |> Option.map(test_results => - TestView.test_bar(~inject_jump=signal_jump, ~test_results) + TestView.test_bar( + /*~inject_jump=signal_jump,*/ + ~test_results, + ) ), ), ), @@ -490,11 +493,12 @@ module ImplGradingReport = { }; }; - let individual_report = (i, ~signal_jump, ~hint: string, ~status, (id, _)) => + let individual_report = + (i /*~signal_jump,*/, ~hint: string, ~status, (_id, _)) => div( ~attrs=[ Attr.classes(["test-report"]), - Attr.on_click(_ => signal_jump(id)), + // Attr.on_click(_ => signal_jump(id)), ], [ div( @@ -522,7 +526,7 @@ module ImplGradingReport = { ], ); - let individual_reports = (~signal_jump, ~report) => { + let individual_reports = /*~signal_jump,*/ (~report) => { switch (report.test_results) { | Some(test_results) when @@ -535,7 +539,7 @@ module ImplGradingReport = { |> List.mapi((i, (status, hint)) => individual_report( i, - ~signal_jump, + /*~signal_jump,*/ ~hint, ~status, List.nth(test_results.test_map, i), @@ -547,7 +551,7 @@ module ImplGradingReport = { }; // HiddenTests - let view = (~signal_jump, ~report: t, ~max_points: int) => { + let view = /*~signal_jump,*/ (~report: t, ~max_points: int) => { CellCommon.panel( ~classes=["cell-item", "panel", "test-panel"], [ @@ -555,7 +559,10 @@ module ImplGradingReport = { "Implementation Grading", ~rest=": Hidden Tests vs. Your Implementation", ), - individual_reports(~signal_jump, ~report), + individual_reports( + /*~signal_jump,*/ + ~report, + ), ], ~footer= Some( @@ -577,7 +584,7 @@ module ImplGradingReport = { report.test_results |> Option.map(test_results => TestView.test_bar( - ~inject_jump=signal_jump, + /*~inject_jump=signal_jump,*/ ~test_results, ) ), diff --git a/src/web/view/ContextInspector.re b/src/web/view/ContextInspector.re index 94e1ae7459..a42d65ce44 100644 --- a/src/web/view/ContextInspector.re +++ b/src/web/view/ContextInspector.re @@ -5,7 +5,7 @@ open Util.WebUtil; let alias_view = (s: string): Node.t => div(~attrs=[clss(["typ-alias-view"])], [text(s)]); -let jump_to = entry => Globals.Update.JumpToTile(Language.Ctx.get_id(entry)); +// let jump_to = entry => Globals.Update.JumpToTile(Language.Ctx.get_id(entry)); let context_entry_view = (~globals, entry: Language.Ctx.entry): Node.t => { let view_type = @@ -30,7 +30,7 @@ let context_entry_view = (~globals, entry: Language.Ctx.entry): Node.t => { | ConstructorEntry({name, typ, _}) => div( ~attrs=[ - Attr.on_click(_ => globals.inject_global(jump_to(entry))), + // Attr.on_click(_ => globals.inject_global(jump_to(entry))), clss(["context-entry", "code"]), ], [ @@ -42,7 +42,7 @@ let context_entry_view = (~globals, entry: Language.Ctx.entry): Node.t => { | TVarEntry({name, kind, _}) => div( ~attrs=[ - Attr.on_click(_ => globals.inject_global(jump_to(entry))), + // Attr.on_click(_ => globals.inject_global(jump_to(entry))), clss(["context-entry", "code"]), ], [ @@ -54,7 +54,7 @@ let context_entry_view = (~globals, entry: Language.Ctx.entry): Node.t => { | LivelitEntry({name, expansion_t, _}) => div( ~attrs=[ - Attr.on_click(_ => globals.inject_global(jump_to(entry))), + // Attr.on_click(_ => globals.inject_global(jump_to(entry))), clss(["context-entry", "code", "livelit-entry"]), ], [ diff --git a/src/web/view/ExerciseMode.re b/src/web/view/ExerciseMode.re index 5519a76c15..df9853eb3e 100644 --- a/src/web/view/ExerciseMode.re +++ b/src/web/view/ExerciseMode.re @@ -541,25 +541,24 @@ module Selection = { | TextBox => None }; }; - - let jump_to_tile = - (~settings: Settings.t, id: Id.t, model: Model.t) - : option((Update.t, t)) => { - Exercise.positioned_editors(model.editors) - |> List.find_opt(((p, e: Editor.t)) => - TermData.root_tile(id, e.syntax.term_data) != None - && Exercise.visible_in(p, ~instructor_mode=settings.instructor_mode) - ) - |> Option.map(((pos, _)) => - ( - Update.Editor( - pos, - MainEditor(Perform(Move(Goal(TileId(id))))), - ), - Cell(pos, CellEditor.Selection.MainEditor), - ) - ); - }; + // let jump_to_tile = + // (~settings: Settings.t, id: Id.t, model: Model.t) + // : option((Update.t, t)) => { + // Exercise.positioned_editors(model.editors) + // |> List.find_opt(((p, e: Editor.t)) => + // TermData.root_tile(id, e.syntax.term_data) != None + // && Exercise.visible_in(p, ~instructor_mode=settings.instructor_mode) + // ) + // |> Option.map(((pos, _)) => + // ( + // Update.Editor( + // pos, + // MainEditor(Perform(Move(Goal(TileId(id))))), + // ), + // Cell(pos, CellEditor.Selection.MainEditor), + // ) + // ); + // }; }; module View = { @@ -984,14 +983,14 @@ module View = { `Custom( Grading.TestValidationReport.view( ~globals, - ~signal_jump= - id => - inject( - Editor( - YourTestsValidation, - MainEditor(Perform(Move(Goal(TileId(id))))), - ), - ), + // ~signal_jump= + // id => + // inject( + // Editor( + // YourTestsValidation, + // MainEditor(Perform(Move(Goal(TileId(id))))), + // ), + // ), ~signal_editing_test_val_rep= inject(Instructor(EditingTestValRep)), ~signal_update_test_val= @@ -1116,14 +1115,14 @@ module View = { Always( Grading.ImplGradingReport.view( ~globals, - ~signal_jump= - id => - inject( - Editor( - YourTestsTesting, - MainEditor(Perform(Move(Goal(TileId(id))))), - ), - ), + // ~signal_jump= + // id => + // inject( + // Editor( + // YourTestsTesting, + // MainEditor(Perform(Move(Goal(TileId(id))))), + // ), + // ), ~inject_set_editing_impl_grd_rep= inject(Instructor(EditingImplGrdRep)), ~inject_update_impl_grd_rep= diff --git a/src/web/view/ScratchMode.re b/src/web/view/ScratchMode.re index edf000a71d..f0d31fda2b 100644 --- a/src/web/view/ScratchMode.re +++ b/src/web/view/ScratchMode.re @@ -452,13 +452,12 @@ module Selection = { } | TextBox => None }; - - let jump_to_tile = (tile, model: Model.t): option((Update.t, t)) => - CellEditor.Selection.jump_to_tile( - tile, - List.nth(model.scratchpads, model.current) |> snd, - ) - |> Option.map(((x, y)) => (Update.CellAction(x), Cell(y))); + // let jump_to_tile = (tile, model: Model.t): option((Update.t, t)) => + // CellEditor.Selection.jump_to_tile( + // tile, + // List.nth(model.scratchpads, model.current) |> snd, + // ) + // |> Option.map(((x, y)) => (Update.CellAction(x), Cell(y))); }; module View = { diff --git a/src/web/view/TestView.re b/src/web/view/TestView.re index 00d9093d0b..eda09d6d11 100644 --- a/src/web/view/TestView.re +++ b/src/web/view/TestView.re @@ -6,18 +6,20 @@ module TestStatus = Language.TestStatus; module TestMap = Language.TestMap; module TestResults = Language.TestResults; -let test_bar_segment = (~inject_jump, (id, reports)) => { +let test_bar_segment = (/*~inject_jump,*/ (_id, reports)) => { let status = reports |> TestMap.joint_status |> TestStatus.to_string; div( - ~attrs=[clss(["segment", status]), Attr.on_click(_ => inject_jump(id))], + ~attrs=[ + clss(["segment", status]) /*Attr.on_click(_ => inject_jump(id))*/, + ], [], ); }; -let test_bar = (~inject_jump, ~test_results: TestResults.t) => +let test_bar = /*~inject_jump,*/ (~test_results: TestResults.t) => div( ~attrs=[Attr.class_("test-bar")], - List.map(test_bar_segment(~inject_jump), test_results.test_map), + List.map(test_bar_segment /*(~inject_jump)*/, test_results.test_map), ); // result_summary_str and test_summary_str have been moved to haz3lcore/TestResults.re @@ -44,7 +46,7 @@ let test_text = (test_results: TestResults.t): Node.t => ], ); -let test_summary = (~inject_jump, ~test_results: option(TestResults.t)) => { +let test_summary = /*~inject_jump,*/ (~test_results: option(TestResults.t)) => { div( ~attrs=[clss(["test-summary"])], { @@ -52,7 +54,10 @@ let test_summary = (~inject_jump, ~test_results: option(TestResults.t)) => { | None => [Node.text("No test results available.")] | Some(test_results) => [ test_text(test_results), - test_bar(~inject_jump, ~test_results), + test_bar( + /*~inject_jump,*/ + ~test_results, + ), ] }; }, diff --git a/src/web/view/TheoremExerciseMode.re b/src/web/view/TheoremExerciseMode.re index 36cccb917c..9664b470b6 100644 --- a/src/web/view/TheoremExerciseMode.re +++ b/src/web/view/TheoremExerciseMode.re @@ -429,49 +429,46 @@ module Selection = { |> Option.map(x => Update.Theorem(x)) }; }; - - let jump_to_tile = (tile, model: Model.t): option((Update.t, t)) => { - open OptUtil.Syntax; - let (let.or) = (v: option('b), f: unit => option('b)) => { - switch (v) { - | Some(x) => Some(x) - | None => f() - }; - }; - - let.or () = { - let* _ = - TermData.root_tile( - tile, - model.cells.prelude.editor.editor.syntax.term_data, - ); - Some(( - Update.Prelude(MainEditor(Perform(Move(Goal(TileId(tile)))))), - Prelude(CellEditor.Selection.MainEditor), - )); - }; - let.or () = { - let* _ = - TermData.root_tile( - tile, - model.cells.lemmas.editor.editor.syntax.term_data, - ); - Some(( - Update.Lemmas(MainEditor(Perform(Move(Goal(TileId(tile)))))), - Lemmas(CellEditor.Selection.MainEditor), - )); - }; - - let* _ = - TermData.root_tile( - tile, - model.cells.theorem.editor.editor.syntax.term_data, - ); - Some(( - Update.Theorem(MainEditor(Perform(Move(Goal(TileId(tile)))))), - Theorem(CellEditor.Selection.MainEditor), - )); - }; + // let jump_to_tile = (tile, model: Model.t): option((Update.t, t)) => { + // open OptUtil.Syntax; + // let (let.or) = (v: option('b), f: unit => option('b)) => { + // switch (v) { + // | Some(x) => Some(x) + // | None => f() + // }; + // }; + // let.or () = { + // let* _ = + // TermData.root_tile( + // tile, + // model.cells.prelude.editor.editor.syntax.term_data, + // ); + // Some(( + // Update.Prelude(MainEditor(Perform(Move(Goal(TileId(tile)))))), + // Prelude(CellEditor.Selection.MainEditor), + // )); + // }; + // let.or () = { + // let* _ = + // TermData.root_tile( + // tile, + // model.cells.lemmas.editor.editor.syntax.term_data, + // ); + // Some(( + // Update.Lemmas(MainEditor(Perform(Move(Goal(TileId(tile)))))), + // Lemmas(CellEditor.Selection.MainEditor), + // )); + // }; + // let* _ = + // TermData.root_tile( + // tile, + // model.cells.theorem.editor.editor.syntax.term_data, + // ); + // Some(( + // Update.Theorem(MainEditor(Perform(Move(Goal(TileId(tile)))))), + // Theorem(CellEditor.Selection.MainEditor), + // )); + // }; }; module View = { diff --git a/src/web/view/TutorialMode.re b/src/web/view/TutorialMode.re index b9fe31c2a7..5e50c968bd 100644 --- a/src/web/view/TutorialMode.re +++ b/src/web/view/TutorialMode.re @@ -364,23 +364,23 @@ module Selection = { | TextBox => None }; }; - let jump_to_tile = - (~settings: Settings.t, tile, model: Model.t): option((Update.t, t)) => { - Tutorial.positioned_editors(model.editors) - |> List.find_opt(((p, e: Editor.t)) => - TermData.root_tile(tile, e.syntax.term_data) != None - && Tutorial.visible_in(p, ~instructor_mode=settings.instructor_mode) - ) - |> Option.map(((pos, _)) => - ( - Update.Editor( - pos, - MainEditor(Perform(Move(Goal(TileId(tile))))), - ), - Cell(pos, CellEditor.Selection.MainEditor), - ) - ); - }; + // let jump_to_tile = + // (~settings: Settings.t, tile, model: Model.t): option((Update.t, t)) => { + // Tutorial.positioned_editors(model.editors) + // |> List.find_opt(((p, e: Editor.t)) => + // TermData.root_tile(tile, e.syntax.term_data) != None + // && Tutorial.visible_in(p, ~instructor_mode=settings.instructor_mode) + // ) + // |> Option.map(((pos, _)) => + // ( + // Update.Editor( + // pos, + // MainEditor(Perform(Move(Goal(TileId(tile))))), + // ), + // Cell(pos, CellEditor.Selection.MainEditor), + // ) + // ); + // }; }; module View = { @@ -588,14 +588,14 @@ module View = { div([checkmark_view]); } else if (test_count > 1) { TutorialGrading.ImplGradingReport.view( - ~signal_jump= - id => - inject( - Editor( - HiddenTests, - MainEditor(Perform(Move(Goal(TileId(id))))), - ), - ), + // ~signal_jump= + // id => + // inject( + // Editor( + // HiddenTests, + // MainEditor(Perform(Move(Goal(TileId(id))))), + // ), + // ), ~report=grading_report.impl_grading_report, ~max_points=1, ); @@ -627,14 +627,14 @@ module View = { ), eds.show_report ? TutorialGrading.ImplGradingReport.view( - ~signal_jump= - id => - inject( - Editor( - HiddenTests, - MainEditor(Perform(Move(Goal(TileId(id))))), - ), - ), + // ~signal_jump= + // id => + // inject( + // Editor( + // HiddenTests, + // MainEditor(Perform(Move(Goal(TileId(id))))), + // ), + // ), ~report=grading_report.impl_grading_report, ~max_points=1, )