Skip to content

Commit 0b1e580

Browse files
committed
Add setting to hide sidebar
1 parent 61328f4 commit 0b1e580

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

src/web/Settings.re

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Model = {
1010
context_inspector: bool,
1111
instructor_mode: bool,
1212
benchmark: bool,
13+
show_log_panel: bool,
1314
explainThis: ExplainThisModel.Settings.t,
1415
assistant: AssistantSettings.t,
1516
sidebar: SidebarModel.Settings.t,
@@ -43,6 +44,7 @@ module Model = {
4344
context_inspector: false,
4445
instructor_mode: false,
4546
benchmark: false,
47+
show_log_panel: false,
4648
explainThis: {
4749
show: true,
4850
show_feedback: false,
@@ -113,6 +115,7 @@ module Update = {
113115
| Benchmark
114116
| ContextInspector
115117
| InstructorMode
118+
| ShowLogPanel
116119
| Evaluation(evaluation)
117120
| Sidebar(SidebarModel.Settings.action)
118121
| ExplainThis(ExplainThisModel.Settings.action)
@@ -312,6 +315,11 @@ module Update = {
312315
},
313316
}
314317
}
318+
| ShowLogPanel => {
319+
...settings,
320+
show_log_panel:
321+
!settings.show_log_panel && ExerciseSettings.show_instructor,
322+
}
315323
| Benchmark => {
316324
...settings,
317325
benchmark: !settings.benchmark,

src/web/app/sidebar/Sidebar.re

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ let persistent_view = (~globals: Globals.t) =>
102102
explain_this_tab(~globals),
103103
assistant_tab(~globals),
104104
probes_tab(~globals),
105-
log_control_tab(~globals),
106-
],
105+
]
106+
@ (
107+
globals.settings.show_log_panel ? [log_control_tab(~globals)] : []
108+
),
107109
),
108110
],
109111
);

src/web/view/NutMenu.re

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,12 @@ let dev_group = (~globals) => {
116116
~globals,
117117
"Developer",
118118
[
119-
("✓", "Benchmarks", globals.settings.benchmark, Benchmark),
119+
(
120+
"✓",
121+
"Benchmarks",
122+
globals.settings.benchmark,
123+
Settings.Update.Benchmark,
124+
),
120125
("𝑒", "Elaboration", globals.settings.core.elaborate, Elaborate),
121126
("↵", "Whitespace", globals.settings.secondary_icons, SecondaryIcons),
122127
(
@@ -125,7 +130,19 @@ let dev_group = (~globals) => {
125130
globals.settings.core.flip_animations,
126131
FlipAnimations,
127132
),
128-
],
133+
]
134+
@ (
135+
ExerciseSettings.show_instructor
136+
? [
137+
(
138+
"📃",
139+
"Log Panel",
140+
globals.settings.show_log_panel,
141+
ShowLogPanel,
142+
),
143+
]
144+
: []
145+
),
129146
);
130147
};
131148

0 commit comments

Comments
 (0)