fix(subsync): reopen manual modal on sync errors

This commit is contained in:
2026-03-01 14:03:55 -08:00
parent 49434bf0cd
commit 87fe81ad3e
10 changed files with 594 additions and 7 deletions

View File

@@ -0,0 +1,48 @@
---
id: TASK-79
title: 'Jimaku modal: auto-close after successful subtitle load'
status: Done
assignee: []
created_date: '2026-03-01 13:52'
updated_date: '2026-03-01 14:06'
labels: []
dependencies: []
priority: medium
ordinal: 10000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Fix Jimaku modal UX so selecting a subtitle file closes the modal automatically once subtitle download+load succeeds.
Current behavior:
- Subtitle file downloads and loads into mpv.
- Jimaku modal remains open until manual close.
Expected behavior:
- On successful `jimakuDownloadFile` result, close modal immediately.
- Keep error behavior unchanged (stay open + show error).
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Successful subtitle file selection/download in Jimaku closes modal automatically.
- [x] #2 Existing error path keeps modal open and shows error.
- [x] #3 Regression test covers success auto-close behavior.
<!-- AC:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Fixed renderer Jimaku success flow to close modal immediately after successful `jimakuDownloadFile` result. Added regression test (`src/renderer/modals/jimaku.test.ts`) that reproduces keyboard file-selection success path and asserts modal close state + `notifyOverlayModalClosed('jimaku')` emission. Kept failure path unchanged.
Also wired new test into `test:core:src` and `test:core:dist` package scripts.
<!-- SECTION:FINAL_SUMMARY:END -->

View File

@@ -0,0 +1,48 @@
---
id: TASK-80
title: 'Jimaku download: rename subtitle to current video basename'
status: Done
assignee: []
created_date: '2026-03-01 14:17'
updated_date: '2026-03-01 14:19'
labels: []
dependencies: []
priority: medium
ordinal: 11000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
When user selects a Jimaku subtitle, save subtitle with filename derived from currently playing media filename instead of Jimaku release filename.
Example:
- Current media: `anime.mkv`
- Downloaded subtitle extension: `.srt`
- Saved subtitle path: `anime.ja.srt`
Scope:
- Apply in Jimaku download IPC path before writing file.
- Preserve collision-avoidance behavior (suffix with jimaku entry id/counter when target exists).
- Keep mpv load flow unchanged except using renamed path.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 Jimaku subtitle destination name uses current media basename plus `.ja` and subtitle extension.
- [x] #2 Existing duplicate filename conflict handling still works.
- [x] #3 Regression tests cover renamed destination path behavior.
<!-- AC:END -->
## Final Summary
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
Jimaku download path generation now derives subtitle filename from currently playing media basename and keeps subtitle extension from Jimaku file (`anime.mkv` + `.srt` => `anime.ja.srt`). Added pure helper `buildJimakuSubtitleFilenameFromMediaPath` and routed IPC download flow through it before existing duplicate-path conflict handling. Added regression tests for local path, missing extension fallback, and remote URL media paths.
<!-- SECTION:FINAL_SUMMARY:END -->