aboutsummaryrefslogtreecommitdiffstats
path: root/src/m_key_server_sync/ui
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2026-09-24 22:31:28 +0200
committersaturneric <[email protected]>2026-09-24 22:31:28 +0200
commite1a60bb1405457da13b4050f912831805403419e (patch)
treec75a6d0298d326aa065afbe855bceb16506a0764 /src/m_key_server_sync/ui
parentfix(email): persist IMAP state on close (diff)
downloadmodules-e1a60bb1405457da13b4050f912831805403419e.tar.gz
modules-e1a60bb1405457da13b4050f912831805403419e.zip
feat(key-server): add batch key operations
- support batch refresh and publish actions for key selections - add publication status checking through the key server - manage request ownership, spacing, cancellation, and summaries - normalize duplicate keys and combine fetched blocks for import - add UI actions for selected keys and key detail views - add unit tests for batch logic and optional test integration
Diffstat (limited to 'src/m_key_server_sync/ui')
-rw-r--r--src/m_key_server_sync/ui/main.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/m_key_server_sync/ui/main.lua b/src/m_key_server_sync/ui/main.lua
index 2ad2a01..5c9c1e9 100644
--- a/src/m_key_server_sync/ui/main.lua
+++ b/src/m_key_server_sync/ui/main.lua
@@ -6,6 +6,7 @@
local search = commands.get("com.bktus.gpgfrontend.module.key_server_sync.search_key")
local publish = commands.get("com.bktus.gpgfrontend.module.key_server_sync.publish_key")
local refresh = commands.get("com.bktus.gpgfrontend.module.key_server_sync.refresh_key")
+local check = commands.get("com.bktus.gpgfrontend.module.key_server_sync.check_publication")
ui.mount { id = "search", anchor = ui.anchor.dialog {}, widget = native.widget("search") }
@@ -33,3 +34,18 @@ ui.action { id = "publish", anchor = ui.anchor("key.details.actions"),
command = publish, update = for_this_key }
ui.action { id = "refresh", anchor = ui.anchor("key.details.actions"),
command = refresh, update = for_this_key }
+ui.action { id = "check", anchor = ui.anchor("key.details.actions"),
+ command = check, update = for_this_key }
+
+-- The same operations on whatever a key list has selected: one key or many,
+-- sent as one batch.
+local function for_the_selection(ctx)
+ local keys = ctx.keys
+ if not keys or #keys == 0 then return { visible = false } end
+ return { args = { keys = keys } }
+end
+
+ui.action { id = "publish_selected", anchor = ui.anchor("key.list.context"),
+ command = publish, update = for_the_selection }
+ui.action { id = "refresh_selected", anchor = ui.anchor("key.list.context"),
+ command = refresh, update = for_the_selection }