mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-05-13 08:12:54 -07:00
fix: map openCharacterDictionary session action to --open-character-dict
- Add missing Lua CLI dispatch entry for openCharacterDictionary - Add regression test for Alt+Meta+A binding and CLI flag forwarding
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
---
|
||||
id: TASK-343
|
||||
title: Fix macOS character dictionary selector session shortcut
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-05-11 08:05'
|
||||
updated_date: '2026-05-11 08:06'
|
||||
labels:
|
||||
- bug
|
||||
- macos
|
||||
- character-dictionary
|
||||
- plugin
|
||||
dependencies: []
|
||||
modified_files:
|
||||
- plugin/subminer/session_bindings.lua
|
||||
- scripts/test-plugin-session-bindings.lua
|
||||
priority: medium
|
||||
ordinal: 181500
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Opening the character dictionary AniList selector from mpv/session shortcuts should work on macOS. Current generated session bindings include the openCharacterDictionary session action, but the Lua plugin CLI dispatch table does not map that action to the app flag, so the shortcut cannot reach the runtime selector.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 The openCharacterDictionary session action invokes the app with --open-character-dictionary from the mpv plugin.
|
||||
- [x] #2 Regression coverage proves the Lua session-binding CLI map forwards openCharacterDictionary correctly.
|
||||
- [x] #3 Existing session-binding regression coverage still passes.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
TDD red: `lua scripts/test-plugin-session-bindings.lua` failed because openCharacterDictionary did not emit --open-character-dictionary. Green after adding the missing Lua CLI mapping.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Fixed the mpv plugin session action mapping so the character dictionary selector shortcut dispatches `--open-character-dictionary` to the app. Added Lua regression coverage for the macOS-style Alt+Meta+A binding and verified adjacent TypeScript session binding tests.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -159,6 +159,8 @@ function M.create(ctx)
|
||||
return { "--open-youtube-picker" }
|
||||
elseif action_id == "openSessionHelp" then
|
||||
return { "--open-session-help" }
|
||||
elseif action_id == "openCharacterDictionary" then
|
||||
return { "--open-character-dictionary" }
|
||||
elseif action_id == "openControllerSelect" then
|
||||
return { "--open-controller-select" }
|
||||
elseif action_id == "openControllerDebug" then
|
||||
|
||||
@@ -79,6 +79,14 @@ local ctx = {
|
||||
actionType = "session-action",
|
||||
actionId = "playNextSubtitle",
|
||||
},
|
||||
{
|
||||
key = {
|
||||
code = "KeyA",
|
||||
modifiers = { "alt", "meta" },
|
||||
},
|
||||
actionType = "session-action",
|
||||
actionId = "openCharacterDictionary",
|
||||
},
|
||||
{
|
||||
key = {
|
||||
code = "KeyL",
|
||||
@@ -153,6 +161,23 @@ local play_next_call = recorded.async_calls[#recorded.async_calls]
|
||||
assert_true(play_next_call ~= nil, "play-next binding should invoke CLI action")
|
||||
assert_true(play_next_call[2] == "--play-next-subtitle", "play-next binding should pass CLI flag")
|
||||
|
||||
local character_dictionary = nil
|
||||
for _, binding in ipairs(recorded.bindings) do
|
||||
if binding.keys == "Alt+Meta+a" then
|
||||
character_dictionary = binding
|
||||
break
|
||||
end
|
||||
end
|
||||
assert_true(character_dictionary ~= nil, "character dictionary binding should be registered")
|
||||
|
||||
character_dictionary.fn()
|
||||
local character_dictionary_call = recorded.async_calls[#recorded.async_calls]
|
||||
assert_true(character_dictionary_call ~= nil, "character dictionary binding should invoke CLI action")
|
||||
assert_true(
|
||||
character_dictionary_call[2] == "--open-character-dictionary",
|
||||
"character dictionary binding should pass CLI flag"
|
||||
)
|
||||
|
||||
starter.fn()
|
||||
|
||||
local modified_digit = nil
|
||||
|
||||
Reference in New Issue
Block a user