mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Since the move onto the craft UI framework, four dialogs could not be
driven by the id the control channel gave for them:
- Keyboard Shortcuts and Menus draws outside the framework's dialog host,
so ui.inspect never listed it and ui.dialog.cancel {"dialog":
"shortcuts"} failed, leaving every command refused behind its modal.
It is now listed under "shortcuts" while open (first: it draws beneath
the host's dialogs), and ui.dialog.cancel with that id closes it without
saving, as its Cancel does. ui.dialog.set/confirm/apply refuse it with a
pointer to edit.keyboardShortcuts params.
- Preferences replied "preferences" but is listed under its host id. It
now replies with that id, or with the reason it did not open.
- Select > Color Range replied {"dialog": {"Ok": id}}: json! serialised the
Result. It now replies through dialog_reply like every other dialog, and
an open that fails is an error instead of ok with {"Err": ...} inside.
- The unsaved-changes prompt was listed under a number with only
`choice`. It is listed as "discard" again with the documented command,
document, remaining, choices and default, and ui.dialog.confirm/cancel
resolve "discard" to it (docs/control-protocol.md, #4920).
Tests drive each through the control channel (handle with a
ControlRequest). Two existing tests change with the documented ids: the
Preferences apply test asserted the old "preferences" reply, and the
save-authorization helper fed the listed prompt id to the host lookup.
docs/control-protocol.md now says which dialogs have fixed ids and what
menu items reply.