Ask for the collection's name before there is a collection to name
"New collection from selection" created the collection under a placeholder name and then opened the sidebar tree's rename field to correct it. On a tablet that field is not on screen. The collections panel is always instantiated — app.slint collapses it to zero width and `visible: false` rather than using an `if`, because an `if` there is a layout loop Slint panics on — so the rename TextInput was created all the same, its `init` called `self.focus()`, and Android raised the on-screen keyboard for a box nobody could see. Nothing else on the screen is focusable, so the keyboard had nowhere to go back to: it stayed up, the name could not be typed, and the collection was already written under the name the user did not want. Asked in a sheet instead, on the same card, scrim and dismissal the filing and keywording sheets use. The field takes the keyboard as the sheet appears — over a field that is actually drawn, which is the whole difference — and the card sits a third of the way down rather than centred, because on a tablet the keyboard is the bottom half of the window. Nothing reaches the catalog until Create. That also ends a second bug the old order could not avoid: an abandoned rename used to leave a collection called "New collection" behind, because creating came first. `Field` grows a `take-focus()` for this. A function rather than a property: focus is an event, and bound to a property it would fight whatever took focus next and re-take it on every unrelated re-evaluation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+14
-14
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user