feat(core,app,android,ios): add a first share without a detour or a name to invent

The empty library said to add a link "under Shares, then refresh" with
nothing to press on the phones, and on the desktop only switched page.
All three now open the add form from there, the desktop with the caret
in the link field; and adding already crawls, so there is nothing to
refresh.

A share's name was required before the viewer had seen anything to name.
It is optional now: without one, ShareStore::add_verified takes the
shared folder's own name from the link it has just opened. The link
comes first in each form. The desktop form submits on Enter, and the
Android link field has an eye to check what was pasted.
This commit is contained in:
nvrl committed 2026-10-12 22:37:17 +02:00
1 parent 5807493a4a
commit 603cc0c1a9
14 files changed
+153 -50

No files matched your search

+9 -1
View File
@@ -126,6 +126,8 @@ pub enum Action {
Screenshot,
/// A share link was pasted outside the form: open the form with it.
PasteShare(String),
/// Go to the add form, caret in the link field.
OpenShareForm,
AddShare {
name: String,
url: String,
@@ -524,6 +526,8 @@ pub struct ShareForm {
pub sending: bool,
/// Why the last one was refused.
pub error: Option<String>,
/// Put the caret in the link field on the next frame the form is drawn.
pub focus: bool,
}
pub struct App {
@@ -1512,7 +1516,11 @@ impl App {
self.page = Page::Shares;
self.form.url = url;
self.form.error = None;
self.note(ctx, "share link pasted — name it and add it", false);
self.note(ctx, "share link pasted — add it, or name it first", false);
}
Action::OpenShareForm => {
self.page = Page::Shares;
self.form.focus = true;
}
Action::AddShare {
name,