fix(import): accessible, right-to-left safe Import screen after the visual review

- The folder path is validated only while Folder is the destination (no red
  box under Archive) and shows faint text when unused; typing one chooses
  Folder, as "…" does; a path change replans only for Folder.
- Session times are no longer cut: the Session column sizes to its content.
- Show plan lists file names under a two-line session heading (folder below),
  with full paths in tooltips; header and cells line up (scroll bar reserved).
- Failures say what happened in one localized sentence (source gone, disk
  full, access, server, other), wrap up to three lines, keep the raw text in
  the tooltip, and offer Retry only.
- The status sentence comes with one action (Folder…, Refresh devices,
  Library, Choose folder, Server, Retry).
- The form is locked once an import finished ("New import" plans again); the
  plan header drops the estimate and free space then.
- A card stays "new" until it has a nickname.
- Device entries show keyboard focus and a disabled state with its reason;
  row actions (Merge, Split here) are revealed on the row and named per row;
  composite buttons carry accessible names; tab order follows the layout;
  rows are 36 px.
- Live regions announce planning status, copy progress, the result and the
  failure; progress bars are labelled.
- Right-to-left: paths, templates, name previews and numbers stay left to
  right (numbers right-aligned), the session range uses its own arrow, and
  paths or serials inside sentences are embedded left to right.
- The 56 px number boxes fit four digits despite the kit's double padding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
Claude committed 2026-10-03 17:13:20 +00:00
1 parent 6e01995f7e
commit 0dada9bf47
14 files changed
+568 -134

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
using System.IO;
using System.Net.Http;
using Titano.Core.Import;
using Titano.Core.Localization;
using Titano.Protocol.Client;
namespace Titano.App.Import;
/// <summary>
/// What the Import screen says when an import or its plan stops (BRIEF §0.2 rule 6: one sentence saying what
/// happened): a localized sentence chosen by cause. The exception's own text, which may hold full paths or several
/// sentences, goes to the tooltip and the log only.
/// </summary>
public static class ImportFailures
{
private const int DiskFull = unchecked((int)0x80070070);
private const int HandleDiskFull = unchecked((int)0x80070027);
/// <param name="source">The card or folder as the Devices list names it.</param>
public static string Import(Exception ex, string source) => ex switch
{
ImportSourceUnavailableException => Loc.L("Import.Failed.SourceGone", source),
IOException { HResult: DiskFull or HandleDiskFull } => Loc.L("Import.Failed.Full"),
UnauthorizedAccessException => Loc.L("Import.Failed.Access"),
TitanoApiException or HttpRequestException or UntrustedCertificateException => Loc.L("Import.Failed.Server"),
_ => Loc.L("Import.Failed.Other"),
};
/// <summary>Why the card or folder could not be planned.</summary>
public static string Plan(Exception ex, string source) => ex switch
{
DirectoryNotFoundException or DriveNotFoundException or ImportSourceUnavailableException => Loc.L("Import.Failed.SourceGone", source),
IOException or UnauthorizedAccessException => Loc.L("Import.Status.Unreadable", source),
_ => Loc.L("Import.Status.PlanError"),
};
}