Show help if you arrow-up but don't have any previous commands yet

- @jorgemanrubia this is a little fragile because it relies on CSS `:empty` which fails if any whitespace is present, which is why I needed to make the `<ul>` a one-liner. If we like this we may want to implement something more robust
This commit is contained in:
Jason Zimdars
2025-05-08 13:03:47 -05:00
parent 9a38c28858
commit d02501e008
2 changed files with 3 additions and 4 deletions
+2 -1
View File
@@ -78,7 +78,8 @@
.terminal__help {
display: none;
.terminal--showing-help & {
.terminal--showing-help &,
.terminal--open .terminal__menu:empty ~ & {
border-block-end: 1px dashed;
display: block;
margin-block-end: 0.5lh;
+1 -3
View File
@@ -1,7 +1,5 @@
<%= turbo_frame_tag :recent_commands do %>
<ul class="terminal__menu flex-column txt-align-start margin-none margin-block-end unpad" aria-label="Recent commands">
<%= render partial: "commands/command", collection: @commands %>
</ul>
<ul class="terminal__menu flex-column txt-align-start margin-none margin-block-end unpad" aria-label="Recent commands"><%= render partial: "commands/command", collection: @commands %></ul>
<%= render "commands/help" %>
<% end %>