mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-11 16:19:27 -07:00
fix: address PR 49 CodeRabbit follow-ups
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
id: TASK-286
|
||||||
|
title: 'Assess and address PR #49 CodeRabbit review follow-ups'
|
||||||
|
status: In Progress
|
||||||
|
assignee: []
|
||||||
|
created_date: '2026-04-11 18:55'
|
||||||
|
labels:
|
||||||
|
- bug
|
||||||
|
- code-review
|
||||||
|
- windows
|
||||||
|
- overlay
|
||||||
|
dependencies: []
|
||||||
|
references:
|
||||||
|
- src/main/runtime/config-hot-reload-handlers.ts
|
||||||
|
- src/renderer/handlers/keyboard.ts
|
||||||
|
- src/renderer/handlers/mouse.ts
|
||||||
|
- vendor/subminer-yomitan
|
||||||
|
priority: high
|
||||||
|
---
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||||
|
Track the current PR #49 review round and resolve the actionable CodeRabbit findings on the Windows update branch.
|
||||||
|
|
||||||
|
Focus areas include the renderer mouse interaction fix, config hot-reload keyboard state, and any other review items that still apply after verifying the current branch state.
|
||||||
|
<!-- SECTION:DESCRIPTION:END -->
|
||||||
|
|
||||||
|
## Acceptance Criteria
|
||||||
|
<!-- AC:BEGIN -->
|
||||||
|
- [ ] #1 All actionable CodeRabbit comments on PR #49 are either fixed or shown to be obsolete with evidence.
|
||||||
|
- [ ] #2 Regression tests are added or updated for any behavior change that could regress.
|
||||||
|
- [ ] #3 The branch passes the repo's relevant verification checks for the touched areas.
|
||||||
|
<!-- AC:END -->
|
||||||
@@ -43,6 +43,7 @@ export function buildConfigHotReloadPayload(config: ResolvedConfig): ConfigHotRe
|
|||||||
const { bindings: sessionBindings, warnings: sessionBindingWarnings } = compileSessionBindings({
|
const { bindings: sessionBindings, warnings: sessionBindingWarnings } = compileSessionBindings({
|
||||||
keybindings,
|
keybindings,
|
||||||
shortcuts: resolveConfiguredShortcuts(config, DEFAULT_CONFIG),
|
shortcuts: resolveConfiguredShortcuts(config, DEFAULT_CONFIG),
|
||||||
|
statsToggleKey: config.stats.toggleKey,
|
||||||
platform:
|
platform:
|
||||||
process.platform === 'darwin'
|
process.platform === 'darwin'
|
||||||
? 'darwin'
|
? 'darwin'
|
||||||
|
|||||||
@@ -723,6 +723,44 @@ test('visible-layer y-t dispatches mpv plugin toggle while overlay owns focus',
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('refreshConfiguredShortcuts updates hot-reloaded stats and watched keys', async () => {
|
||||||
|
const { ctx, handlers, testGlobals } = createKeyboardHandlerHarness();
|
||||||
|
|
||||||
|
try {
|
||||||
|
await handlers.setupMpvInputForwarding();
|
||||||
|
|
||||||
|
testGlobals.setConfiguredShortcuts({
|
||||||
|
copySubtitle: '',
|
||||||
|
copySubtitleMultiple: '',
|
||||||
|
updateLastCardFromClipboard: '',
|
||||||
|
triggerFieldGrouping: '',
|
||||||
|
triggerSubsync: 'Ctrl+Alt+S',
|
||||||
|
mineSentence: '',
|
||||||
|
mineSentenceMultiple: '',
|
||||||
|
multiCopyTimeoutMs: 3333,
|
||||||
|
toggleSecondarySub: '',
|
||||||
|
markAudioCard: '',
|
||||||
|
openRuntimeOptions: 'CommandOrControl+Shift+O',
|
||||||
|
openJimaku: 'Ctrl+Shift+J',
|
||||||
|
openSessionHelp: 'CommandOrControl+Shift+H',
|
||||||
|
openControllerSelect: 'Alt+C',
|
||||||
|
openControllerDebug: 'Alt+Shift+C',
|
||||||
|
toggleSubtitleSidebar: '',
|
||||||
|
toggleVisibleOverlayGlobal: '',
|
||||||
|
});
|
||||||
|
testGlobals.setStatsToggleKey('');
|
||||||
|
testGlobals.setMarkWatchedKey('');
|
||||||
|
|
||||||
|
await handlers.refreshConfiguredShortcuts();
|
||||||
|
|
||||||
|
assert.equal(ctx.state.sessionActionTimeoutMs, 3333);
|
||||||
|
assert.equal(ctx.state.statsToggleKey, '');
|
||||||
|
assert.equal(ctx.state.markWatchedKey, '');
|
||||||
|
} finally {
|
||||||
|
testGlobals.restore();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
test('keyboard mode: controller helpers dispatch popup audio play/cycle and scroll bridge commands', async () => {
|
test('keyboard mode: controller helpers dispatch popup audio play/cycle and scroll bridge commands', async () => {
|
||||||
const { ctx, handlers, testGlobals } = createKeyboardHandlerHarness();
|
const { ctx, handlers, testGlobals } = createKeyboardHandlerHarness();
|
||||||
|
|
||||||
|
|||||||
@@ -86,10 +86,10 @@ export function createKeyboardHandlers(
|
|||||||
markWatchedKey?: string,
|
markWatchedKey?: string,
|
||||||
): void {
|
): void {
|
||||||
ctx.state.sessionActionTimeoutMs = shortcuts.multiCopyTimeoutMs;
|
ctx.state.sessionActionTimeoutMs = shortcuts.multiCopyTimeoutMs;
|
||||||
if (typeof statsToggleKey === 'string' && statsToggleKey.length > 0) {
|
if (typeof statsToggleKey === 'string') {
|
||||||
ctx.state.statsToggleKey = statsToggleKey;
|
ctx.state.statsToggleKey = statsToggleKey;
|
||||||
}
|
}
|
||||||
if (typeof markWatchedKey === 'string' && markWatchedKey.length > 0) {
|
if (typeof markWatchedKey === 'string') {
|
||||||
ctx.state.markWatchedKey = markWatchedKey;
|
ctx.state.markWatchedKey = markWatchedKey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user