feat(app): add the Nostro app, a window for phones and desktops
Linux phones have no banking apps, and a command line is no answer on a phone. The app does everything the nostro command does and, like it, only talks to nostrod: it holds no key and no token. - Nostro.Ui, a toolkit whose screens are functions that fill a frame, ported from imsd-messages ca5cd72d; Nostro.App, the app's state, forms and screens; Nostro.Ui.Shell, which puts them on a Wayland window with Crafter.Graphics; nostro-app; and Nostro.DebugCommands for the --debug-api build. - Client: every method also in an asynchronous form for an sd-event loop, with DaemonMissing and OutcomeUnknown. - nostrod's Flatpak is net.catcrafts.Nostrod now and the app takes net.catcrafts.Nostro; install.sh moves the state. The app's Flatpak, both Flatpaks cross-built for aarch64, and the licence texts they carry. - nostro-fake-system, a made-up bus and bank with a real nostrod on them, to look at the app against. The README's screenshots are taken on it. - The nostro command: an API key's environment is the key's own to say, so --sandbox is for bunq-oauth alone, and a virtual card is listed as VIRTUAL. The published contract changes in three places, before any release (design rule 10): - Transactions' query takes `stored`: answered from what nostrod has stored, without asking the bank. The app searches with it; before, every search was a call to bunq. - AddBunq's `environment` no longer chooses over what the key says of itself: a key of the other environment is refused. - SetCardStatus refuses to freeze or unfreeze a virtual card. bunq reports one as DEACTIVATED however well it pays, and leaves it as it is when asked, without an error. The app is GPL-3.0-only, the library stays LGPL-3.0-only, and no code moved from one to the other (design rule 13). Transaction's schema is unchanged. Verified: the 17 tests pass with every line, function and region of what they link run, and the five lint runs are clean. Every screen was looked at on the made-up system, at a phone's and a desktop's sizes in the light and the dark look, on Plasma under Wayland. What is said of bunq's cards comes from its sandbox, with throwaway users, and from one real virtual card. Known to have been used against production: connecting, and reading accounts, payments and cards. Not known to have been tried: a payment from the app against bunq, OAuth against bunq, and anything on a phone. Building the app takes --graphics=, a Crafter.Graphics checkout on its branch claude/nostro-app, until that branch is merged and pinned here. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
1ea50c50bc
commit
5b4037955b
106 changed files with 17804 additions and 289 deletions
82
interfaces/Nostro.Ui-Input.cppm
Normal file
82
interfaces/Nostro.Ui-Input.cppm
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts®
|
||||
|
||||
export module Nostro.Ui:Input;
|
||||
|
||||
import std;
|
||||
import :Geometry;
|
||||
|
||||
// What the window tells the toolkit of the keyboard, and what the toolkit tells the window of the text field that
|
||||
// has the focus, in terms of neither: the window's own key codes and the compositor's protocol stay on its side.
|
||||
|
||||
export namespace Nostro::Ui {
|
||||
// The keys the toolkit acts on. A letter is the key that types it on the user's layout, not a place on the keyboard.
|
||||
enum class Key : std::uint8_t {
|
||||
None,
|
||||
Enter,
|
||||
Escape,
|
||||
Tab,
|
||||
Space,
|
||||
Backspace,
|
||||
Delete,
|
||||
Left,
|
||||
Right,
|
||||
Up,
|
||||
Down,
|
||||
Home,
|
||||
End,
|
||||
PageUp,
|
||||
PageDown,
|
||||
F5,
|
||||
A,
|
||||
C,
|
||||
F,
|
||||
R,
|
||||
V,
|
||||
X
|
||||
};
|
||||
|
||||
struct Modifiers {
|
||||
bool shift = false;
|
||||
bool control = false;
|
||||
friend bool operator==(const Modifiers&, const Modifiers&) = default;
|
||||
};
|
||||
|
||||
// What a text field holds, by which an on-screen keyboard picks its layout.
|
||||
enum class TextPurpose : std::uint8_t {
|
||||
Normal,
|
||||
Digits, // a whole number
|
||||
Number, // a number with a decimal separator
|
||||
Phone,
|
||||
Url,
|
||||
Email,
|
||||
Name,
|
||||
Password
|
||||
};
|
||||
|
||||
// How an input method treats what is typed, or-ed together. The values are text-input-v3's content hints, so the
|
||||
// window passes them on as they are.
|
||||
namespace TextHint {
|
||||
inline constexpr std::uint32_t none = 0x0;
|
||||
inline constexpr std::uint32_t completion = 0x1;
|
||||
inline constexpr std::uint32_t spellcheck = 0x2;
|
||||
inline constexpr std::uint32_t autoCapitalization = 0x4;
|
||||
inline constexpr std::uint32_t lowercase = 0x8;
|
||||
inline constexpr std::uint32_t hiddenText = 0x40; // show nothing of what is typed
|
||||
inline constexpr std::uint32_t sensitiveData = 0x80; // store and learn nothing of it
|
||||
inline constexpr std::uint32_t prose = completion | spellcheck | autoCapitalization;
|
||||
inline constexpr std::uint32_t secret = hiddenText | sensitiveData;
|
||||
}
|
||||
|
||||
// The text field that has the focus, for the compositor's input method: whether there is one, where its caret is
|
||||
// (an on-screen keyboard keeps clear of it), and what it holds. `field` tells one field from the next: when it
|
||||
// changes, the input method starts afresh.
|
||||
struct TextInputRequest {
|
||||
bool active = false;
|
||||
Box caret;
|
||||
TextPurpose purpose = TextPurpose::Normal;
|
||||
std::uint32_t hints = TextHint::none;
|
||||
std::size_t field = 0;
|
||||
friend bool operator==(const TextInputRequest&, const TextInputRequest&) = default;
|
||||
};
|
||||
}
|
||||
Loading…
Reference in a new issue