Public Access
The card that fills the terminal's rectangle while a connection is being made prints two lines saying which machine and at what address, and both were TextBlocks — which in Avalonia is a drawing of a string rather than a string. It is the one place the shell says what it is dialling *before* anything has answered, and on a refusal it is the only copy of that on screen: there is no prompt yet and there may never be one. That is exactly when the value is wanted somewhere else — in a ticket, in a message to whoever owns the host, in the ssh command being written in the window beside this one — and retyping it off the screen is how a digit goes missing from an address that is mostly digits. SelectableTextBlock, the same change the session column's own address got in "Let the session address be selected, and copied whole" and for the same reason. Nothing else about either line moves: same font, size, weight, colour, trimming and centring. The refusal underneath them was already selectable, which made the pair above it the odd ones out. Both lines rather than only the name. They are two lines of one identifier, and a pair where the first can be taken and the second cannot is a worse answer than either. Tooltips are new, and they are what makes the trimming safe rather than a trap. A drag reaches only the glyphs that were drawn, so a name or an address wearing an ellipsis has to be taken with select-all — which takes the whole value, because the ellipsis is a drawing and not a shorter string. The hover says what the whole value is, so nobody copies half of one without having been told there is a half. Same argument, same shape, as the sidebar's. The test asserts that half rather than the easy one, on values long enough to be trimmed inside the card's 460 pixels; values that fit would pass whether the trimming were render-only or not. Confirmed it bites by putting the two TextBlocks back and watching it fail. The phone draws the same two lines in the same state — TerminalScreen.axaml's IsConnectingShowing block — and is deliberately left alone. Its captions are styled by TextBlock.title and TextBlock.detail selectors in Phone.axaml, so the same substitution there silently drops the styling until those rules gain SelectableTextBlock siblings, which is a theme change rather than this one. Worth doing; not worth smuggling in here. Also: WindowDecorations on the splash instead of SystemDecorations, which Avalonia 12 has deprecated in favour of it. That warning was mine, added two commits ago; the main window's own is older and is not this change's to move. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
50 lines
3.1 KiB
XML
50 lines
3.1 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:views="using:DodoSSH.Client.App.Views"
|
|
x:Class="DodoSSH.Client.App.Views.SplashWindow"
|
|
Title="DodoSSH"
|
|
Icon="/Assets/dodossh.ico"
|
|
Width="420"
|
|
MinHeight="160"
|
|
SizeToContent="Height"
|
|
CanResize="False"
|
|
WindowStartupLocation="CenterScreen"
|
|
Background="{StaticResource Chrome}"
|
|
WindowDecorations="None">
|
|
|
|
<!--
|
|
── WHY THERE IS A SPLASH AT ALL ───────────────────────────────────────────────────────────────────────
|
|
|
|
The main window cannot be shown until it has a view model, and the view model cannot exist until
|
|
composition has opened the SQLite cache, bound the terminal's loopback socket, asked the platform about
|
|
a TPM and read the install layout off disk. Until this window existed, all of that happened with nothing
|
|
whatever on screen: the icon had been double-clicked and the desktop looked unchanged.
|
|
|
|
The main window's own IsStarting card already narrates what happens *after* it appears — see
|
|
MainWindow.axaml — and this is the part before that, which no arrangement of the main window can cover.
|
|
|
|
── NOT TOPMOST, AND NO TASKBAR SUPPRESSION ────────────────────────────────────────────────────────────
|
|
|
|
Both are the usual splash-screen habits and both are wrong here. Topmost means a start that stalls sits
|
|
over whatever the user gave up and went back to; hiding the taskbar entry means the one place they would
|
|
look to find out whether anything is happening says nothing. It is a window, briefly, and behaves like
|
|
one.
|
|
|
|
WindowDecorations="None" rather than the BorderOnly the main window asks for: this cannot be resized, has
|
|
no titlebar of its own to drag by, and lives for about a second. (The main window still says
|
|
SystemDecorations, which Avalonia 12 has deprecated in favour of this property; that one is not this
|
|
change's to move.) What replaces the frame is the card's
|
|
own one-pixel border. Escape closes it only once there is nothing left to wait for — see the code-behind.
|
|
|
|
── SizeToContent, WHICH IS ABOUT THE FAILURE AND NOT ABOUT THE SPLASH ─────────────────────────────────
|
|
|
|
A fixed height is right for the one line this normally shows and wrong for the one thing that can replace
|
|
it: CouldNotStart carries an exception's own message, whose length nothing here decides. Inside a fixed
|
|
height a long one would wrap and be clipped, at exactly the moment the text is the only thing this window
|
|
is for. So the height comes from the content, and MinHeight keeps the ordinary one line from looking
|
|
cramped in a box sized for it alone.
|
|
-->
|
|
<views:SplashCard x:Name="Card" />
|
|
|
|
</Window>
|