about summary refs log tree commit diff stats
path: root/sandbox
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox')
-rw-r--r--sandbox/005-sandbox.mu34
1 files changed, 32 insertions, 2 deletions
diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu
index b35f3d13..7e760502 100644
--- a/sandbox/005-sandbox.mu
+++ b/sandbox/005-sandbox.mu
@@ -257,13 +257,13 @@ def render-sandboxes screen:&:screen, sandbox:&:sandbox, left:num, right:num, ro
   env:&:environment, _/optional <- next-ingredient
   return-unless sandbox
   screen-height:num <- screen-height screen
-  at-bottom?:bool <- greater-or-equal row, screen-height
-  return-if at-bottom?
   hidden?:bool <- lesser-than idx, render-from
   {
     break-if hidden?
     # render sandbox menu
     row <- add row, 1
+    at-bottom?:bool <- greater-or-equal row, screen-height
+    return-if at-bottom?
     screen <- move-cursor screen, row, left
     screen <- render-sandbox-menu screen, idx, left, right
     # save menu row so we can detect clicks to it later
@@ -323,6 +323,36 @@ def render-sandbox-menu screen:&:screen, sandbox-index:num, left:num, right:num
   clear-line-until screen, right, 52/background-red
 ]
 
+scenario skip-rendering-sandbox-menu-past-bottom-row [
+  trace-until 100/app  # trace too long
+  assume-screen 50/width, 7/height
+  # recipes.mu is empty
+  assume-resources [
+  ]
+  # create two sandboxes such that the top one just barely fills the screen
+  env:&:environment <- new-programming-environment resources, screen, []
+  render-all screen, env, render
+  assume-console [
+    left-click 1, 75
+    type [add 1, 1]
+    press F4
+    type [add 2, 2]
+    press F4
+  ]
+  run [
+    event-loop screen, console, env, resources
+  ]
+  screen-should-contain [
+    .                               run (F4)           .
+    .                                                  .
+    .──────────────────────────────────────────────────.
+    .0   edit           copy           delete          .
+    .add 2, 2                                          .
+    .4                                                 .
+    .──────────────────────────────────────────────────.
+  ]
+]
+
 # divide up the menu bar for a sandbox into 3 segments, for edit/copy/delete buttons
 # delete-button-right == right
 # all left/right pairs are inclusive
href='#n176'>176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253