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:
@@ -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,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 %>
|
||||
|
||||
Reference in New Issue
Block a user