<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:vm="using:DodoSSH.Client.Shell.ViewModels"
             x:Class="DodoSSH.Client.Android.Views.MoreScreen"
             x:DataType="vm:MainWindowViewModel"
             Background="{StaticResource Canvas}">

  <!--
    Design v2 — MORE: the hub for everything the bottom bar has no room for.

    Four slots and ten destinations is the arithmetic the design solves by putting six of them one tap
    deeper. This screen is that tap. It takes the shell as its data context rather than the vault, because
    every row on it is a navigation command and nothing here reads an item.

    Teams is the tenth and the design never drew it — see the row itself. The count is the design's plus
    one rather than a rearrangement of it: nothing moved out of the bottom bar to make room.

    The rows are the design's list rows rather than cards: a card is one thing you act on, and a destination
    is not a thing — it is a place. Each carries a sentence saying what is behind it, because a hub whose
    entries are one word each is a menu you have to open to read.
  -->

  <Grid RowDefinitions="Auto,*">

    <Border Grid.Row="0" Height="56" Padding="16,0">
      <TextBlock Classes="heading" Text="More" />
    </Border>

    <ScrollViewer Grid.Row="1">
      <StackPanel Margin="10,0,10,20" Spacing="2">

        <Button Classes="row" Command="{Binding ShowScreenCommand}"
                CommandParameter="{x:Static vm:ShellScreen.Snippets}">
          <Grid ColumnDefinitions="Auto,*,Auto">
            <TextBlock Grid.Column="0" Text="❯" Foreground="{StaticResource AccentText}" FontSize="14"
                       Width="22" VerticalAlignment="Center" />
            <StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
              <TextBlock Classes="mono" FontSize="13.5" FontWeight="SemiBold" Text="Snippets" />
              <TextBlock Classes="detail" Foreground="{StaticResource TextDim}" Text="Saved commands, typed into an open shell." />
            </StackPanel>
            <TextBlock Grid.Column="2" Text="›" Foreground="{StaticResource TextGhost}" FontSize="15"
                       VerticalAlignment="Center" />
          </Grid>
        </Button>

        <!--
          These two go through ShowFiles rather than ShowScreen: they are one screen over one view model,
          and which kind of remote it offers is the thing being chosen. See ShowFilesCommand for why that
          is set by the button rather than on arrival.
        -->
        <Button Classes="row" Command="{Binding ShowFilesCommand}"
                CommandParameter="{x:Static vm:RemoteKind.Host}">
          <Grid ColumnDefinitions="Auto,*,Auto">
            <TextBlock Grid.Column="0" Text="⇅" Foreground="{StaticResource AccentText}" FontSize="14"
                       Width="22" VerticalAlignment="Center" />
            <StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
              <TextBlock Classes="mono" FontSize="13.5" FontWeight="SemiBold" Text="SFTP" />
              <TextBlock Classes="detail" Foreground="{StaticResource TextDim}"
                         Text="Browse a host's files." />
            </StackPanel>
            <TextBlock Grid.Column="2" Text="›" Foreground="{StaticResource TextGhost}" FontSize="15"
                       VerticalAlignment="Center" />
          </Grid>
        </Button>

        <Button Classes="row" Command="{Binding ShowFilesCommand}"
                CommandParameter="{x:Static vm:RemoteKind.Bucket}">
          <Grid ColumnDefinitions="Auto,*,Auto">
            <TextBlock Grid.Column="0" Text="◳" Foreground="{StaticResource AccentText}" FontSize="14"
                       Width="22" VerticalAlignment="Center" />
            <StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
              <TextBlock Classes="mono" FontSize="13.5" FontWeight="SemiBold" Text="S3" />
              <TextBlock Classes="detail" Foreground="{StaticResource TextDim}"
                         Text="Objects in an S3-compatible bucket from the keychain." />
            </StackPanel>
            <TextBlock Grid.Column="2" Text="›" Foreground="{StaticResource TextGhost}" FontSize="15"
                       VerticalAlignment="Center" />
          </Grid>
        </Button>

        <Button Classes="row" Command="{Binding ShowScreenCommand}"
                CommandParameter="{x:Static vm:ShellScreen.Logs}">
          <Grid ColumnDefinitions="Auto,*,Auto">
            <TextBlock Grid.Column="0" Text="≡" Foreground="{StaticResource AccentText}" FontSize="14"
                       Width="22" VerticalAlignment="Center" />
            <StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
              <TextBlock Classes="mono" FontSize="13.5" FontWeight="SemiBold" Text="Logs" />
              <TextBlock Classes="detail" Foreground="{StaticResource TextDim}" Text="What has been connected to, and what has changed." />
            </StackPanel>
            <TextBlock Grid.Column="2" Text="›" Foreground="{StaticResource TextGhost}" FontSize="15"
                       VerticalAlignment="Center" />
          </Grid>
        </Button>

        <!--
          Teams, which the v2 design has no row for — it is a shipped screen the design had no slot for
          rather than a drawn one with nothing behind it. It is on the phone because an invitation is
          claimed by signing in, and somebody being invited is at least as likely to be holding a phone.

          ◎ rather than a glyph of its own. The desktop rail already draws teams with it, and two heads
          giving one destination two marks is how a user learns the wrong one.
        -->
        <Button Classes="row" Command="{Binding ShowScreenCommand}"
                CommandParameter="{x:Static vm:ShellScreen.Team}">
          <Grid ColumnDefinitions="Auto,*,Auto">
            <TextBlock Grid.Column="0" Text="◎" Foreground="{StaticResource AccentText}" FontSize="14"
                       Width="22" VerticalAlignment="Center" />
            <StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
              <TextBlock Classes="mono" FontSize="13.5" FontWeight="SemiBold" Text="Teams" />
              <TextBlock Classes="detail" Foreground="{StaticResource TextDim}"
                         Text="Who shares a keychain with you, and who holds its key." />
            </StackPanel>
            <TextBlock Grid.Column="2" Text="›" Foreground="{StaticResource TextGhost}" FontSize="15"
                       VerticalAlignment="Center" />
          </Grid>
        </Button>

        <Button Classes="row" Command="{Binding ShowScreenCommand}"
                CommandParameter="{x:Static vm:ShellScreen.Preferences}">
          <Grid ColumnDefinitions="Auto,*,Auto">
            <TextBlock Grid.Column="0" Text="⚙" Foreground="{StaticResource AccentText}" FontSize="14"
                       Width="22" VerticalAlignment="Center" />
            <StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
              <TextBlock Classes="mono" FontSize="13.5" FontWeight="SemiBold" Text="Preferences" />
              <TextBlock Classes="detail" Foreground="{StaticResource TextDim}" Text="What this phone can and cannot do, and why." />
            </StackPanel>
            <TextBlock Grid.Column="2" Text="›" Foreground="{StaticResource TextGhost}" FontSize="15"
                       VerticalAlignment="Center" />
          </Grid>
        </Button>

        <!--
          Locking, here as well as in the header.

          The header carries it on the three top-level destinations and stands down behind MORE, so without
          this row the five screens under here would each be two taps from locking the keychain. That is the
          wrong direction for the one action whose whole value is being quick, and it is why this is a row
          on the hub rather than something you go back for.
        -->
        <Button Classes="row" Margin="0,10,0,0" Command="{Binding LockCommand}">
          <Grid ColumnDefinitions="Auto,*">
            <TextBlock Grid.Column="0" Text="⚿" Foreground="{StaticResource TextDim}" FontSize="14"
                       Width="22" VerticalAlignment="Center" />
            <StackPanel Grid.Column="1" Spacing="2" VerticalAlignment="Center">
              <TextBlock Classes="mono" FontSize="13.5" FontWeight="SemiBold" Text="Lock the keychain" />
              <TextBlock Classes="detail" Foreground="{StaticResource TextDim}"
                         Text="Shells you have open keep running." />
            </StackPanel>
          </Grid>
        </Button>

        <!--
          ◆ Port forwarding, stated rather than drawn.

          The v2 design gives this hub a sixth entry and a full screen behind it: local, remote and dynamic
          rules with toggles and byte counters. Nothing in this application forwards anything — ISshConnection
          offers OpenShellAsync and nothing else — so every switch on that screen would be a control with no
          effect and every counter a number with no source.

          It is a paragraph here rather than a missing row for the reason the desktop keeps TEAMS in its rail:
          a destination that is quietly absent reads as a product that never intended it, and this one is
          intended. SyncEntityType.PortForward = 9 is reserved on the wire and unused. See
          docs/design-import-gaps.md.
        -->
        <Border Classes="card" Margin="6,16,6,0">
          <StackPanel Spacing="7">
            <StackPanel Orientation="Horizontal" Spacing="9">
              <TextBlock Text="⇄" Foreground="{StaticResource TextFaint}" FontSize="14"
                         VerticalAlignment="Center" />
              <TextBlock Classes="mono" FontSize="13.5" FontWeight="SemiBold"
                         Foreground="{StaticResource TextDim}" Text="Port forwarding" />
              <Border Classes="tag outline" VerticalAlignment="Center">
                <TextBlock Text="NOT BUILT" />
              </Border>
            </StackPanel>
            <TextBlock Classes="body"
                       Text="A connection here opens one channel — a shell — and nothing else, so there is no tunnel for a rule to run through. The wire protocol reserves a slot for forwarding rules and no client writes one. Nothing on this screen is hidden by a setting; the feature is absent." />
          </StackPanel>
        </Border>

      </StackPanel>
    </ScrollViewer>

  </Grid>

</UserControl>
