Compare commits
328 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 904ca3f3bb | |||
| 7f2d84ad42 | |||
| 9f619d73ef | |||
| a07d5ecdb3 | |||
| f33b5e1e98 | |||
| 1d3f099e44 | |||
| 36e9346595 | |||
| 64acf22292 | |||
| e0621d042d | |||
| 0a2461f45a | |||
| badb82280a | |||
| f1dc418e2d | |||
| edfe6640ac | |||
| 43a8a37f5b | |||
| 4deef69928 | |||
| a6d85def34 | |||
| 420b985c7a | |||
| 82a9d83820 | |||
| e1ffd8770f | |||
| c480fe6ad4 | |||
| 4be3ecf7ac | |||
| f6e7dd496a | |||
| b3b55de4b9 | |||
| 26c031aea8 | |||
| 44c7b05f96 | |||
| 7a561fca45 | |||
| 4682938d17 | |||
| 01f01f18e3 | |||
| 430c4e7120 | |||
| 8b8a99dc79 | |||
| 75c3b15792 | |||
| 00170c6a75 | |||
| da48fdeb97 | |||
| ace809b575 | |||
| 704e664cc3 | |||
| 47301d7492 | |||
| 4ad8109508 | |||
| c749430c77 | |||
| 05be13be9e | |||
| 2a5830c4c5 | |||
| 16b8d80498 | |||
| ebec472daf | |||
| 631e0450b1 | |||
| 7a869ad291 | |||
| b71a1a3d29 | |||
| 7e1a7df403 | |||
| 10b94ce889 | |||
| 2b77ab2406 | |||
| a693cc1866 | |||
| 5cb0ee1591 | |||
| 54109deb94 | |||
| 69474c9642 | |||
| 5805d774ca | |||
| c8c7f46a16 | |||
| f8db9e7119 | |||
| 4fc34ec787 | |||
| 23b88bf20e | |||
| 8ad8ff1671 | |||
| b271a3b1a9 | |||
| 35580ea3e9 | |||
| ab1d5f19fd | |||
| 1c424b4a0b | |||
| e1338113b5 | |||
| 8ac3d517fe | |||
| d6676f7132 | |||
| 28d2da1e64 | |||
| 06892b4838 | |||
| 12c5d956bc | |||
| eef8a7eb41 | |||
| 2d89dd43f2 | |||
| 2ffd503898 | |||
| 2b70b54faf | |||
| 6634ee7626 | |||
| 9b3cb4a42c | |||
| 9db54f8037 | |||
| e8db67e621 | |||
| b6b81a72f5 | |||
| f56de54c10 | |||
| 5b432fa156 | |||
| 3aeb10ae61 | |||
| 062677dcc5 | |||
| 65878e0d8a | |||
| 5b84ba5ef8 | |||
| 40184c67ed | |||
| 2be7829aa5 | |||
| a33d030d34 | |||
| 6287409c83 | |||
| e1a66800b9 | |||
| e73381aa36 | |||
| c3afea6d40 | |||
| 86e0527630 | |||
| 98902b6b0e | |||
| 4010fc1b04 | |||
| c6fa197d0d | |||
| 197636aabe | |||
| 46a2ac5dc7 | |||
| a4532a5fa0 | |||
| 06e8223d63 | |||
| ad2652b21a | |||
| a3569afdcf | |||
| 18648cb6fc | |||
| 5476d44005 | |||
| df380ed1ca | |||
| 0d7b65ec88 | |||
| 8c2d82e361 | |||
| bc75a0cfbd | |||
| 4193a6ce8e | |||
| 45c326db6d | |||
| c9605345bb | |||
| aaa19a33c5 | |||
| 1efc0f8650 | |||
| 7795cc3d69 | |||
| d5d71816ac | |||
| 162be118e1 | |||
| 58f28b7b55 | |||
| 9384d67b8e | |||
| 9e6d039a32 | |||
| 07cedabfe3 | |||
| 2c2f342854 | |||
| e73a380f38 | |||
| 1c189974fc | |||
| 209ab73a31 | |||
| d1aeb3b754 | |||
| f299f2a19e | |||
| ebaed49f76 | |||
| 4703b995da | |||
| fd49e73762 | |||
| 3803d4d47b | |||
| 25fddce372 | |||
| f20d019c11 | |||
| ffeef9c136 | |||
| 6da8ddda3f | |||
| 846b075206 | |||
| a531527e1f | |||
| 7c1d81ea80 | |||
| 9b0fdab840 | |||
| 817a949f99 | |||
| 1233e3630f | |||
| e38a1c945e | |||
| a6a28f52f3 | |||
| e7a522a485 | |||
| ba94a33b46 | |||
| b4df3f8295 | |||
| 518015f534 | |||
| 37cc3a6b01 | |||
| 25faf3ef3e | |||
| a359e91b14 | |||
| 02034e6dc7 | |||
| 30c363375a | |||
| 804755bd3d | |||
| 78715e801c | |||
| 75d5389036 | |||
| 79bf5ebefb | |||
| 4d28efabd0 | |||
| 1cd1cdb11d | |||
| 23b78e6c9b | |||
| 48f93f4344 | |||
| a499554848 | |||
| 7610bba16e | |||
| 5602d751eb | |||
| 457e6f0f10 | |||
| 0eb2868805 | |||
| 1d7406f3d4 | |||
| 107971f151 | |||
| e142d2dc3b | |||
| f448106f92 | |||
| faf82fa3ed | |||
| 2622949ac7 | |||
| af17f54ecd | |||
| b6975eae07 | |||
| 1ab7e6e1da | |||
| f21fc95d17 | |||
| a38b4d8583 | |||
| 8e9d392b21 | |||
| 01a48f4714 | |||
| e3c870143f | |||
| dae1f817e0 | |||
| bec69d1b71 | |||
| c6ac962f7a | |||
| 2211c086c0 | |||
| e14dad410e | |||
| 8c8f828b59 | |||
| 667bde944c | |||
| f1b5082801 | |||
| 1ca9cbc20d | |||
| 47aeabbc58 | |||
| 3e445aee9e | |||
| 42b5b6ef89 | |||
| 396fde3011 | |||
| 20f5de1cf7 | |||
| 8ebf6f02ec | |||
| 2a2eee825c | |||
| af1200b8d7 | |||
| 0674daf9c4 | |||
| f492622a8b | |||
| ca2b7bb2fe | |||
| 3a27c026b6 | |||
| 88099e2ffa | |||
| a8682c33f2 | |||
| d8cf83d517 | |||
| 6332fc4800 | |||
| a1f196ee52 | |||
| fb20e1ca25 | |||
| 51829159f2 | |||
| 162223943d | |||
| 41f7d754cd | |||
| f9ef8b31b1 | |||
| 64dd5ecc3d | |||
| 824443d93b | |||
| 1fb8e2e168 | |||
| 1e20704d39 | |||
| bf1a866f2f | |||
| c432f35a91 | |||
| 354a1a5796 | |||
| 5a610d9d02 | |||
| 585fea972c | |||
| 84c2bbcc0d | |||
| 65d9f5d54d | |||
| 910cf2dca4 | |||
| d2ca24f1c7 | |||
| 61cf0a2570 | |||
| d8859ec918 | |||
| ca916d2ef5 | |||
| 0bd58f72ea | |||
| 603cafff20 | |||
| c5f4ffebe5 | |||
| 94c1b131ef | |||
| 0bd1a18cd7 | |||
| c8b286ad66 | |||
| fcfd98843c | |||
| 656d686208 | |||
| a1209ca69f | |||
| cb9a599b23 | |||
| 3dfa713b29 | |||
| c16bc26a58 | |||
| 9c542b57e0 | |||
| 7856967920 | |||
| 6dcb979f4c | |||
| 978a859cc2 | |||
| f345547963 | |||
| dfb54630df | |||
| 402788b1e2 | |||
| 5162cf416a | |||
| 986ae971d1 | |||
| 185915628d | |||
| b8d9873f14 | |||
| 79616abde9 | |||
| 97d063baa8 | |||
| 8a82a1b5f9 | |||
| ee21c77fd0 | |||
| 1d36409fc7 | |||
| bba1bd554e | |||
| 781e6dd4fa | |||
| 9f0f8a2ce9 | |||
| 7a83fc5168 | |||
| 08d44499d3 | |||
| cfdc6668df | |||
| b6f3d0aad3 | |||
| dc54daa79d | |||
| 9d49e9eaa8 | |||
| a37ab476dd | |||
| b5fcd4f072 | |||
| 09e142279a | |||
| 531f8027bd | |||
| 35cad19839 | |||
| f868fdbbb3 | |||
| 5cc22e3f1b | |||
| 36085b6d1c | |||
| 8343b42b8e | |||
| 579661fbef | |||
| 1c69452356 | |||
| 321e59b3ac | |||
| f2e9c37f61 | |||
| 2d3bb19458 | |||
| 31f76ad476 | |||
| cb93601e16 | |||
| a17c2296d5 | |||
| b177be0831 | |||
| 528cf0a57e | |||
| 7bad8ac65e | |||
| 444873c803 | |||
| f1cf13b59c | |||
| 073f84b03e | |||
| 119f0da7a6 | |||
| adcae2ee01 | |||
| e95728b4d1 | |||
| 3686788a72 | |||
| b21204c7a0 | |||
| bb605fc051 | |||
| bafe400b95 | |||
| 2f34119a67 | |||
| db327c4ea8 | |||
| a6f20730ad | |||
| 6ca07abbc2 | |||
| 8b286f15e8 | |||
| 2878a1f3d1 | |||
| 83fd351080 | |||
| ff389208c8 | |||
| 7715c1ddd2 | |||
| 53c2e6353a | |||
| 3be0258286 | |||
| 35c2dd0e32 | |||
| 688eedbfc0 | |||
| 9c4a9769a5 | |||
| dbfd9105de | |||
| 10d9cc2db4 | |||
| d516238aba | |||
| 8ab04c3fa6 | |||
| 469091a2a8 | |||
| 8ba1b7953d | |||
| d796a7cfa5 | |||
| 2ff66f1621 | |||
| e773db7e88 | |||
| 57d4d4602c | |||
| 5ef5da2f8c | |||
| ee5803883e | |||
| 5c600b0cbe | |||
| 31d90b0296 | |||
| 250989c495 | |||
| 3f36c3d85b | |||
| a1846ba23d | |||
| a25c39dd22 | |||
| 1aa0e410ec | |||
| 0402b773ed | |||
| 3fb18c6b03 | |||
| f61524bef4 | |||
| 6922a6741f | |||
| 272d92169d |
@@ -20,19 +20,13 @@ jobs:
|
||||
with:
|
||||
bun-version: 1.3.5
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.12.0
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.bun/install/cache
|
||||
node_modules
|
||||
vendor/subminer-yomitan/node_modules
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/subminer-yomitan/package-lock.json') }}
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bun-
|
||||
|
||||
@@ -41,7 +35,7 @@ jobs:
|
||||
|
||||
- name: Build (TypeScript check)
|
||||
# Keep explicit typecheck for fast fail before full build/bundle.
|
||||
run: bun run typecheck
|
||||
run: bun run tsc --noEmit
|
||||
|
||||
- name: Test suite (source)
|
||||
run: bun run test:fast
|
||||
@@ -60,12 +54,12 @@ jobs:
|
||||
- name: Build (bundle)
|
||||
run: bun run build
|
||||
|
||||
- name: Immersion SQLite verification
|
||||
run: bun run test:immersion:sqlite:dist
|
||||
|
||||
- name: Dist smoke suite
|
||||
run: bun run test:smoke:dist
|
||||
|
||||
- name: Build docs
|
||||
run: bun run docs:build
|
||||
|
||||
- name: Security audit
|
||||
run: bun audit --audit-level high
|
||||
continue-on-error: true
|
||||
|
||||
@@ -26,28 +26,19 @@ jobs:
|
||||
with:
|
||||
bun-version: 1.3.5
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.12.0
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.bun/install/cache
|
||||
node_modules
|
||||
vendor/subminer-yomitan/node_modules
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/subminer-yomitan/package-lock.json') }}
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bun-
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Build (TypeScript check)
|
||||
run: bun run typecheck
|
||||
|
||||
- name: Test suite (source)
|
||||
run: bun run test:fast
|
||||
|
||||
@@ -65,9 +56,6 @@ jobs:
|
||||
- name: Build (bundle)
|
||||
run: bun run build
|
||||
|
||||
- name: Immersion SQLite verification
|
||||
run: bun run test:immersion:sqlite:dist
|
||||
|
||||
- name: Dist smoke suite
|
||||
run: bun run test:smoke:dist
|
||||
|
||||
@@ -85,11 +73,6 @@ jobs:
|
||||
with:
|
||||
bun-version: 1.3.5
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.12.0
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
@@ -97,8 +80,7 @@ jobs:
|
||||
~/.bun/install/cache
|
||||
node_modules
|
||||
vendor/texthooker-ui/node_modules
|
||||
vendor/subminer-yomitan/node_modules
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/texthooker-ui/package.json', 'vendor/subminer-yomitan/package-lock.json') }}
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/texthooker-ui/package.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bun-
|
||||
|
||||
@@ -116,17 +98,6 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build unversioned AppImage
|
||||
run: |
|
||||
shopt -s nullglob
|
||||
appimages=(release/SubMiner-*.AppImage)
|
||||
if [ "${#appimages[@]}" -eq 0 ]; then
|
||||
echo "No versioned AppImage found to create unversioned artifact."
|
||||
ls -la release
|
||||
exit 1
|
||||
fi
|
||||
cp "${appimages[0]}" release/SubMiner.AppImage
|
||||
|
||||
- name: Upload AppImage artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
@@ -147,11 +118,6 @@ jobs:
|
||||
with:
|
||||
bun-version: 1.3.5
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.12.0
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
@@ -159,8 +125,7 @@ jobs:
|
||||
~/.bun/install/cache
|
||||
node_modules
|
||||
vendor/texthooker-ui/node_modules
|
||||
vendor/subminer-yomitan/node_modules
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/texthooker-ui/package.json', 'vendor/subminer-yomitan/package-lock.json') }}
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'vendor/texthooker-ui/package.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bun-
|
||||
|
||||
@@ -237,19 +202,6 @@ jobs:
|
||||
with:
|
||||
bun-version: 1.3.5
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.bun/install/cache
|
||||
node_modules
|
||||
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-bun-
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install --frozen-lockfile
|
||||
|
||||
- name: Build Bun subminer wrapper
|
||||
run: make build-launcher
|
||||
|
||||
@@ -261,9 +213,10 @@ jobs:
|
||||
|
||||
- name: Package optional assets bundle
|
||||
run: |
|
||||
tar -czf "release/subminer-assets.tar.gz" \
|
||||
VERSION="${GITHUB_REF#refs/tags/}"
|
||||
tar -czf "release/subminer-assets-${VERSION}.tar.gz" \
|
||||
config.example.jsonc \
|
||||
plugin/subminer \
|
||||
plugin/subminer.lua \
|
||||
plugin/subminer.conf \
|
||||
assets/themes/subminer.rasi
|
||||
|
||||
@@ -299,13 +252,11 @@ jobs:
|
||||
echo "$CHANGES" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Publish Release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
cat > release-body.md <<'EOF'
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: ${{ steps.version.outputs.VERSION }}
|
||||
body: |
|
||||
## Changes
|
||||
${{ steps.changelog.outputs.CHANGES }}
|
||||
|
||||
@@ -313,8 +264,8 @@ jobs:
|
||||
|
||||
### AppImage (Recommended)
|
||||
1. Download the AppImage below
|
||||
2. Make it executable: `chmod +x SubMiner.AppImage`
|
||||
3. Run: `./SubMiner.AppImage`
|
||||
2. Make it executable: `chmod +x SubMiner-*.AppImage`
|
||||
3. Run: `./SubMiner-*.AppImage`
|
||||
|
||||
### macOS
|
||||
1. Download `subminer-*.dmg`
|
||||
@@ -325,44 +276,21 @@ jobs:
|
||||
See the [README](https://github.com/${{ github.repository }}#installation) for manual installation instructions.
|
||||
|
||||
### Optional Assets (config example + mpv plugin + rofi theme)
|
||||
1. Download `subminer-assets.tar.gz`
|
||||
1. Download `subminer-assets-*.tar.gz`
|
||||
2. Extract and copy `config.example.jsonc` to `~/.config/SubMiner/config.jsonc`
|
||||
3. Copy `plugin/subminer/` directory contents to `~/.config/mpv/scripts/`
|
||||
3. Copy `plugin/subminer.lua` to `~/.config/mpv/scripts/`
|
||||
4. Copy `plugin/subminer.conf` to `~/.config/mpv/script-opts/`
|
||||
5. Copy `assets/themes/subminer.rasi` to:
|
||||
- Linux: `~/.local/share/SubMiner/themes/subminer.rasi`
|
||||
- macOS: `~/Library/Application Support/SubMiner/themes/subminer.rasi`
|
||||
|
||||
Note: the `subminer` wrapper script uses Bun (`#!/usr/bin/env bun`), so `bun` must be installed and on `PATH`.
|
||||
EOF
|
||||
|
||||
if gh release view "${{ steps.version.outputs.VERSION }}" >/dev/null 2>&1; then
|
||||
gh release edit "${{ steps.version.outputs.VERSION }}" \
|
||||
--title "${{ steps.version.outputs.VERSION }}" \
|
||||
--notes-file release-body.md \
|
||||
--prerelease false
|
||||
else
|
||||
gh release create "${{ steps.version.outputs.VERSION }}" \
|
||||
--title "${{ steps.version.outputs.VERSION }}" \
|
||||
--notes-file release-body.md \
|
||||
--prerelease false
|
||||
fi
|
||||
|
||||
shopt -s nullglob
|
||||
artifacts=(
|
||||
files: |
|
||||
release/*.AppImage
|
||||
release/*.dmg
|
||||
release/*.zip
|
||||
release/*.tar.gz
|
||||
release/SHA256SUMS.txt
|
||||
dist/launcher/subminer
|
||||
)
|
||||
|
||||
if [ "${#artifacts[@]}" -eq 0 ]; then
|
||||
echo "No release artifacts found for upload."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for asset in "${artifacts[@]}"; do
|
||||
gh release upload "${{ steps.version.outputs.VERSION }}" "$asset" --clobber
|
||||
done
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
@@ -5,10 +5,9 @@ node_modules/
|
||||
out/
|
||||
dist/
|
||||
release/
|
||||
build/yomitan/
|
||||
|
||||
# Launcher build artifact (produced by make build-launcher)
|
||||
/subminer
|
||||
subminer
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
@@ -37,4 +36,3 @@ tests/*
|
||||
.worktrees/
|
||||
.codex/*
|
||||
.agents/*
|
||||
docs/*
|
||||
|
||||
@@ -5,6 +5,3 @@
|
||||
[submodule "vendor/yomitan-jlpt-vocab"]
|
||||
path = vendor/yomitan-jlpt-vocab
|
||||
url = https://github.com/stephenmk/yomitan-jlpt-vocab
|
||||
[submodule "vendor/subminer-yomitan"]
|
||||
path = vendor/subminer-yomitan
|
||||
url = https://github.com/ksyasuda/subminer-yomitan
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
.PHONY: help deps build build-launcher install build-linux build-macos build-macos-unsigned clean install-linux install-macos install-plugin uninstall uninstall-linux uninstall-macos print-dirs pretty ensure-bun generate-config generate-example-config dev-start dev-start-macos dev-watch dev-watch-macos dev-toggle dev-stop
|
||||
.PHONY: help deps build build-launcher install build-linux build-macos build-macos-unsigned clean install-linux install-macos install-plugin uninstall uninstall-linux uninstall-macos print-dirs pretty ensure-bun generate-config generate-example-config docs-dev docs docs-preview dev-start dev-start-macos dev-toggle dev-stop
|
||||
|
||||
APP_NAME := subminer
|
||||
THEME_SOURCE := assets/themes/subminer.rasi
|
||||
LAUNCHER_OUT := dist/launcher/$(APP_NAME)
|
||||
THEME_FILE := subminer.rasi
|
||||
PLUGIN_LUA := plugin/subminer.lua
|
||||
PLUGIN_CONF := plugin/subminer.conf
|
||||
|
||||
# Default install prefix for the wrapper script.
|
||||
@@ -52,10 +53,11 @@ help:
|
||||
" clean Remove build artifacts (dist/, release/, AppImage, binary)" \
|
||||
" dev-start Build and launch local Electron app" \
|
||||
" dev-start-macos Build and launch local Electron app with macOS tracker backend" \
|
||||
" dev-watch Start fast watch loop (tsc + renderer + Electron dev app)" \
|
||||
" dev-watch-macos Start watch loop with forced macOS tracker backend" \
|
||||
" dev-toggle Toggle overlay in a running local Electron app" \
|
||||
" dev-stop Stop a running local Electron app" \
|
||||
" docs-dev Run VitePress docs dev server" \
|
||||
" docs Build VitePress static docs" \
|
||||
" docs-preview Preview built VitePress docs" \
|
||||
" install-linux Install Linux wrapper/theme/app artifacts" \
|
||||
" install-macos Install macOS wrapper/theme/app artifacts" \
|
||||
" install-plugin Install mpv Lua plugin and plugin config" \
|
||||
@@ -98,7 +100,7 @@ ensure-bun:
|
||||
@command -v bun >/dev/null 2>&1 || { printf '%s\n' "[ERROR] bun not found"; exit 1; }
|
||||
|
||||
pretty: ensure-bun
|
||||
@bun run format:src
|
||||
@bun run format
|
||||
|
||||
build:
|
||||
@printf '%s\n' "[INFO] Detected platform: $(PLATFORM)"
|
||||
@@ -154,6 +156,15 @@ generate-example-config: ensure-bun
|
||||
@bun run build
|
||||
@bun run generate:config-example
|
||||
|
||||
docs-dev: ensure-bun
|
||||
@bun run docs:dev
|
||||
|
||||
docs: ensure-bun
|
||||
@bun run docs:build
|
||||
|
||||
docs-preview: ensure-bun
|
||||
@bun run docs:preview
|
||||
|
||||
dev-start: ensure-bun
|
||||
@bun run build
|
||||
@bun run electron . --start
|
||||
@@ -162,12 +173,6 @@ dev-start-macos: ensure-bun
|
||||
@bun run build
|
||||
@bun run electron . --start --backend macos
|
||||
|
||||
dev-watch: ensure-bun
|
||||
@bash scripts/dev-watch.sh
|
||||
|
||||
dev-watch-macos: ensure-bun
|
||||
@bash scripts/dev-watch.sh --start --dev --backend macos
|
||||
|
||||
dev-toggle: ensure-bun
|
||||
@bun run electron . --toggle
|
||||
|
||||
@@ -213,12 +218,10 @@ install-macos: build-launcher
|
||||
install-plugin:
|
||||
@printf '%s\n' "[INFO] Installing mpv plugin artifacts"
|
||||
@install -d "$(MPV_SCRIPTS_DIR)"
|
||||
@rm -f "$(MPV_SCRIPTS_DIR)/subminer.lua"
|
||||
@install -d "$(MPV_SCRIPTS_DIR)/subminer"
|
||||
@install -d "$(MPV_SCRIPT_OPTS_DIR)"
|
||||
@cp -R ./plugin/subminer/. "$(MPV_SCRIPTS_DIR)/subminer/"
|
||||
@install -m 0644 "./$(PLUGIN_LUA)" "$(MPV_SCRIPTS_DIR)/subminer.lua"
|
||||
@install -m 0644 "./$(PLUGIN_CONF)" "$(MPV_SCRIPT_OPTS_DIR)/subminer.conf"
|
||||
@printf '%s\n' "Installed to:" " $(MPV_SCRIPTS_DIR)/subminer/main.lua" " $(MPV_SCRIPTS_DIR)/subminer/" " $(MPV_SCRIPT_OPTS_DIR)/subminer.conf"
|
||||
@printf '%s\n' "Installed to:" " $(MPV_SCRIPTS_DIR)/subminer.lua" " $(MPV_SCRIPT_OPTS_DIR)/subminer.conf"
|
||||
|
||||
# Uninstall behavior kept unchanged by default.
|
||||
uninstall: uninstall-linux
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[](./assets/minecard.mp4)
|
||||
[](./assets/minecard.mp4)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -25,17 +25,11 @@
|
||||
SubMiner is an Electron overlay that sits on top of mpv. It turns your video player into a full sentence-mining workstation:
|
||||
|
||||
- **Hover to look up** — Yomitan dictionary popups directly on subtitles
|
||||
- **Keyboard-driven lookup mode** — Navigate token-by-token, keep lookup open across tokens, and control popup scrolling/audio/mining without leaving the overlay
|
||||
- **One-key mining** — Creates Anki cards with sentence, audio, screenshot, and translation
|
||||
- **Instant auto-enrichment** — Optional local AnkiConnect proxy enriches new Yomitan cards immediately
|
||||
- **Reading annotations** — Combines N+1 targeting, frequency-dictionary highlighting, and JLPT underlining while you read
|
||||
- **Hover-aware playback** — By default, hovering subtitle text pauses mpv and resumes on mouse leave (`subtitleStyle.autoPauseVideoOnHover`)
|
||||
- **Subtitle tools** — Download from Jimaku, sync with alass/ffsubsync
|
||||
- **N+1 highlighting** — Marks known words from your Anki deck so unknown ones jump out
|
||||
- **Subtitle tools** — Download from Jimaku, sync with alass/ffsubsync, all in-player
|
||||
- **Immersion tracking** — SQLite-powered stats on your watch time and mining activity
|
||||
- **Custom texthooker page** — Built-in custom texthooker page and websocket, no extra setup
|
||||
- **Annotated websocket API** — Dedicated annotation feed can serve bundled texthooker or external clients with rendered `sentence` HTML plus structured `tokens`
|
||||
- **Jellyfin integration** — Remote playback setup, cast device mode, and direct playback launch
|
||||
- **AniList progress** — Track episode completion and push watching progress automatically
|
||||
- **Texthooker page built in** — WebSocket streaming to external tools, no extra setup
|
||||
|
||||
## Quick start
|
||||
|
||||
@@ -44,55 +38,45 @@ SubMiner is an Electron overlay that sits on top of mpv. It turns your video pla
|
||||
**Linux (AppImage):**
|
||||
|
||||
```bash
|
||||
wget https://github.com/ksyasuda/SubMiner/releases/latest/download/SubMiner.AppImage -O ~/.local/bin/SubMiner.AppImage
|
||||
wget https://github.com/ksyasuda/SubMiner/releases/latest/download/SubMiner-0.1.0.AppImage -O ~/.local/bin/SubMiner.AppImage
|
||||
chmod +x ~/.local/bin/SubMiner.AppImage
|
||||
wget https://github.com/ksyasuda/SubMiner/releases/latest/download/subminer -O ~/.local/bin/subminer
|
||||
chmod +x ~/.local/bin/subminer
|
||||
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> The `subminer` wrapper uses a [Bun](https://bun.sh) shebang. Make sure `bun` is on your `PATH`.
|
||||
|
||||
**From source** or **macOS** — initialize submodules first (`git submodule update --init --recursive`). Source builds now also require Node.js 22 + npm because bundled Yomitan is built from the `vendor/subminer-yomitan` submodule into `build/yomitan` during `bun run build`. Full install guide: [docs.subminer.moe/installation#from-source](https://docs.subminer.moe/installation#from-source).
|
||||
**From source** or **macOS** — see the [installation guide](https://docs.subminer.moe/installation#from-source).
|
||||
|
||||
### 2. Launch the app once
|
||||
### 2. Install the mpv plugin and configuration file
|
||||
|
||||
```bash
|
||||
SubMiner.AppImage
|
||||
wget https://github.com/ksyasuda/SubMiner/releases/latest/download/subminer-assets-0.1.0.tar.gz -O /tmp/subminer-assets.tar.gz
|
||||
tar -xzf /tmp/subminer-assets.tar.gz -C /tmp
|
||||
cp /tmp/plugin/subminer.lua ~/.config/mpv/scripts/
|
||||
cp /tmp/plugin/subminer.conf ~/.config/mpv/script-opts/
|
||||
mkdir -p ~/.config/SubMiner && cp /tmp/config.example.jsonc ~/.config/SubMiner/config.jsonc
|
||||
```
|
||||
|
||||
On first launch, SubMiner now:
|
||||
### 3. Set up Yomitan Dictionaries
|
||||
|
||||
- starts in the tray/background
|
||||
- creates the default config directory and `config.jsonc`
|
||||
- opens a compact setup popup
|
||||
- can install the mpv plugin to the default mpv scripts location for you
|
||||
- links directly to Yomitan settings so you can install dictionaries before finishing setup
|
||||
|
||||
Existing installs that already have a valid config plus at least one Yomitan dictionary are auto-detected as complete and will not be re-prompted.
|
||||
|
||||
### 3. Finish setup
|
||||
|
||||
- click `Install mpv plugin` if you want the default plugin auto-start flow
|
||||
- click `Open Yomitan Settings` and install at least one dictionary
|
||||
- click `Refresh status`
|
||||
- click `Finish setup`
|
||||
|
||||
The mpv plugin step is optional. Yomitan must report at least one installed dictionary before setup can be completed.
|
||||
```bash
|
||||
subminer app --start --yomitan
|
||||
```
|
||||
|
||||
### 4. Mine
|
||||
|
||||
```bash
|
||||
subminer video.mkv # default plugin config auto-starts visible overlay + resumes playback when ready
|
||||
subminer --start video.mkv # optional explicit overlay start when plugin auto_start=no
|
||||
subminer app --start --background
|
||||
subminer video.mkv
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
| Required | Optional |
|
||||
| ------------------------------------------ | -------------------------------------------------- |
|
||||
| `bun`, `node` 22, `npm` | |
|
||||
| `bun` | |
|
||||
| `mpv` with IPC socket | `yt-dlp` |
|
||||
| `ffmpeg` | `guessit` (better AniSkip title/episode detection) |
|
||||
| `mecab` + `mecab-ipadic` | `fzf` / `rofi` |
|
||||
@@ -103,20 +87,9 @@ subminer --start video.mkv # optional explicit overlay start when plugin auto_st
|
||||
|
||||
For full guides on configuration, Anki, Jellyfin, and more, see [docs.subminer.moe](https://docs.subminer.moe).
|
||||
|
||||
## Testing
|
||||
|
||||
- Run `bun run test` or `bun run test:fast` for the default fast lane: config/core coverage plus representative entry/runtime, Anki integration, and main runtime checks.
|
||||
- Run `bun run test:full` for the maintained test surface: Bun-compatible `src/**` coverage, Bun-compatible launcher unit coverage, and a Node compatibility lane for suites that depend on Electron named exports or `node:sqlite` behavior.
|
||||
- Run `bun run test:node:compat` directly when you only need the Node-backed compatibility slice: `ipc`, `anki-jimaku-ipc`, `overlay-manager`, `config-validation`, `startup-config`, and runtime registry coverage.
|
||||
- Run `bun run test:env` for environment-specific verification: launcher smoke/plugin checks plus the SQLite-backed immersion tracker lane.
|
||||
- Run `bun run test:immersion:sqlite` when you specifically need real SQLite persistence coverage under Node with `--experimental-sqlite`.
|
||||
- Run `bun run test:subtitle` for the maintained `alass`/`ffsubsync` subtitle surface.
|
||||
|
||||
The Bun-managed discovery lanes intentionally exclude a small set of suites that are currently Node-only because of Bun runtime/tooling gaps rather than product behavior: Electron named-export tests in `src/core/services/ipc.test.ts`, `src/core/services/anki-jimaku-ipc.test.ts`, and `src/core/services/overlay-manager.test.ts`, plus runtime/config tests in `src/main/config-validation.test.ts`, `src/main/runtime/startup-config.test.ts`, and `src/main/runtime/registry.test.ts`. `bun run test:node:compat` keeps those suites in the standard workflow instead of leaving them untracked.
|
||||
|
||||
## Acknowledgments
|
||||
|
||||
Built on the shoulders of [GameSentenceMiner](https://github.com/bpwhelan/GameSentenceMiner), [Renji's Texthooker Page](https://github.com/Renji-XD/texthooker-ui), [mpvacious](https://github.com/Ajatt-Tools/mpvacious), [Anacreon-Script](https://github.com/friedrich-de/Anacreon-Script), and [Bee's Character Dictionary](https://github.com/bee-san/Japanese_Character_Name_Dictionary). Subtitles powered by [Jimaku.cc](https://jimaku.cc). Dictionary lookups via [Yomitan](https://github.com/yomidevs/yomitan).
|
||||
Built on the shoulders of [GameSentenceMiner](https://github.com/bpwhelan/GameSentenceMiner), [mpvacious](https://github.com/Ajatt-Tools/mpvacious), [Anacreon-Script](https://github.com/friedrich-de/Anacreon-Script), and [autosubsync-mpv](https://github.com/joaquintorres/autosubsync-mpv). Subtitles powered by [Jimaku.cc](https://jimaku.cc). Dictionary lookups via [Yomitan](https://github.com/yomidevs/yomitan).
|
||||
|
||||
## License
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 308 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 23 MiB After Width: | Height: | Size: 13 MiB |
|
Before Width: | Height: | Size: 303 KiB |
|
After Width: | Height: | Size: 523 KiB |
@@ -0,0 +1,8 @@
|
||||
---
|
||||
id: m-0
|
||||
title: 'Codebase Clarity & Composability'
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
Improvements to code clarity, simplicity, and composability identified during the Feb 2026 codebase review. Focus on reducing monolithic files, eliminating duplication, and improving architectural boundaries.
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
id: TASK-19
|
||||
title: Enable overlay keybinds whenever app runtime is active
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-12 08:47'
|
||||
updated_date: '2026-02-12 09:40'
|
||||
labels: []
|
||||
dependencies: []
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Restored task after accidental cleanup. Ensure keybindings are available whenever the Electron runtime is active, while respecting focused overlay/input contexts that require local key handling.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Started implementation: tracing overlay shortcut registration lifecycle and runtime activation gating.
|
||||
|
||||
Root cause: overlay shortcut sync executes during overlay runtime initialization before overlayRuntimeInitialized is set true, so registration could be skipped until a later visibility toggle.
|
||||
|
||||
Implemented fix in initializeOverlayRuntime: after setting overlayRuntimeInitialized = true, immediately call syncOverlayShortcuts() to register overlay keybinds for active runtime state.
|
||||
|
||||
Follow-up from repro: startup path with --start did not initialize overlay runtime (commandNeedsOverlayRuntime excluded start), so overlay keybinds stayed unavailable until first overlay visibility command.
|
||||
|
||||
Updated CLI runtime gating so --start initializes overlay runtime, which activates overlay shortcut registration immediately.
|
||||
|
||||
User clarified MPV-only workflow requirement. Added MPV plugin keybindings and script messages for mining/runtime actions (copy/mine/multi/mode/field-grouping/subsync/audio-card/runtime-options) so these actions are available from mpv chord bindings without relying on overlay global shortcuts.
|
||||
|
||||
Per user direction, reverted all shortcut/runtime/plugin changes from this implementation cycle. Desired behavior is to keep keybindings working only when overlay is active.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Ensured overlay shortcuts are available as soon as overlay runtime becomes active by resyncing after activation flag is set. This prevents startup states where shortcuts remained inactive until a later overlay visibility change.
|
||||
|
||||
Follow-up fix: included --start in overlay-runtime-required commands so keybinds are active right after startup, even before toggling visible/invisible overlays.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
id: TASK-20
|
||||
title: Implement content-bounded overlay windows and decoupled secondary top bar
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-12 08:47'
|
||||
updated_date: '2026-02-12 09:42'
|
||||
labels: []
|
||||
dependencies: []
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Implement the overlay sizing redesign documented in `overlay_window.md`: move visible/invisible overlays from fullscreen bounds to content-bounded sizing, and decouple secondary subtitle rendering into an independent top bar window/lifecycle.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Per-layer bounds ownership is implemented for overlay windows (no shared full-bounds setter for all layers).
|
||||
- [ ] #2 Renderer-to-main IPC contract exists for measured overlay content bounds with layer identity and safe validation.
|
||||
- [ ] #3 Visible and invisible overlays use content-bounded sizing with padding/clamp/jitter protections and full-bounds fallback when measurements are unavailable.
|
||||
- [ ] #4 Secondary subtitle top bar is decoupled from primary overlay visibility and follows mode-specific behavior.
|
||||
- [ ] #5 Automated tests and manual validation matrix cover wrapping, style changes, monitor moves, tracker churn, and simultaneous overlay states.
|
||||
<!-- AC:END -->
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
id: TASK-20.3
|
||||
title: >-
|
||||
Implement content-bounded sizing algorithm for visible and invisible overlay
|
||||
windows
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-12 08:47'
|
||||
updated_date: '2026-02-12 09:42'
|
||||
labels: []
|
||||
dependencies: []
|
||||
parent_task_id: TASK-20
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Implement content-bounded sizing for visible/invisible windows using measured rects plus tracker origin, with robust clamping and jitter resistance.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Bounds algorithm applies configurable padding, minimum size, display-workarea clamp, and integer snap.
|
||||
- [ ] #2 Main-process bounds updates are thresholded/debounced to reduce jitter and unnecessary `setBounds` churn.
|
||||
- [ ] #3 When no valid measurement exists, layer falls back to safe tracker/display bounds without breaking interaction.
|
||||
- [ ] #4 Visible+invisible overlays can coexist without full-window overlap/input conflicts caused by shared fullscreen bounds.
|
||||
<!-- AC:END -->
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
id: TASK-20.4
|
||||
title: Implement dedicated secondary top-bar overlay window
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-12 09:43'
|
||||
labels: []
|
||||
dependencies: []
|
||||
parent_task_id: TASK-20
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Create and integrate a dedicated secondary subtitle overlay window with independent lifecycle, z-order, bounds, and pointer policy, decoupled from primary visible/invisible overlay windows.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 A third overlay window dedicated to secondary subtitles is created and managed alongside existing visible/invisible windows.
|
||||
- [ ] #2 Secondary window visibility follows secondary mode semantics (`hidden`/`visible`/`hover`) independent of primary overlay visibility.
|
||||
- [ ] #3 Secondary subtitle text/mode/style updates are routed directly to the secondary window renderer path.
|
||||
- [ ] #4 Pointer passthrough/interaction behavior for secondary window is explicit and does not regress existing hover/selection interactions.
|
||||
- [ ] #5 Window cleanup/lifecycle (create, close, restore) integrates with existing overlay runtime lifecycle.
|
||||
<!-- AC:END -->
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
id: TASK-20.5
|
||||
title: 'Add rollout guards, tests, and validation matrix for content-bounded overlays'
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-12 09:43'
|
||||
labels: []
|
||||
dependencies: []
|
||||
parent_task_id: TASK-20
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Add safety controls and verification coverage for the new content-bounded overlay architecture and secondary top-bar window.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Feature flag or equivalent rollout guard exists for switching to new sizing/window behavior.
|
||||
- [ ] #2 Service-level/unit tests cover bounds clamping, jitter thresholding, invalid measurement fallback, and per-layer updates.
|
||||
- [ ] #3 Manual validation checklist documents and verifies wrap/no-wrap, style changes, monitor moves, tracker churn, modal interactions, and simultaneous overlay states.
|
||||
- [ ] #4 Regression checks confirm existing single-layer and startup/shutdown behavior remain stable.
|
||||
- [ ] #5 Task includes explicit pass/fail notes from validation run(s).
|
||||
<!-- AC:END -->
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
id: TASK-22
|
||||
title: Make secondary subtitles hover-revealed but non-lookupable in Yomitan sessions
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 16:40'
|
||||
labels: []
|
||||
dependencies: []
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Investigate and implement a UX where secondary subtitles (e.g., English text in our current sessions) become visible when hovered, while explicitly preventing user interactions that allow text lookup (including Yomitan integration) on those subtitles. This should allow readability-on-hover without exposing the secondary overlay text to selection/lookup workflows.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Secondary subtitles become visible only while hovered (or via equivalent hover-triggered mechanism), and return to default hidden/low-visibility state when not hovered.
|
||||
- [ ] #2 When hovered, secondary subtitles do not trigger Yomitan lookup behavior in sessions where Yomitan is enabled.
|
||||
- [ ] #3 Secondary subtitles remain non-interactive for lookup paths (for example, text selection or lookup event propagation) while hover-visibility still works as intended.
|
||||
- [ ] #4 Primary subtitles remain functional and are not regressed by the secondary-subtitle interaction changes.
|
||||
- [ ] #5 If complete prevention of Yomitan lookup on secondary subtitles is not technically possible, the task includes the known limitations and a documented fallback behavior.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 Acceptance criteria are reviewed and covered by explicit manual/automated test coverage for hover reveal and lookup suppression behavior.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
id: TASK-30
|
||||
title: Enable anime streaming via extension repos with configurable mpv playback flow
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:32'
|
||||
updated_date: '2026-02-13 18:34'
|
||||
labels: []
|
||||
dependencies: []
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Add a feature to query configured extension repositories for anime titles/episodes from SubMiner, let users select a streamable source, and play it through mpv with minimal friction. The result should be interactive from Electron (and triggered from mpv via existing command bridge), and fully configurable in app config.
|
||||
|
||||
The implementation should provide a modular backend resolver and a clear UI flow that mirrors existing modal interaction patterns, while keeping mpv playback unchanged (use loadfile with resolved URL and optional headers/referrer metadata).
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Create a stable config schema for one or more extension source backends (repos/endpoints/flags) and persist in user config + default template.
|
||||
- [ ] #2 Resolve an anime search term to candidate series from configured sources.
|
||||
- [ ] #3 Resolve an episode selection to at least one playable stream URL candidate with playback metadata when available.
|
||||
- [ ] #4 Provide an interactive user flow in the app to search/select episode and choose stream source.
|
||||
- [ ] #5 Play the selected stream by invoking the existing mpv command path.
|
||||
- [ ] #6 Support launching the flow from mpv interactions (keyboard/menu) by forwarding a command/event into the renderer modal flow.
|
||||
- [ ] #7 Add error states for empty results, no playable source, and repository failures, with clear user messages.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Execution sequence for implementation: 1) TASK-30.1 (config/model), 2) TASK-30.2 (resolver), 3) TASK-30.3 (IPC), 4) TASK-30.4 (UI modal), 5) TASK-30.5 (mpv trigger), 6) TASK-30.6 (validation/rollout checklist).
|
||||
|
||||
Rollout recommendation: complete TASK-30.6 only after TASK-30.1-30.5 are done and can be verified in combination.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 Config schema validated in app startup (bad config surfaces clear error).
|
||||
- [ ] #2 No hardcoded source/resolver URLs in UI layer; resolver details are backend-driven.
|
||||
- [ ] #3 Play command path uses existing mpv IPC/runtime helpers.
|
||||
- [ ] #4 Documentation includes how to configure extension repos and optional auth/headers.
|
||||
- [ ] #5 Feature is gated behind a config flag and can be disabled cleanly.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
id: TASK-30.1
|
||||
title: Design extension source config model and defaults
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:32'
|
||||
updated_date: '2026-02-13 18:34'
|
||||
labels: []
|
||||
dependencies: []
|
||||
parent_task_id: TASK-30
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Define a backend-agnostic configuration contract for extension repository streaming, including resolver endpoints/process mode, query/auth headers, timeouts, enable flags, and source preference. Wire schema through Config/ResolvedConfig and generated template/defaults so users can manage repos entirely through config.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Add new config sections for extension source providers in Config and ResolvedConfig types.
|
||||
- [ ] #2 Add validation defaults and env-compatible parsing for provider list, auth, header overrides, and feature flags.
|
||||
- [ ] #3 Update config template and docs text so defaults are discoverable and editable.
|
||||
- [ ] #4 Invalid/missing config should fail fast with a clear message path.
|
||||
- [ ] #5 Existing config readers do not regress when no providers are configured.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Phase 1 — Foundation: config contract + validation + defaults
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 Config examples in template/docs include at least one provider entry shape.
|
||||
- [ ] #2 Defaults remain backward-compatible when key is absent.
|
||||
- [ ] #3 Feature can be disabled without touching unrelated settings.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
id: TASK-30.2
|
||||
title: Implement extension resolver service (search + episode + stream resolution)
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:32'
|
||||
updated_date: '2026-02-13 18:34'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-30.1
|
||||
parent_task_id: TASK-30
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Build a dedicated service in main process that queries configured extension repos and normalizes results into a unified internal model, including optional playback metadata. Keep transport abstracted so future backends (local process, remote API, Manatán-compatible source) can be swapped without changing renderer contracts.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Create a typed internal model for source, series, episode, and playable candidate with fields for quality/audio/headers/referrer/userAgent.
|
||||
- [ ] #2 Implement provider abstraction with pluggable fetch/execution strategy from config.
|
||||
- [ ] #3 Add services for searchAnime, listEpisodes, resolveStream (or equivalent) with cancellation/error boundaries.
|
||||
- [ ] #4 Normalize all provider responses into deterministic field names and stable IDs.
|
||||
- [ ] #5 Include resilient handling for empty/no-result/no-URL cases and network faults with explicit error categories.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Phase 2 — Core service: provider integration and stream resolution
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 Resolver never leaks raw provider payload to renderer.
|
||||
- [ ] #2 Streaming URL output includes reason for failure when unavailable.
|
||||
- [ ] #3 Service boundaries allow unit-level validation of request/response mapping logic.
|
||||
- [ ] #4 No blocking calls on Electron UI/main thread; all I/O is async and cancellable.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
id: TASK-30.3
|
||||
title: Expose resolver operations via Electron IPC to renderer
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:32'
|
||||
updated_date: '2026-02-13 18:34'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-30.2
|
||||
parent_task_id: TASK-30
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Add a typed preload and main-IPC contract for streaming queries and playback resolution so the renderer can initiate search/list/resolve without embedding network/provider logic in UI code.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Define IPC handlers in main with input/output schema validation and timeouts.
|
||||
- [ ] #2 Expose corresponding functions in preload `window.electronAPI` and ElectronAPI types.
|
||||
- [ ] #3 Reuse existing mpv command channel for playback and add a dedicated request/response flow for resolver actions.
|
||||
- [ ] #4 Implement safe serialization and error marshalling for resolver-specific failures.
|
||||
- [ ] #5 Add runtime wiring and lifetime management in app startup/shutdown.
|
||||
- [ ] #6 Document event/callback behavior for loading/error states.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Phase 3 — API surface: IPC/preload contract for resolver operations
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 Renderer code can query providers without importing Node-only modules.
|
||||
- [ ] #2 IPC paths have clear names and consistent response shapes across all calls.
|
||||
- [ ] #3 Error paths return explicit machine-readable codes mapped to user-visible messages.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
id: TASK-30.4
|
||||
title: 'Add interactive streaming modal (search, episode list, source selection, play)'
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:32'
|
||||
updated_date: '2026-02-13 18:34'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-30.3
|
||||
parent_task_id: TASK-30
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Implement a renderer flow to query configured providers, display results, let user choose series and episode, and trigger playback for a selected stream. The UI should support keyboard interactions and surface backend errors clearly.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Create modal UI/state model for query, results list, selected item, episode list, candidate qualities, and loading/error status.
|
||||
- [ ] #2 Wire renderer actions to new IPC methods for search/episode/resolve.
|
||||
- [ ] #3 Render one-click or enter-to-play action that calls existing mpv playback pathway.
|
||||
- [ ] #4 Persist minimal user preference (last provider/quality where possible) for faster repeat use.
|
||||
- [ ] #5 Provide empty/error states and accessibility-friendly focus/keyboard navigation for lists.
|
||||
- [ ] #6 Add a no-network mode fallback message when resolver calls fail.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Phase 4 — UX: interactive modal flow and playback callout
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 Modal state is isolated and unsubscribes listeners on close.
|
||||
- [ ] #2 No direct network logic in renderer beyond IPC calls.
|
||||
- [ ] #3 Visual style and behavior are consistent with existing modal patterns.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
id: TASK-30.5
|
||||
title: >-
|
||||
Wire mpv script-message/shortcut trigger into streaming modal and playback
|
||||
path
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:33'
|
||||
updated_date: '2026-02-13 18:34'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-30.3
|
||||
- TASK-30.4
|
||||
parent_task_id: TASK-30
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Allow users to open streaming selection from within mpv via keybind/menu and route that intent into renderer modal and playback flow without requiring separate window focus changes.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Add/extend mpv Lua plugin or existing command registry to emit a custom action for opening the streaming picker.
|
||||
- [ ] #2 Handle this action in main IPC/mpv-command pipeline and forward to renderer modal state.
|
||||
- [ ] #3 Add at least one default keybinding/menu entry documented in config/plugin notes.
|
||||
- [ ] #4 Ensure playback launched from the in-player flow uses the same command path and error messages as renderer-initiated flow.
|
||||
- [ ] #5 Add graceful handling when feature is disabled or no providers are configured.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Phase 5 — In-player entry: mpv trigger/menu integration
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 No duplicate mpv command parsing between picker and legacy commands.
|
||||
- [ ] #2 Feature can be used in overlay and mpv-only mode where applicable.
|
||||
- [ ] #3 No dependency on modal open state when launched by mpv trigger.
|
||||
- [ ] #4 Manual and keybind invocations behave consistently.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
id: TASK-30.6
|
||||
title: >-
|
||||
Add integration validation plan and rollout checklist for anime streaming
|
||||
feature
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:34'
|
||||
updated_date: '2026-02-13 18:34'
|
||||
labels: []
|
||||
dependencies: []
|
||||
parent_task_id: TASK-30
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Create a concrete validation task that defines end-to-end acceptance checks for config loading, resolver behavior, IPC contract correctness, UI flow, and mpv-triggered launch. The checklist should be actionable and align with existing project conventions so completion can be verified without guesswork.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Define test scenarios for config success/failure cases, including invalid provider config and feature disabled mode.
|
||||
- [ ] #2 Define search/list/resolve API contract tests and error-code assertions (empty, timeout, auth error, no playable URL).
|
||||
- [ ] #3 Define renderer UX checks for modal state transitions, loading indicators, empty results, selection, and play invocation.
|
||||
- [ ] #4 Define in-mpv trigger checks for command/message pathway and fallback behavior when modal disabled/unavailable.
|
||||
- [ ] #5 Define manual smoke steps for end-to-end play from query to mpv playback using at least one configured source.
|
||||
- [ ] #6 Document expected logs/telemetry markers for troubleshooting and rollback.
|
||||
- [ ] #7 Define rollback criteria and what constitutes safe partial completion.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Phase 6 — Validation: rollout, smoke tests, and release readiness checklist
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 Checklist covers happy-path and failure-path for each task dependency.
|
||||
- [ ] #2 Verification steps are executable without external tooling assumptions.
|
||||
- [ ] #3 No task can be marked done without explicit evidence fields filled in.
|
||||
- [ ] #4 Rollout and fallback behavior are documented per deployment/release phase.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
id: TASK-30.7
|
||||
title: >-
|
||||
Add English-source preference + hard-sub stripping workflow in Aniyomi
|
||||
streaming path
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:41'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-30.2
|
||||
- TASK-30.5
|
||||
parent_task_id: TASK-30
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Improve the Aniyomi/anime extension streaming flow to prefer English-capable sources with soft subtitles, and automatically recover when only hard-subbed streams are available by stripping embedded subtitles with ffmpeg and attaching external Jimaku subtitle files into mpv.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 During source scoring/selection, prefer providers/sources that declare or expose soft subtitles for English audio or subtitle tracks over hard-subbed alternatives.
|
||||
- [ ] #2 Add a config option for preferred language targets (default English) and fallback policy (favor soft subtitles, then hard-sub fallback).
|
||||
- [ ] #3 Detect when a resolved stream is hard-sub-only and a soft-sub source is unavailable for the same episode.
|
||||
- [ ] #4 When hard subs are used, attempt to generate a subtitle-less playback stream path using ffmpeg and feed an external subtitle file (including Jimaku-provided `.ass/.srt`) into the mpv playback path.
|
||||
- [ ] #5 Preserve stream selection metadata (language tags, subtitle type, availability state) for UI decisions and error messaging.
|
||||
- [ ] #6 If ffmpeg conversion is not possible/disabled or fails, surface a clear status that explains fallback behavior instead of silent failure.
|
||||
- [ ] #7 Integrate subtitle source preferences with Jimaku so user-fetched or resolved subtitles are preferred for burn-in removal cases where supported.
|
||||
- [ ] #8 Add handling for unsupported codecs/containers and provider limitations so direct passthrough is still used when hard-sub stripping is unsafe.
|
||||
- [ ] #9 Document new behavior in feature docs/FAQ: how sources are ranked, what hard-sub stripping does, and known compatibility limitations.
|
||||
<!-- AC:END -->
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
id: TASK-30.8
|
||||
title: >-
|
||||
Add observability and tuning metrics for Aniyomi subtitle-source fallback
|
||||
decisions
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:41'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-30.7
|
||||
parent_task_id: TASK-30
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Add lightweight telemetry/analytics hooks (local logs + optional structured counters) to measure how Aniyomi/anime streaming source selection behaves, including soft-sub preference, hard-sub fallback usage, and ffmpeg+Jimaku post-processing outcomes, to support source ranking tuning.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Track per-playback decision metadata including chosen source, language match score, subtitle mode (soft/hard), and reason for source preference ordering.
|
||||
- [ ] #2 Emit success/failure counters for hard-sub stripping attempts (started/succeeded/failed/unsupported codec) with reason codes.
|
||||
- [ ] #3 Log whether Jimaku subtitle attachment was available and successfully loaded for ffmpeg-assisted flows.
|
||||
- [ ] #4 Capture user-visible fallback reasons when preferred English/soft-sub sources are absent and hard-sub path is used.
|
||||
- [ ] #5 Add a debug/report view or log artifact with counters that can be reviewed in-app or via config/log files.
|
||||
- [ ] #6 Document metrics definitions so developers can tune source scorer and fallback policy without code changes.
|
||||
- [ ] #7 Ensure instrumentation has low overhead and is opt-out-safe with existing config flags.
|
||||
<!-- AC:END -->
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
id: TASK-30.9
|
||||
title: Expose subtitle preference and ffmpeg fallback tuning controls in settings UI
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 18:42'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-30.7
|
||||
- TASK-30.8
|
||||
parent_task_id: TASK-30
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Add user-configurable controls for Aniyomi streaming subtitle behavior, including preferred language profile, soft-vs-hard source preference, ffmpeg-assisted hard-sub removal behavior, and policy toggles so quality and fallback behavior can be tuned without code changes.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Add settings UI fields to define preferred subtitle/audiotrack language order (e.g., en, ja) and enable/disable hard-sub fallback mode.
|
||||
- [ ] #2 Add explicit toggle for enabling hard-sub stripping via ffmpeg and configurable timeout/quality limits to avoid long waits.
|
||||
- [ ] #3 Expose source ranking preferences for soft-sub vs hard-sub sources and optional fallback to native/transcoded source when preferred modes are unavailable.
|
||||
- [ ] #4 Persist settings in existing config schema with migration-safe defaults and include clear validation for invalid/unsupported values.
|
||||
- [ ] #5 Show current effective policy in streaming UI (for debugging): source selected + reason + whether subtitles are soft/hard and if ffmpeg path is active.
|
||||
- [ ] #6 Add user-facing explanatory text and warnings for ffmpeg dependency, expected CPU/cpu cost, and compatibility limits.
|
||||
- [ ] #7 Log and display when user-adjusted policy changes alter a previously preferred source choice during runtime.
|
||||
<!-- AC:END -->
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
id: TASK-34
|
||||
title: >-
|
||||
Add in-app episode browser (Ctrl+E) for local files and Jellyfin-ready
|
||||
metadata
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-13 22:12'
|
||||
updated_date: '2026-02-13 22:13'
|
||||
labels: []
|
||||
dependencies: []
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Implement an in-app episode browser invoked by Ctrl+E when mpv is open and connected to the Electron UI. The viewer should use the currently supplied directory (if app was launched with one) or fallback to the parent directory of the currently playing video. It should enumerate all available video files in target directory and sort them deterministically, then display them in a polished list/gallery with thumbnails in the Electron UI. Thumbnail behavior should prioritize existing matching images in the directory; otherwise generate thumbnails asynchronously in the background and update the modal as they become available. The same menu infrastructure should be shared with the planned Jellyfin integration and designed so it can display additional Jellyfin-sourced metadata without UI rewrites. It should also support launching/using an alternate picker mode compatible with external launcher UX patterns (e.g., via fzf/rofi), showing the same episode list/metadata in those contexts.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Pressing Ctrl+E in connected mode opens an episode viewer modal and closes/overlays correctly in the Electron app.
|
||||
- [ ] #2 Episode browser source directory is resolved from CLI-provided path when present, else from currently playing video's parent directory.
|
||||
- [ ] #3 Browser enumerates all supported video files in target directory and sorts them deterministically (e.g., natural/season-episode aware when possible).
|
||||
- [ ] #4 Episode list/gallery renders a consistent, usable layout with title, position/index, and thumbnail placeholders.
|
||||
- [ ] #5 If a thumbnail image file with matching name exists in the directory, it is used without background generation.
|
||||
- [ ] #6 For files without matching thumbnails, background thumbnail generation runs and updates entries as images become available in the modal.
|
||||
- [ ] #7 Thumbnail generation is cancellable/abortable and does not block UI interaction.
|
||||
- [ ] #8 The same episode viewer component/path can be reused by Jellyfin integration and can accept extended metadata payloads (e.g., show title, season/episode, runtime, description).
|
||||
- [ ] #9 `fzf`/`rofi`-compatible episode picker mode is available so the same episode set can be browsed outside the Electron modal using either backend output format.
|
||||
- [ ] #10 Episode item ordering, labels, and metadata shown in fzf/rofi mode match the in-app sorting and identity scheme.
|
||||
- [ ] #11 Both picker modes (Electron modal and fzf/rofi) resolve source directory using the same CLI/parent-of-current-video precedence rules.
|
||||
- [ ] #12 When invoked through fzf/rofi, the selected episode can be played and returns focus/flow safely to the Electron-mpv workflow.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 Feature supports Ctrl+E invocation from connected mpv session.
|
||||
- [ ] #2 Directory fallback behavior is implemented and validated with both passed-in and default paths.
|
||||
- [ ] #3 Video listing excludes unsupported formats and is correctly sorted.
|
||||
- [ ] #4 Existing local thumbnail matching works for common image/video naming patterns.
|
||||
- [ ] #5 Background thumbnail generation works asynchronously and updates UI in-place.
|
||||
- [ ] #6 UI is ready for Jellyfin metadata fields and does not require structural rewrite for server-provided data.
|
||||
- [ ] #7 No regressions in existing mpv-Electron controls for standard playback.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
id: TASK-43
|
||||
title: Add community subtitle timing database for shared sync corrections
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-14 02:13'
|
||||
labels:
|
||||
- feature
|
||||
- community
|
||||
- subtitles
|
||||
- sync
|
||||
dependencies: []
|
||||
priority: low
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Allow users to share their subtitle timing corrections to a community database, so other users watching the same video file get pre-synced subtitles automatically.
|
||||
|
||||
## Motivation
|
||||
|
||||
Subtitle synchronization (alass/ffsubsync) is one of the most friction-heavy steps in the mining workflow. Users spend time syncing subtitles that someone else has already synced for the exact same video. A shared database of timing corrections keyed by video file hash would eliminate redundant work.
|
||||
|
||||
## Design
|
||||
|
||||
1. **Video identification**: Use a partial file hash (first + last N bytes, or a media fingerprint) to identify video files without uploading content
|
||||
2. **Timing data**: Store the timing offset/warp parameters produced by alass/ffsubsync, not the full subtitle file
|
||||
3. **Upload flow**: After a successful sync, offer to share the timing correction (opt-in)
|
||||
4. **Download flow**: Before syncing, check the community database for existing corrections for the current video hash
|
||||
5. **Trust model**: Simple upvote/downvote on corrections; show number of users who confirmed a correction works
|
||||
|
||||
## Technical considerations
|
||||
|
||||
- Backend could be a simple REST API with a lightweight database (or even a GitHub-hosted JSON/SQLite file for v1)
|
||||
- Privacy: only file hashes and timing parameters are shared, never video content or personal data
|
||||
- Subtitle source (jimaku entry ID) can serve as an additional matching key
|
||||
- Rate limiting and abuse prevention needed for public API
|
||||
- Could integrate with existing jimaku modal flow
|
||||
|
||||
## Phasing
|
||||
|
||||
- v1: Local export/import of timing corrections (share as files)
|
||||
- v2: Optional cloud sync with community database
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Video files are identified by content hash without uploading video data.
|
||||
- [ ] #2 Timing corrections (offset/warp parameters) can be exported and shared.
|
||||
- [ ] #3 Before syncing, the app checks for existing community corrections for the current video.
|
||||
- [ ] #4 Upload of timing data is opt-in with clear privacy disclosure.
|
||||
- [ ] #5 Downloaded corrections are applied automatically or with one-click confirmation.
|
||||
- [ ] #6 Trust signal (confirmation count) is shown for community corrections.
|
||||
<!-- AC:END -->
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
id: TASK-48
|
||||
title: Add streaming mode integration in subminer using ani-cli stream source
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-14 06:01'
|
||||
updated_date: '2026-02-14 08:19'
|
||||
labels:
|
||||
- stream
|
||||
- ani-cli
|
||||
- jimaku
|
||||
dependencies: []
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Implement a new streaming mode so SubMiner can resolve and play episodes via ani-cli stream sources instead of existing file/download flow. The mode is enabled with a CLI flag (`-s` / `--stream`) and, when active, should prefer streamed playback and subtitle handling that keeps Japanese (or configured primary) subtitles as the main track. If a stream lacks Japanese subtitle tracks, fetch and inject subtitles from Jimaku and set them as primary subtitles according to SubMiner config.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Add a command-line option `-s`/`--stream` that enables streaming mode and is documented in help/config UX.
|
||||
- [ ] #2 When streaming mode is enabled, resolve episode/video URLs using existing ani-cli stream selection logic (ported into SubMiner) and route playback to the resolved stream source.
|
||||
- [ ] #3 If stream metadata contains a Japanese subtitle track, preserve that track as the primary subtitle stream path per current primary-subtitle selection behavior.
|
||||
- [ ] #4 If no Japanese subtitle track is present in the stream metadata, fetch matching subtitles from Jimaku and load them into playback.
|
||||
- [ ] #5 When loading Jimaku subtitles, replace/overwrite existing non-Japanese primary subtitle track behavior so the language configured as primary in SubMiner config is used instead.
|
||||
- [ ] #6 Non-streaming mode continues to follow current behavior when `-s`/`--stream` is not set.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Superseded by TASK-51. Streaming via ani-cli in subminer was removed due Cloudflare 403/unreliable source metadata; re-evaluate later if reintroduced behind a feature flag and redesigned resolver/metadata pipeline.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 CLI accepts both `-s` and `--stream` and enables streaming-specific behavior.
|
||||
- [ ] #2 Streaming mode resolves streams through migrated ani-cli logic.
|
||||
- [ ] #3 Japanese subs are preferred from stream metadata when available; Jimaku fallback is used only when absent.
|
||||
- [ ] #4 Primary subtitle language in config determines which language is treated as default stream subtitle track after fallback.
|
||||
- [ ] #5 Behavior is verified via test or manual checklist and documented in task notes.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
id: TASK-48.1
|
||||
title: Add streaming CLI flag plumbing and option wiring
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-14 06:03'
|
||||
updated_date: '2026-02-14 08:19'
|
||||
labels:
|
||||
- stream
|
||||
- cli
|
||||
dependencies: []
|
||||
parent_task_id: TASK-48
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Add the `-s`/`--stream` option end-to-end in SubMiner CLI and configuration handling, including defaults, help text, parsing/validation, and explicit routing so streaming mode is only enabled when requested.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Introduce `-s` short option and `--stream` long option in CLI parsing without breaking existing flags.
|
||||
- [ ] #2 When set, the resulting config state reflects streaming mode enabled and is propagated to playback/session startup.
|
||||
- [ ] #3 When unset, behavior remains identical to current non-streaming flows.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Superseded by TASK-51. CLI stream mode work deferred until streaming architecture is revisited.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
id: TASK-48.2
|
||||
title: Port ani-cli stream-resolution logic into SubMiner
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-14 06:03'
|
||||
updated_date: '2026-02-14 08:19'
|
||||
labels:
|
||||
- stream
|
||||
- ani-cli
|
||||
dependencies: []
|
||||
parent_task_id: TASK-48
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Implement stream URL resolution by porting ani-cli logic for selecting providers/episodes and obtaining playable stream URLs so SubMiner can consume stream sources directly.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Encapsulate stream search/provider selection logic in a dedicated module in SubMiner.
|
||||
- [ ] #2 Resolve episode query input into a canonical playable stream URL in streaming mode.
|
||||
- [ ] #3 Preserve existing behavior for non-streaming flow and expose errors when stream resolution fails.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Superseded by TASK-51. Stream URL resolution via ani-cli postponed; previous attempt exposed anti-bot/403 fragility and poor title-source reliability.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
id: TASK-48.3
|
||||
title: Implement stream subtitle selection and primary-language precedence
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-14 06:03'
|
||||
updated_date: '2026-02-14 08:19'
|
||||
labels:
|
||||
- stream
|
||||
- subtitles
|
||||
dependencies: []
|
||||
parent_task_id: TASK-48
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Handle subtitle track selection for stream playback so Japanese (or configured primary language) subtitle behavior is correctly applied when stream metadata includes or omits JP tracks.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Use stream metadata to choose and mark the configured primary language subtitle as active when available.
|
||||
- [ ] #2 If no matching primary language track exists in stream metadata, keep previous fallback behavior only for non-streaming mode.
|
||||
- [ ] #3 When no Japanese track exists and config primary is different, explicitly set configured primary as primary track for streaming flow.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Superseded by TASK-51. Stream subtitle language precedence in streaming mode deferred with full design revisit.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
id: TASK-48.4
|
||||
title: Add Jimaku subtitle fallback for stream mode
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-14 06:03'
|
||||
updated_date: '2026-02-14 08:19'
|
||||
labels:
|
||||
- stream
|
||||
- jimaku
|
||||
- subtitles
|
||||
dependencies: []
|
||||
parent_task_id: TASK-48
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
When a resolved stream lacks JP/primary-language tracks, fetch subtitles from Jimaku and inject them for playback, overriding non-primary subtitle defaults in streaming mode according to config.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Detect missing primary subtitle from stream metadata and trigger Jimaku lookup for matching episode.
|
||||
- [ ] #2 Load fetched Jimaku subtitles into playback pipeline and mark them as the primary subtitle track.
|
||||
- [ ] #3 Fallback is only used in streaming mode and should not alter subtitle behavior outside streaming.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Superseded by TASK-51. Jimaku fallback for streams deferred along with entire streaming flow.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
id: TASK-48.5
|
||||
title: Add verification plan/tests for streaming mode behavior
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-14 06:03'
|
||||
updated_date: '2026-02-14 08:19'
|
||||
labels:
|
||||
- stream
|
||||
- qa
|
||||
dependencies: []
|
||||
parent_task_id: TASK-48
|
||||
priority: low
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Create a validation plan or tests for CLI flag behavior, stream resolution, and subtitle precedence/fallback rules so streaming mode changes are measurable and regressions are caught.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Document/manual checklist covers `-s` and `--stream` invocation and streaming-only behavior.
|
||||
- [ ] #2 Include cases for (a) stream with JP subtitles, (b) no JP subtitles with Jimaku fallback, (c) primary-language not Japanese.
|
||||
- [ ] #3 Run or provide reproducible checks to confirm non-streaming behavior unchanged.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Superseded by TASK-51. Verification plan moved to deferred reimplementation context.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
id: TASK-48.6
|
||||
title: Wire -s/--stream mode to Ani-cli and Jimaku subtitle fallback
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-14 06:06'
|
||||
updated_date: '2026-02-14 08:19'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- ani-cli/ani-cli
|
||||
- src/jimaku/utils.ts
|
||||
- src/core/services/anki-jimaku-service.ts
|
||||
documentation:
|
||||
- ani-cli/README.md
|
||||
- subminer
|
||||
- src/cli/help.ts
|
||||
parent_task_id: TASK-48
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Implement SubMiner streaming mode end-to-end behind a `-s`/`--stream` flag. In stream mode, use the vendored ani-cli resolution flow to get playable stream URLs instead of local file/YouTube URL handling. If resolved streams do not expose Japanese subtitles, fetch matching subtitles from Jimaku and load them into mpv as the active primary subtitle track, overwriting the current non-primary/non-Japanese default according to subminer primary-subtitle configuration.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 When `subminer -s` is used, resolution should pass a search/query through ani-cli stream logic and play the resolved stream source.
|
||||
- [ ] #2 If the stream includes a Japanese subtitle track, preserve and select the configured primary subtitle language behavior without Jimaku injection.
|
||||
- [ ] #3 If no Japanese (or configured primary language) subtitle exists in stream metadata, fetch and inject Jimaku subtitles before playback starts.
|
||||
- [ ] #4 Loaded Jimaku subtitles should become the selected primary subtitle track, replacing any existing default non-primary subtitle in that context.
|
||||
- [ ] #5 When `-s` is not passed, non-streaming behavior remains unchanged.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Superseded by TASK-51. End-to-end stream wiring to ani-cli is deferred.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 CLI exposes both `-s` and `--stream` in help/config and validation.
|
||||
- [ ] #2 Implementation includes a clear fallback path when stream subtitles are absent and Jimaku search/download fails gracefully.
|
||||
- [ ] #3 Subtitles loading path avoids temp-file leaks; temporary media/subtitle artifacts are cleaned up on exit.
|
||||
- [ ] #4 At least one verification step (manual or test) confirms stream mode path works for an episode with and without Japanese stream subtitles.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
id: TASK-51
|
||||
title: Revisit Ani-cli stream mode integration later
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-02-14 08:19'
|
||||
labels:
|
||||
- someday
|
||||
- streaming
|
||||
- ani-cli
|
||||
- feature-flag
|
||||
dependencies: []
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Current codebase has removed ani-cli integration and stream-mode from subminer temporarily. Keep a deferred design task to reintroduce streaming mode in a future cycle.
|
||||
|
||||
Findings from prior attempts:
|
||||
|
||||
- `subminer -s <query>` path relied on `ani-cli` resolving stream URLs, but returned stream URLs that are Cloudflare-protected (`tools.fast4speed.rsvp`) and often returned 403 from mpv/ytdl-hook (generic anti-bot/Forbidden).
|
||||
- Even after passing `ytdl` extractor args, stream playback via subminer still failed because URL/anti-bot handling differed from direct ani-cli execution context.
|
||||
- We also observed stream title resolution issues: selected titles from ani-cli menu were unreliable/random and broke downstream Jimaku matching behavior.
|
||||
- ffsubsync failures were difficult to debug initially due to OSD-only error visibility; logging was added to mpv log path.
|
||||
- Based on these findings and instability, stream mode should be explicitly deferred rather than partially reintroduced.
|
||||
|
||||
Proposal:
|
||||
|
||||
- Reintroduce behind a feature flag / future milestone only.
|
||||
- Re-design around a dedicated stream source resolver with robust URL acquisition and source metadata preservation (query/episode/title) before subtitle sync flows.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
id: TASK-87.7
|
||||
title: >-
|
||||
Developer workflow hygiene: make docs watch reproducible and remove stale
|
||||
small-surface drift
|
||||
status: To Do
|
||||
assignee: []
|
||||
created_date: '2026-03-06 03:20'
|
||||
updated_date: '2026-03-06 03:21'
|
||||
labels:
|
||||
- tooling
|
||||
- tech-debt
|
||||
milestone: m-0
|
||||
dependencies: []
|
||||
references:
|
||||
- package.json
|
||||
- bun.lock
|
||||
- src/anki-integration/field-grouping-workflow.ts
|
||||
documentation:
|
||||
- docs/reports/2026-02-22-task-100-dead-code-report.md
|
||||
parent_task_id: TASK-87
|
||||
priority: low
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
The review found a few low-risk but recurring hygiene issues: docs:watch depends on bunx concurrently even though concurrently is not declared in package metadata, and small stale API surface remains after recent refactors, such as unused parameters in field-grouping workflow code. This task should make the developer workflow reproducible and clean up low-risk stale symbols that do not warrant a dedicated architecture task.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 The docs:watch workflow runs through declared project tooling or is rewritten to avoid undeclared dependencies.
|
||||
- [ ] #2 Small stale symbols or parameters identified during the review outside the main composition-root cleanup are removed without behavior changes.
|
||||
- [ ] #3 Any contributor-facing command changes are reflected in repository documentation.
|
||||
- [ ] #4 The cleanup remains scoped to low-risk workflow and hygiene fixes rather than expanding into large architectural refactors.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
|
||||
1. Fix the docs:watch workflow so it relies on declared project tooling or an equivalent checked-in command path.
|
||||
2. Clean up low-risk stale symbols surfaced by the review outside the main.ts architecture task, such as unused parameters left behind by refactors.
|
||||
3. Keep the task scoped: avoid pulling in main composition-root cleanup or larger Anki/runtime refactors.
|
||||
4. Verify the affected developer commands still work and document any usage changes.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
id: TASK-10
|
||||
title: Consolidate service naming conventions and barrel exports
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-11 08:21'
|
||||
updated_date: '2026-02-15 07:00'
|
||||
labels:
|
||||
- refactor
|
||||
- services
|
||||
- naming
|
||||
milestone: Codebase Clarity & Composability
|
||||
dependencies: []
|
||||
references:
|
||||
- src/core/services/index.ts
|
||||
priority: low
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
The service layer has inconsistent naming:
|
||||
|
||||
- Some functions end in `Service`: `handleCliCommandService`, `loadSubtitlePositionService`
|
||||
- Some end in `RuntimeService`: `replayCurrentSubtitleRuntimeService`, `sendMpvCommandRuntimeService`
|
||||
- Some are plain: `shortcutMatchesInputForLocalFallback`
|
||||
- Factory functions mix `create*DepsRuntimeService` with `create*Service`
|
||||
|
||||
The barrel export (src/core/services/index.ts) re-exports 79 symbols from 28 files through a single surface, which obscures dependency boundaries. Consumers import everything from `./core/services` and can't tell which service file they actually depend on.
|
||||
|
||||
Establish consistent naming:
|
||||
|
||||
- Exported service functions: `verbNounService` (e.g., `handleCliCommand`)
|
||||
- Deps factory functions: `create*Deps`
|
||||
- Consider whether the barrel re-export is still the right pattern vs direct imports from individual files.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 All service functions follow a consistent naming convention
|
||||
- [ ] #2 Decision documented on barrel export vs direct imports
|
||||
- [ ] #3 No functional changes
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Naming convention consolidation should be addressed as part of TASK-27.2 (split main.ts) and TASK-27.3 (anki-integration split). As modules are extracted and given clear boundaries, naming will be standardized at each boundary. No need to do a standalone naming pass — it's wasted effort if the module structure is about to change.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Subsumed by TASK-27.2 and TASK-27.3. Naming conventions were standardized at module boundaries during extraction. A standalone global naming pass would be churn with no structural benefit now that modules have clear ownership boundaries.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
id: TASK-11
|
||||
title: Break up the applyInvisibleSubtitleLayoutFromMpvMetrics mega function
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-11 08:21'
|
||||
updated_date: '2026-02-16 01:34'
|
||||
labels:
|
||||
- refactor
|
||||
- renderer
|
||||
- complexity
|
||||
milestone: Codebase Clarity & Composability
|
||||
dependencies:
|
||||
- TASK-27.5
|
||||
references:
|
||||
- src/renderer/renderer.ts
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
In renderer.ts (around lines 865-1075), `applyInvisibleSubtitleLayoutFromMpvMetrics` is a 211-line function with up to 5 levels of nesting. It handles OSD scaling calculations, platform-specific font compensation (macOS vs Linux), DPR calculations, ASS alignment tag interpretation (\an tags), baseline compensation, line-height fixes, font property application, and transform origin — all interleaved.
|
||||
|
||||
Extract into focused helpers:
|
||||
|
||||
- `calculateOsdScale(metrics, renderAreaHeight)` — pure scaling math
|
||||
- `calculateSubtitlePosition(metrics, scale, alignment)` — ASS \an tag interpretation + positioning
|
||||
- `applyPlatformFontCompensation(style, platform)` — macOS kerning/size adjustments
|
||||
- `applySubtitleStyle(element, computedStyle)` — DOM style application
|
||||
|
||||
This can be done independently of or as part of TASK-6 (renderer split).
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 No single function exceeds ~50 lines in the positioning logic
|
||||
- [x] #2 Helper functions are pure where possible (take inputs, return outputs)
|
||||
- [x] #3 Platform-specific branches isolated into dedicated helpers
|
||||
- [x] #4 Invisible overlay positioning still works correctly on Linux and macOS
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Helpers were split so positioning math, base layout, and typography/vertical handling are no longer in one monolith; see `src/renderer/positioning/invisible-layout.ts` and peer files.
|
||||
|
||||
Applied as part of TASK-27.5 with helper extraction: moved mpv subtitle layout orchestration to `invisible-layout.ts` and extracted metric/base/style helpers into `invisible-layout-metrics.ts` and `invisible-layout-helpers.ts`.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Decomposition of `applyInvisibleSubtitleLayoutFromMpvMetrics` completed as part of TASK-27.5: function body split into metric/layout/typography helpers and small coordinator preserved. Manual validation completed by user; behavior remains stable.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,65 @@
|
||||
---
|
||||
id: TASK-12
|
||||
title: Add renderer module bundling for multi-file renderer support
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-11 08:21'
|
||||
updated_date: '2026-02-16 02:14'
|
||||
labels:
|
||||
- infrastructure
|
||||
- renderer
|
||||
- build
|
||||
milestone: Codebase Clarity & Composability
|
||||
dependencies:
|
||||
- TASK-5
|
||||
references:
|
||||
- src/renderer/renderer.ts
|
||||
- src/renderer/index.html
|
||||
- package.json
|
||||
- tsconfig.json
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Currently renderer.ts is a single file loaded directly by Electron's renderer process via a script tag in index.html. To split it into modules (TASK-6), we need a bundling step since Electron renderer's default context doesn't support bare ES module imports without additional configuration.
|
||||
|
||||
Options:
|
||||
|
||||
1. **esbuild** — fast, minimal config, already used in many Electron projects
|
||||
2. **Electron's native ESM support** — requires `"type": "module"` and sandbox configuration
|
||||
3. **TypeScript compiler output** — if targeting a single concatenated bundle
|
||||
|
||||
The build pipeline already compiles TypeScript and copies renderer assets. Adding a bundling step for the renderer would slot into the existing `npm run build` script.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Renderer code can be split across multiple .ts files with imports
|
||||
- [x] #2 Build pipeline bundles renderer modules into a single output for Electron
|
||||
- [x] #3 Existing `make build` still works end-to-end
|
||||
- [x] #4 No runtime errors in renderer process
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Updated root npm build pipeline to use an explicit renderer bundle step via esbuild. Added `build:renderer` script to emit a single `dist/renderer/renderer.js` from `src/renderer/renderer.ts`; `build` now runs `pnpm run build:renderer` and preserves existing index/style copy and macOS helper step. Added `esbuild` to devDependencies.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Implemented renderer bundling step and wired `build` to use it. This adds `pnpm run build:renderer` which bundles `src/renderer/renderer.ts` into a single `dist/renderer/renderer.js` for Electron to load. Also added `esbuild` as a dev dependency and aligned `pnpm-lock.yaml` importer metadata for dependency consistency. Kept `index.html`/`style.css` copy path unchanged, so renderer asset layout remains stable.
|
||||
|
||||
Implemented additional test-layer type fix after build breakage by correcting `makeDepsFromMecabTokenizer` and related `tokenizeWithMecab` mocks to match expected `Token` vs `MergedToken` shapes, keeping runtime behavior unchanged while satisfying TS checks.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
id: TASK-20.1
|
||||
title: Refactor overlay runtime to use per-layer window bounds ownership
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-12 08:47'
|
||||
updated_date: '2026-02-13 08:04'
|
||||
labels: []
|
||||
dependencies: []
|
||||
parent_task_id: TASK-20
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Refactor overlay runtime so each overlay layer owns and applies its bounds independently. Keep tracker geometry as shared origin input only.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 `updateOverlayBoundsService` no longer applies the same bounds to every overlay window by default.
|
||||
- [x] #2 Main runtime/manager exposes per-layer bounds update paths for visible and invisible overlays.
|
||||
- [x] #3 Window tracker updates feed shared origin data; each layer applies its own computed bounds.
|
||||
- [x] #4 Single-layer behavior (visible-only or invisible-only) remains unchanged from user perspective.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Started implementation for per-layer overlay bounds ownership refactor.
|
||||
|
||||
Implemented per-layer bounds ownership path: visible and invisible layers now update bounds independently through overlay manager/runtime plumbing, while preserving existing geometry source behavior.
|
||||
|
||||
Replaced shared all-window bounds application with per-window bound application service and layer-specific runtime calls from visibility/tracker flows.
|
||||
|
||||
Archiving requested by user.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Refactored overlay bounds ownership to per-layer update paths. Tracker geometry remains shared input, but visible/invisible windows apply bounds independently via explicit layer routes. Existing single-layer UX behavior is preserved.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
id: TASK-27
|
||||
title: >-
|
||||
Refactor project structure to reduce architectural complexity and split
|
||||
oversized modules
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-13 17:13'
|
||||
updated_date: '2026-02-16 01:34'
|
||||
labels:
|
||||
- 'owner:architect'
|
||||
- 'owner:backend'
|
||||
- 'owner:frontend'
|
||||
dependencies: []
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Create a phased backlog-backed restructuring plan that keeps current service-oriented architecture while reducing cognitive load from oversized modules and tightening module ownership boundaries.
|
||||
|
||||
This initiative should make future feature work easier by splitting high-complexity files, reducing tightly-coupled orchestration, and introducing measurable structural guardrails.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 A phased decomposition plan is defined in task links and references the following target files: src/main.ts, src/anki-integration.ts, src/core/services/mpv-service.ts, src/renderer/_, src/config/_, and src/core/services/\*.
|
||||
- [ ] #2 Tasks are assigned with clear owners and include explicit dependencies so execution can proceed in parallel where safe.
|
||||
- [ ] #3 Changes are constrained to structural refactors first (no behavior changes until foundational splits are in place).
|
||||
- [ ] #4 Each subtask includes test/verification expectations (manual or automated) and a rollback-safe checkpoint.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
|
||||
## Revised Execution Sequence
|
||||
|
||||
### Phase 0 — Prerequisites (outside TASK-27 tree)
|
||||
|
||||
- **TASK-7** — Extract main.ts global state into AppState container (required before TASK-27.2)
|
||||
- **TASK-9** — Remove trivial wrapper functions from main.ts (depends on TASK-7; recommended before TASK-27.2 but not blocking)
|
||||
|
||||
### Phase 1 — Lightweight Inventory
|
||||
|
||||
- **TASK-27.1** — Inventory files >400 LOC, document contracts, define smoke test checklist
|
||||
|
||||
### Phase 2 — Sequential Split Wave
|
||||
|
||||
Order matters to avoid merge conflicts:
|
||||
|
||||
1. **TASK-27.3** — anki-integration.ts split (self-contained, doesn't affect main.ts wiring until facade is stable)
|
||||
2. **TASK-27.2** — main.ts split (after TASK-7 provides AppState container and 27.3 stabilizes the Anki facade)
|
||||
3. **TASK-27.4** — mpv-service.ts split (absorbs TASK-8 scope; blocked until 27.1 is done)
|
||||
4. **TASK-27.5** — renderer positioning.ts split (downscoped; after 27.2 to avoid import-path conflicts)
|
||||
|
||||
### Phase 3 — Stabilization
|
||||
|
||||
- **TASK-27.7** — Finalization and validation cleanup
|
||||
|
||||
## Smoke Test Checklist (applies to all subtasks)
|
||||
|
||||
Every subtask must verify before merging:
|
||||
|
||||
- [ ] App starts and connects to MPV
|
||||
- [ ] Subtitle text appears in overlay
|
||||
- [ ] Card mining creates a note in Anki
|
||||
- [ ] Field grouping modal opens and resolves
|
||||
- [ ] Global shortcuts work (mine, toggle overlay, copy subtitle)
|
||||
- [ ] Secondary subtitle display works
|
||||
- [ ] TypeScript compiles with no new errors
|
||||
- [ ] All existing tests pass (`pnpm test:core && pnpm test:config`)
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
## Review Findings (2026-02-13)
|
||||
|
||||
### Key changes from original plan:
|
||||
|
||||
1. **Dropped parallel execution of Phase 2** — TASK-27.2 and 27.5 share import paths; 27.2 and 27.3 share main.ts wiring. Sequential order prevents merge conflicts.
|
||||
2. **Added TASK-7 as external prerequisite** — main.ts has 30+ module-level `let` declarations. Splitting files without a state container first just scatters mutable state.
|
||||
3. **TASK-8 absorbed into TASK-27.4** — TASK-8 (separate protocol from app logic) and TASK-27.4 (physical file split) overlap significantly. TASK-27.4 now covers both.
|
||||
4. **TASK-27.5 downscoped** — Renderer is already well-organized (241-line orchestrator, handlers/, modals/, utils/ directories). Only positioning.ts (513 LOC) needs splitting.
|
||||
5. **Simplified ownership model** — Removed multi-owner ceremony since this is effectively a solo project. Kept labels for categorical tracking only.
|
||||
6. **Added global smoke test checklist** — No end-to-end or renderer tests exist, so manual verification is the safety net for every subtask.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
TASK-27 completed: plan execution sequence completed through all major refactor subtasks. Done status now confirmed for 27.1 (ownership mapping), 27.2 (main.ts split), 27.3 (anki-integration service-domain extraction), 27.4 (mpv-service split), 27.5 (renderer positioning split), and 27.7 (final validation summary, build + tests). Remaining work is now outside TASK-27 scope.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
|
||||
## Definition of Done
|
||||
|
||||
<!-- DOD:BEGIN -->
|
||||
|
||||
- [ ] #1 Plan task links and ordering are recorded in backlog descriptions.
|
||||
- [ ] #2 At least 2 independent owners are assigned with explicit labels in subtasks.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
id: TASK-27.7
|
||||
title: >-
|
||||
Decompose anki-integration.ts core into domain modules (field-grouping,
|
||||
card-creation, polling)
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-15 07:00'
|
||||
updated_date: '2026-02-16 01:31'
|
||||
labels:
|
||||
- refactor
|
||||
- anki
|
||||
- architecture
|
||||
dependencies:
|
||||
- TASK-27.3
|
||||
references:
|
||||
- src/anki-integration.ts
|
||||
- src/anki-integration-duplicate.ts
|
||||
- src/anki-integration-ui-feedback.ts
|
||||
- src/anki-integration/ai.ts
|
||||
parent_task_id: TASK-27
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
TASK-27.3 extracted leaf clusters (duplicate-detection 102 LOC, ai-translation 158 LOC, ui-feedback 107 LOC) but the core class remains at 2935 LOC. The heavy decomposition from the original TASK-27.3 plan was never executed.
|
||||
|
||||
Remaining extractions from the original plan:
|
||||
|
||||
1. **field-grouping** (~900 LOC) — `triggerFieldGroupingForLastAddedCard`, `applyFieldGrouping`, `computeFieldGroupingMergedFields`, `buildFieldGroupingPreview`, `performFieldGroupingMerge`, `handleFieldGroupingAuto`, `handleFieldGroupingManual`, plus ~15 span/parse/normalize helpers
|
||||
2. **card-creation** (~350 LOC) — `createSentenceCard`, `setCardTypeFields`, `extractFields`, `processSentence`, field resolution helpers
|
||||
3. **polling/lifecycle** (~250 LOC) — `start`, `stop`, `poll`, `pollOnce`, `processNewCard`
|
||||
|
||||
Also consolidate the scattered extraction files into `src/anki-integration/`:
|
||||
|
||||
- `src/anki-integration-duplicate.ts` → `src/anki-integration/duplicate.ts`
|
||||
- `src/anki-integration-ui-feedback.ts` → `src/anki-integration/ui-feedback.ts`
|
||||
- `src/anki-integration/ai.ts` (already there)
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 anki-integration.ts reduced below 800 LOC (facade + private state wiring only)
|
||||
- [ ] #2 Field-grouping cluster (~900 LOC) extracted as its own module under src/anki-integration/
|
||||
- [ ] #3 Card-creation and polling/lifecycle extracted as separate modules
|
||||
- [ ] #4 All extracted modules consolidated under src/anki-integration/ directory
|
||||
- [ ] #5 Existing facade API preserved — external callers unchanged
|
||||
- [ ] #6 All existing tests pass; build compiles cleanly
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Implemented and stabilized the anki-integration refactor + transport/protocol fixes needed to keep 27.7 moving: fixed MPV protocol sub-end timing behavior, corrected split-buffer test fixtures, added injectable mpv transport socket factory to eliminate readonly Socket monkey-patching, and resolved TypeScript strictness issues in card-creation path (typed notesInfo cast, option signature/field guards/audio stream index). Updated related tests and build outputs accordingly. Validation results: `bun run build` passes and targeted suites pass: `src/core/services/mpv-protocol.test.ts`, `src/core/services/mpv-transport.test.ts`, `src/anki-integration.test.ts` (16/16).
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
id: TASK-55
|
||||
title: Normalize service naming conventions across core/services
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-16 04:47'
|
||||
updated_date: '2026-02-17 09:12'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/core/services/index.ts
|
||||
priority: low
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
The core/services directory has inconsistent naming patterns that create confusion:
|
||||
|
||||
- Some files use `*Service.ts` suffix (e.g., `mpv-service.ts`, `tokenizer-service.ts`)
|
||||
- Others use `*RuntimeService.ts` or just descriptive names (e.g., `overlay-visibility-service.ts` exports functions with 'Service' in name)
|
||||
- Some functions in files have 'Service' suffix, others don't
|
||||
|
||||
This inconsistency makes it hard to predict file/function names and creates cognitive overhead.
|
||||
|
||||
Standardize on:
|
||||
|
||||
- File names: `kebab-case.ts` without 'service' suffix (e.g., `mpv.ts`, `tokenizer.ts`)
|
||||
- Function names: descriptive verbs without 'Service' suffix (e.g., `createMpvClient()`, `tokenizeSubtitle()`)
|
||||
- Barrel exports: clean, predictable names
|
||||
|
||||
Files needing audit (47 services):
|
||||
|
||||
- All files in src/core/services/ need review
|
||||
|
||||
Note: This is a large-scale refactor that should be done carefully to avoid breaking changes.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Establish naming convention rules (document in code or docs)
|
||||
- [x] #2 Audit all service files for naming inconsistencies
|
||||
- [x] #3 Rename files to follow convention (kebab-case, no 'service' suffix)
|
||||
- [x] #4 Rename exported functions to remove 'Service' suffix where present
|
||||
- [x] #5 Update all imports across the entire codebase
|
||||
- [x] #6 Update barrel exports
|
||||
- [x] #7 Run full test suite
|
||||
- [x] #8 Update any documentation referencing old names
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Starting implementation. Planning and executing a mechanical refactor: file names and exported symbols with Service suffix in `src/core/services`, then cascading import updates across `src/`.
|
||||
|
||||
Implemented naming convention refactor across `src/core/services`: removed `-service` from service file names, renamed Service-suffixed exported symbols to non-Service names, and updated barrel exports in `src/core/services/index.ts`.
|
||||
|
||||
Updated call sites across `src/main/**`, `src/core/services/**` tests, `scripts/**`, `package.json` test paths, and docs references (`docs/development.md`, `docs/architecture.md`, `docs/structure-roadmap.md`).
|
||||
|
||||
Validation completed: `pnpm run build` and `pnpm run test:fast` both pass after refactor.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Normalized `src/core/services` naming by removing `-service` from module filenames, dropping `Service` suffixes from exported service functions, and updating `src/core/services/index.ts` barrel exports to the new names. Updated all import/call sites across `src/main/**`, service tests, scripts, and docs/package test paths to match the new module and symbol names. Verified no behavior regressions with `pnpm run build` and `pnpm run test:fast` (all passing).
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
id: TASK-56
|
||||
title: Extract remaining main.ts runtime functions to dedicated modules
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-16 04:47'
|
||||
updated_date: '2026-02-16 05:16'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/main.ts
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
main.ts is still 1481 lines after previous refactoring efforts. While significant progress has been made, there are still opportunities to extract runtime functions into dedicated modules to further reduce its size and improve maintainability.
|
||||
|
||||
Current opportunities:
|
||||
|
||||
1. **JLPT dictionary lookup functions** (lines 470-535) - initializeJlptDictionaryLookup, ensureJlptDictionaryLookup, getJlptDictionarySearchPaths
|
||||
2. **Media path utilities** (lines 552-590) - updateCurrentMediaPath, updateCurrentMediaTitle, resolveMediaPathForJimaku
|
||||
3. **Overlay visibility helpers** (lines 1273-1360) - updateVisibleOverlayVisibility, updateInvisibleOverlayVisibility, syncInvisibleOverlayMousePassthrough
|
||||
|
||||
These functions are largely self-contained and could be moved to:
|
||||
|
||||
- `src/main/jlpt-runtime.ts`
|
||||
- `src/main/media-runtime.ts`
|
||||
- `src/main/overlay-visibility-runtime.ts`
|
||||
|
||||
Goal: Reduce main.ts complexity by extracting focused runtime helpers into dedicated modules
|
||||
|
||||
Benefits:
|
||||
|
||||
- Faster navigation and comprehension of main.ts
|
||||
- Easier to test extracted modules independently
|
||||
- Clearer separation of concerns
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Extract JLPT dictionary lookup functions to dedicated module
|
||||
- [x] #2 Extract media path utilities to dedicated module
|
||||
- [x] #3 Extract overlay visibility helpers to dedicated module
|
||||
- [x] #4 Update main.ts imports to use new modules
|
||||
- [x] #5 Ensure all functionality remains intact
|
||||
- [x] #6 Run full test suite
|
||||
- [x] #7 Keep extracted code organized and easier to follow
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Refactor complete for targeted runtime extraction: JLPT lookup, media utilities, and overlay visibility helpers were moved into dedicated main-runtime modules and wired from main.ts. Existing behavior preserved and full typecheck + test suite passed.
|
||||
|
||||
Task intent updated to prioritize readability over strict line-count target.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
id: TASK-66
|
||||
title: Add AnkiConnect tagging for mined and updated cards
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-18 09:23'
|
||||
updated_date: '2026-02-18 09:24'
|
||||
labels:
|
||||
- anki
|
||||
- config
|
||||
- enhancement
|
||||
dependencies: []
|
||||
references:
|
||||
- src/anki-connect.ts
|
||||
- src/anki-integration.ts
|
||||
- src/anki-integration/card-creation.ts
|
||||
- src/config/definitions.ts
|
||||
- src/config/service.ts
|
||||
- src/config/config.test.ts
|
||||
- docs/configuration.md
|
||||
- config.example.jsonc
|
||||
- docs/public/config.example.jsonc
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Support configuring tags applied to cards created or updated through SubMiner's AnkiConnect workflow. Default behavior should add the `SubMiner` tag to all mined/updated cards, while allowing users to override or disable automatic tagging via config.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 AnkiConnect note creation supports passing tags.
|
||||
- [x] #2 Existing-card update flows add configured tags via AnkiConnect after updates.
|
||||
- [x] #3 Default config includes `ankiConnect.tags: ["SubMiner"]`.
|
||||
- [x] #4 Config parsing validates `ankiConnect.tags` and falls back safely on invalid values.
|
||||
- [x] #5 User-facing docs/config examples mention the new tags option and default behavior.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Implemented configurable AnkiConnect tagging across SubMiner card creation and update workflows. Added `ankiConnect.tags` config (default `['SubMiner']`), validation/fallback in config parsing, AnkiConnect client support for `addNote` tags + `addTags`, and integration hooks so created/updated/merged cards receive configured tags. Updated docs and regenerated config examples; config test suite passes.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
id: TASK-8
|
||||
title: >-
|
||||
Reduce MpvIpcClient deps interface and separate protocol from application
|
||||
logic
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-11 08:20'
|
||||
updated_date: '2026-02-15 07:00'
|
||||
labels:
|
||||
- refactor
|
||||
- mpv
|
||||
- architecture
|
||||
milestone: Codebase Clarity & Composability
|
||||
dependencies: []
|
||||
references:
|
||||
- src/core/services/mpv-service.ts
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
MpvIpcClient (761 lines) in src/core/services/mpv-service.ts has a 22-property `MpvIpcClientDeps` interface that reaches back into main.ts state for application-level concerns (overlay visibility, subtitle timing, media path updates, OSD display).
|
||||
|
||||
The class mixes two responsibilities:
|
||||
|
||||
1. **IPC Protocol**: Socket connection, JSON message framing, reconnection, property observation
|
||||
2. **Application Integration**: Subtitle text broadcasting, overlay visibility sync, timing tracking
|
||||
|
||||
Separating these would let the protocol layer be simpler and testable, while application-level reactions to mpv events could be handled by listeners/callbacks registered externally.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 MpvIpcClient deps interface reduced to protocol-level concerns only
|
||||
- [ ] #2 Application-level reactions (subtitle broadcast, overlay sync, timing) handled via event emitter or external listeners
|
||||
- [ ] #3 MpvIpcClient is testable without mocking 22 callbacks
|
||||
- [ ] #4 Existing behavior preserved
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Superseded by TASK-27.4 which absorbed this task's full scope (protocol/application separation, deps interface reduction from 22 properties to protocol-level concerns, event-based app reactions). All acceptance criteria met by TASK-27.4.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
id: TASK-9
|
||||
title: Remove trivial wrapper functions from main.ts
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-11 08:21'
|
||||
updated_date: '2026-02-15 07:00'
|
||||
labels:
|
||||
- refactor
|
||||
- main
|
||||
- simplicity
|
||||
milestone: Codebase Clarity & Composability
|
||||
dependencies:
|
||||
- TASK-7
|
||||
references:
|
||||
- src/main.ts
|
||||
priority: low
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
main.ts contains many trivial single-line wrapper functions that add indirection without value:
|
||||
|
||||
```typescript
|
||||
function getOverlayWindows(): BrowserWindow[] {
|
||||
return overlayManager.getOverlayWindows();
|
||||
}
|
||||
function updateOverlayBounds(geometry: WindowGeometry): void {
|
||||
updateOverlayBoundsService(geometry, () => getOverlayWindows());
|
||||
}
|
||||
function ensureOverlayWindowLevel(window: BrowserWindow): void {
|
||||
ensureOverlayWindowLevelService(window);
|
||||
}
|
||||
```
|
||||
|
||||
Similarly, config accessor wrappers like `getJimakuLanguagePreference()`, `getJimakuMaxEntryResults()`, `resolveJimakuApiKey()` are pure boilerplate.
|
||||
|
||||
After TASK-7 (AppState container), many of these can be eliminated by having services access the state container directly, or by using the service functions directly at call sites without local wrappers.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [ ] #1 Trivial pass-through wrappers eliminated (call service/manager directly)
|
||||
- [ ] #2 Config accessor wrappers replaced with direct calls or a config accessor helper
|
||||
- [ ] #3 main.ts line count reduced
|
||||
- [ ] #4 No functional changes
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Priority changed from medium to low: this work is largely subsumed by TASK-27.2 (split main.ts). When main.ts is decomposed into composition-root modules, trivial wrappers will naturally be eliminated or inlined. Recommend folding remaining wrapper cleanup into TASK-27.2 rather than tracking separately. Keep this ticket as a checklist reference but don't execute independently.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Subsumed by TASK-27.2 (main.ts split). Trivial wrappers were eliminated or inlined as composition-root modules were extracted. main.ts reduced from ~2000+ LOC to 1384 with state routed through appState container. Standalone wrapper removal pass no longer needed.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -2,7 +2,7 @@ project_name: "SubMiner"
|
||||
default_status: "To Do"
|
||||
statuses: ["To Do", "In Progress", "Done"]
|
||||
labels: []
|
||||
definition_of_done: []
|
||||
milestones: []
|
||||
date_format: yyyy-mm-dd
|
||||
max_column_width: 20
|
||||
default_editor: "nvim"
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
id: m-0
|
||||
title: 'Codebase Health Remediation'
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
Follow-up work from the March 6, 2026 codebase review: strengthen the runnable test gate, remove confirmed dead architecture, and continue decomposition of oversized runtime entrypoints.
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
id: m-0
|
||||
title: 'Release v0.1.0'
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
Milestone: Release v0.1.0
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
id: TASK-1
|
||||
title: Refactor runtime services per plan.md
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-18 04:11'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- plan.md
|
||||
ordinal: 2000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Execute the SubMiner refactoring initiative documented in plan.md to reduce thin abstractions, consolidate service boundaries, fix known quality issues, and increase test coverage while preserving current behavior.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Phase-based execution tasks are created and linked under this initiative.
|
||||
- [x] #2 Each phase task includes clear, testable outcomes aligned with plan.md.
|
||||
- [x] #3 Implementation proceeds with build/test verification checkpoints after each completed phase.
|
||||
- [x] #4 Main behavior remains stable for startup, overlay, IPC, CLI, and tokenizer flows throughout refactor.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Created initiative subtasks TASK-1.1 through TASK-1.6 with phase-aligned acceptance criteria and sequential dependencies.
|
||||
|
||||
Completed TASK-1.1 (Phase 1 thin-wrapper removal) with green build/core tests.
|
||||
|
||||
Completed TASK-1.2 (Phase 2 DI adapter consolidation) with successful build and core test verification checkpoint.
|
||||
|
||||
Completed TASK-1.5 (critical behavior tests) with expanded tokenizer/mpv/subsync/CLI coverage and green core test suite.
|
||||
|
||||
Completed TASK-1.6 with documented no-go decision for optional domain-directory reorganization (kept current structure; tests remain green).
|
||||
|
||||
TASK-1.4 remains the only open phase, blocked on interactive desktop smoke checks that cannot be fully validated in this headless environment.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Completed the plan.md refactor initiative across Phases 1-5 and optional Phase 6 decisioning: removed thin wrappers, consolidated DI adapters and related services, fixed targeted runtime correctness issues, expanded critical behavior test coverage, and kept build/core tests green throughout. Final runtime smoke checks (start/toggle/trigger-field-grouping/stop) passed in this headless environment, with known limitation that visual overlay rendering itself was not directly inspectable.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,60 @@
|
||||
---
|
||||
id: TASK-1.1
|
||||
title: 'Phase 1: Remove thin wrapper runtime services'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-18 04:11'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- plan.md
|
||||
- src/main.ts
|
||||
- src/core/services/index.ts
|
||||
parent_task_id: TASK-1
|
||||
ordinal: 12000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Inline trivial wrapper services into their call sites and delete redundant service/test files listed in Phase 1 of plan.md.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Wrapper logic from the Phase 1 file list is inlined at call sites without behavior changes.
|
||||
- [x] #2 Phase 1 wrapper service files and corresponding trivial tests are removed from the codebase.
|
||||
- [x] #3 `src/core/services/index.ts` exports are updated to remove deleted modules.
|
||||
- [x] #4 `pnpm run build && pnpm run test:core` passes after Phase 1 completion.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
|
||||
1. Locate all Phase 1 wrapper service call sites and classify direct-inline substitutions vs orchestration-flow inlines.
|
||||
2. Remove the lowest-risk wrappers first (`config-warning-runtime-service`, `app-logging-runtime-service`, `runtime-options-manager-runtime-service`, `overlay-modal-restore-service`, `overlay-send-service`) and update imports/exports.
|
||||
3. Continue with startup and shutdown wrappers (`startup-resource-runtime-service`, `config-generation-runtime-service`, `app-shutdown-runtime-service`, `shortcut-ui-deps-runtime-service`) by inlining behavior into `main.ts` or direct callers.
|
||||
4. Delete corresponding trivial test files for removed wrappers and clean `src/core/services/index.ts` exports.
|
||||
5. Run `pnpm run build && pnpm run test:core`; fix regressions and update task notes/acceptance criteria incrementally.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Inlined wrapper behaviors into direct call sites in `main.ts` and `overlay-bridge-runtime-service.ts` for config warning/app logging, runtime options manager construction, generate-config bootstrap path, startup resource initialization, app shutdown sequence, overlay modal restore handling, overlay send behavior, and overlay shortcut local fallback invocation.
|
||||
|
||||
Deleted 16 Phase 1 files (9 wrapper services + 7 wrapper tests) and removed corresponding barrel exports from `src/core/services/index.ts`.
|
||||
|
||||
Updated `package.json` `test:core` list to remove deleted test entries so the script tracks current sources accurately.
|
||||
|
||||
Verification: `pnpm run build && pnpm run test:core` passes after refactor.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
id: TASK-1.2
|
||||
title: 'Phase 2: Merge DI adapter runtime services into target services'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-18 04:11'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.1
|
||||
references:
|
||||
- plan.md
|
||||
- src/core/services/cli-command-service.ts
|
||||
- src/core/services/ipc-service.ts
|
||||
- src/core/services/tokenizer-service.ts
|
||||
- src/core/services/app-lifecycle-deps-runtime-service.ts
|
||||
parent_task_id: TASK-1
|
||||
ordinal: 10000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Absorb dependency adapter runtime services into core service modules and remove adapter files/tests while preserving runtime behavior.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 CLI, IPC, tokenizer, and app lifecycle adapter logic is merged into their target service modules.
|
||||
- [x] #2 Adapter service and adapter test files listed in Phase 2 are removed.
|
||||
- [x] #3 Callers pass dependency shapes expected by updated services without redundant mapping layers.
|
||||
- [x] #4 `pnpm run build && pnpm run test:core` passes after Phase 2 completion.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
|
||||
1. Audit `cli-command-deps-runtime-service.ts`, `ipc-deps-runtime-service.ts`, `tokenizer-deps-runtime-service.ts`, and `app-lifecycle-deps-runtime-service.ts` usage sites in `main.ts` and corresponding services.
|
||||
2. For each adapter, move null-guarding and shape-normalization logic into its target service (`cli-command-service.ts`, `ipc-service.ts`, `tokenizer-service.ts`, `app-lifecycle-service.ts`) and simplify caller dependency objects.
|
||||
3. Remove adapter service files/tests and update `src/core/services/index.ts` exports/import sites.
|
||||
4. Run `pnpm run build && pnpm run test:core` and fix any typing/regression issues from the interface consolidation.
|
||||
5. Update task notes with dependency-shape decisions to preserve handoff clarity.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Merged adapter-constructor logic into target services: `createCliCommandDepsRuntimeService` moved into `cli-command-service.ts`, `createIpcDepsRuntimeService` moved into `ipc-service.ts`, `createTokenizerDepsRuntimeService` moved into `tokenizer-service.ts`, and `createAppLifecycleDepsRuntimeService` moved into `app-lifecycle-service.ts`.
|
||||
|
||||
Deleted adapter service files and tests for cli-command deps, ipc deps, tokenizer deps, and app lifecycle deps.
|
||||
|
||||
Updated `src/core/services/index.ts` exports and `package.json` `test:core` entries to remove deleted adapter test modules.
|
||||
|
||||
Verification: `pnpm run build && pnpm run test:core` passes after consolidation.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,69 @@
|
||||
---
|
||||
id: TASK-1.3
|
||||
title: 'Phase 3: Consolidate related service modules'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-18 04:11'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.2
|
||||
references:
|
||||
- plan.md
|
||||
- src/core/services/overlay-visibility-service.ts
|
||||
- src/core/services/overlay-manager-service.ts
|
||||
- src/core/services/overlay-shortcut-service.ts
|
||||
- src/core/services/numeric-shortcut-session-service.ts
|
||||
- src/core/services/app-ready-runtime-service.ts
|
||||
parent_task_id: TASK-1
|
||||
ordinal: 6000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Merge split modules for overlay visibility, broadcast, shortcuts, numeric shortcuts, and startup orchestration into cohesive service files.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Overlay visibility/runtime split is consolidated into a single service module.
|
||||
- [x] #2 Overlay broadcast functions are merged with overlay manager responsibilities.
|
||||
- [x] #3 Shortcut and numeric shortcut runtime/lifecycle splits are consolidated as described in plan.md.
|
||||
- [x] #4 Startup bootstrap and app-ready runtime orchestration is consolidated into one startup module.
|
||||
- [x] #5 `pnpm run build && pnpm run test:core` passes after Phase 3 completion.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
|
||||
1. Merge `overlay-visibility-runtime-service.ts` exports into `overlay-visibility-service.ts` and update imports/exports.
|
||||
2. Merge overlay broadcast responsibilities from `overlay-broadcast-runtime-service.ts` into `overlay-manager-service.ts` while preserving current APIs used by `main.ts`.
|
||||
3. Consolidate shortcut modules by absorbing lifecycle utilities into `overlay-shortcut-service.ts` and fallback-runner logic into `overlay-shortcut-runtime-service.ts` (or successor handler module), then remove obsolete files.
|
||||
4. Merge numeric shortcut runtime/session split into a single `numeric-shortcut-service.ts` and update call sites/tests.
|
||||
5. Merge startup bootstrap + app-ready orchestration into a single startup module, update imports, remove obsolete files, and run `pnpm run build && pnpm run test:core`.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Merged overlay visibility runtime API into `overlay-visibility-service.ts` and removed `overlay-visibility-runtime-service.ts`.
|
||||
|
||||
Merged overlay broadcast behavior into `overlay-manager-service.ts` (including manager-level broadcasting) and removed `overlay-broadcast-runtime-service.ts` + test, with equivalent coverage moved into `overlay-manager-service.test.ts`.
|
||||
|
||||
Consolidated shortcut modules into `overlay-shortcut-service.ts` (lifecycle) and new `overlay-shortcut-handler.ts` (runtime handlers + local fallback), removing `overlay-shortcut-lifecycle-service.ts`, `overlay-shortcut-runtime-service.ts`, and `overlay-shortcut-fallback-runner.ts`.
|
||||
|
||||
Merged numeric shortcut runtime/session split into `numeric-shortcut-service.ts`; removed `numeric-shortcut-runtime-service.ts` and merged runtime test coverage into session tests.
|
||||
|
||||
Merged startup bootstrap + app-ready orchestration into `startup-service.ts`; removed `startup-bootstrap-runtime-service.ts` and `app-ready-runtime-service.ts` with tests updated to new module path.
|
||||
|
||||
Verification: `pnpm run build && pnpm run test:core` passes after consolidation.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,98 @@
|
||||
---
|
||||
id: TASK-1.4
|
||||
title: 'Phase 4: Fix runtime bugs and naming/code-quality issues'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-18 04:11'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.3
|
||||
references:
|
||||
- plan.md
|
||||
- src/main.ts
|
||||
- src/core/services/overlay-visibility-service.ts
|
||||
- src/core/services/tokenizer-deps-runtime-service.ts
|
||||
parent_task_id: TASK-1
|
||||
ordinal: 3000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Address identified correctness and code-quality issues from plan.md, including race conditions, unsafe typing, callback rejection handling, and runtime naming cleanup.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Debug `console.log`/`console.warn` usage in overlay visibility logic is removed or replaced with structured logging where needed.
|
||||
- [x] #2 Tokenizer type mismatch is fixed without unsafe `as never` casting.
|
||||
- [x] #3 Field grouping resolver handling is made concurrency-safe against overlapping requests.
|
||||
- [x] #4 Async callback wiring in CLI/IPC paths has explicit rejection handling.
|
||||
- [x] #5 Remaining `-runtime-service` naming cleanup is completed without logic regressions.
|
||||
- [x] #6 `pnpm run build && pnpm run test:core` passes and manual startup/overlay smoke checks succeed.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
|
||||
1. Remove or replace debug `console.log`/`console.warn` usage in `overlay-visibility-service.ts` while preserving useful operational logging semantics.
|
||||
2. Confirm and fix unsafe tokenizer casting paths (already partially addressed during Phase 2) and ensure no remaining `as never` escape hatches in tokenizer dependency flows.
|
||||
3. Make field grouping resolver handling in `main.ts` concurrency-safe by adding request sequencing and stale-resolution guards.
|
||||
4. Audit async callback wiring in CLI/IPC integrations and add explicit rejection handling where promises are fire-and-forget.
|
||||
5. Execute `pnpm run build && pnpm run test:core` and document manual smoke-test steps/outcomes.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Removed debug overlay-visibility `console.log`/`console.warn` statements from `overlay-visibility-service.ts`.
|
||||
|
||||
Eliminated unsafe tokenizer cast path during prior consolidation (`createTokenizerDepsRuntimeService` now uses typed `Token[]` and `mergeTokens(rawTokens)` without `as never`).
|
||||
|
||||
Added field-grouping overlap protection: `createFieldGroupingCallbackService` now cancels immediately when another resolver is active and only clears resolver state if the current resolver matches, preventing stale timeout/request cleanup from clobbering a newer resolver.
|
||||
|
||||
Added explicit rejection handling for async callback pathways: `shell.openExternal` now has `.catch(...)`; app lifecycle `whenReady` path now catches handler rejection; second-instance CLI dispatch is wrapped in try/catch logging.
|
||||
|
||||
Verification: `pnpm run build && pnpm run test:core` passes after these fixes.
|
||||
|
||||
Remaining in TASK-1.4: criterion #5 (`-runtime-service` naming cleanup batch) and criterion #6 manual smoke checks.
|
||||
|
||||
Completed `-runtime-service` naming cleanup for remaining modules by renaming files/tests and import paths, including: `overlay-bridge`, `field-grouping-overlay`, `mpv-control`, `runtime-options-ipc`, `mining`, `jimaku`, `anki-jimaku`, startup/app-ready test names, and subsync wrapper (`subsync-runner-service.ts`).
|
||||
|
||||
Resolved rename collision with existing `subsync-service.ts` by restoring original core subsync service from `HEAD` and moving runtime wrapper logic into `subsync-runner-service.ts`.
|
||||
|
||||
Verification after rename cleanup: `pnpm run build && pnpm run test:core` passes with updated test paths in `package.json`.
|
||||
|
||||
Manual smoke checks are still pending for criterion #6.
|
||||
|
||||
Smoke run attempt 1 (outside sandbox): `timeout 20s pnpm run start` started successfully, loaded config, initialized websocket/Mecab, and entered normal MPV reconnect loop when `/tmp/subminer-socket` was absent; no immediate startup crash after previous refactors.
|
||||
|
||||
Smoke run attempt 2 (outside sandbox): `timeout 20s pnpm exec electron . --start --auto-start-overlay` showed the same stable startup/reconnect behavior, but overlay activation could not be verified in this headless/non-interactive environment.
|
||||
|
||||
Manual GUI interactions (overlay render/toggle, mine card flow, field-grouping interaction) remain pending for a real desktop session with MPV running.
|
||||
|
||||
Automated interactive-smoke surrogate 1 (outside sandbox): started app, sent `--toggle`, then `--stop`; instance remained stable and cleanly stopped without crash.
|
||||
|
||||
Automated interactive-smoke surrogate 2 (outside sandbox): started app, sent `--trigger-field-grouping`, then `--stop`; command path executed without runtime crash and app shut down cleanly.
|
||||
|
||||
Observed expected reconnect behavior when MPV socket was absent (`ENOENT /tmp/subminer-socket`), with no regressions in startup/bootstrap flow.
|
||||
|
||||
Note: this environment is headless, so visual overlay rendering cannot be directly confirmed; command-path and process-lifecycle smoke checks passed.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Completed Phase 4 by removing debug logging noise, fixing unsafe typing and concurrency risks, adding async rejection handling, completing naming cleanup, and validating startup/command-path behavior through repeated build/test and live Electron smoke runs.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,82 @@
|
||||
---
|
||||
id: TASK-1.5
|
||||
title: 'Phase 5: Add critical behavior tests for untested services'
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-18 04:11'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.4
|
||||
references:
|
||||
- plan.md
|
||||
- src/core/services/mpv-runtime-service.ts
|
||||
- src/core/services/subsync-runtime-service.ts
|
||||
- src/core/services/tokenizer-service.ts
|
||||
- src/core/services/cli-command-service.ts
|
||||
parent_task_id: TASK-1
|
||||
ordinal: 5000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Add meaningful behavior tests for high-risk services called out in plan.md: mpv, subsync, tokenizer, and expanded CLI command coverage.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 `mpv` service has focused tests for protocol parsing, event dispatch, request/response matching, reconnection, and subtitle extraction behavior.
|
||||
- [x] #2 `subsync` service has focused tests for engine path resolution, command construction, timeout/error handling, and result parsing.
|
||||
- [x] #3 `tokenizer` service has focused tests for parser readiness, token extraction, fallback behavior, and edge-case inputs.
|
||||
- [x] #4 CLI command service tests cover all dispatch paths, async error propagation, and second-instance forwarding behavior.
|
||||
- [x] #5 `pnpm run test:core` passes with all new tests green.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
|
||||
1. Add focused tests for `tokenizer-service.ts` behavior (normalization, Yomitan-unavailable fallback, mecab fallback success/error paths, empty input handling).
|
||||
2. Add focused tests for `subsync-service.ts` command/engine selection and failure handling using mocked command utilities where feasible.
|
||||
3. Add focused tests for `mpv-service.ts` protocol handling (line parsing, request-response routing, property-change dispatch) with lightweight socket stubs.
|
||||
4. Expand `cli-command-service.ts` tests for dispatch/error/second-instance forwarding edge paths not currently covered.
|
||||
5. Run `pnpm run test:core` iteratively and update acceptance criteria as each service reaches meaningful coverage.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Added new tokenizer behavior tests in `src/core/services/tokenizer-service.test.ts` covering empty normalized input, newline normalization, mecab fallback success, and mecab error fallback-to-null.
|
||||
|
||||
Added new mpv protocol tests in `src/core/services/mpv-service.test.ts` covering JSON line-buffer parsing, property-change subtitle dispatch behavior, and request/response resolution by `request_id`.
|
||||
|
||||
Added new subsync workflow tests in `src/core/services/subsync-service.test.ts` covering already-running guard, manual-mode picker flow, and error propagation to OSD when MPV is unavailable.
|
||||
|
||||
Expanded `src/core/services/cli-command-service.test.ts` to cover socket/start dispatch, texthooker port override warning path, help-without-window shutdown, and async trigger-subsync error reporting.
|
||||
|
||||
Updated `package.json` `test:core` to include new/renamed test files; verification remains green with `pnpm run test:core` (17 tests total).
|
||||
|
||||
Expanded `mpv-service` tests with request rejection when disconnected, `requestProperty` error propagation, and pending-request disconnect resolution behavior.
|
||||
|
||||
Expanded `subsync-service` tests with manual alass source-track validation and auto-mode executable-path failure handling while ensuring in-progress state cleanup.
|
||||
|
||||
All updated tests remain green via `pnpm run test:core` after these additions.
|
||||
|
||||
Added Yomitan parser token-extraction coverage in `tokenizer-service.test.ts` (parser-available success path) in addition to fallback/edge-case tests.
|
||||
|
||||
Added MPV reconnection/request robustness tests (`scheduleReconnect`, disconnected request rejection, pending request disconnect resolution) to complement protocol/event/request-id tests in `mpv-service.test.ts`.
|
||||
|
||||
Added subsync command-construction tests using executable stubs for both engines (`ffsubsync` and `alass`) and validated success/failure result behavior; added timeout behavior coverage in `src/subsync/utils.test.ts` for child-process timeout handling used by subsync.
|
||||
|
||||
Expanded CLI dispatch tests with broad branch coverage for visibility/settings/copy/multi-copy/mining/open-runtime-options/stop/help/second-instance behaviors and async error propagation.
|
||||
|
||||
Verification: `pnpm run test:core` passes with 18 green tests including newly added `dist/subsync/utils.test.js`.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,53 @@
|
||||
---
|
||||
id: TASK-1.6
|
||||
title: 'Phase 6 (Optional): Reorganize services by domain directories'
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-10 18:46'
|
||||
updated_date: '2026-02-18 04:11'
|
||||
labels: []
|
||||
dependencies:
|
||||
- TASK-1.5
|
||||
references:
|
||||
- plan.md
|
||||
parent_task_id: TASK-1
|
||||
ordinal: 4000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
If service flattening remains hard to navigate after Phases 1-5, optionally move modules into domain-based folders and update imports.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 A clear go/no-go decision for domain restructuring is documented based on post-phase-5 codebase state.
|
||||
- [ ] #2 If executed, service modules are reorganized into domain folders with no import or runtime breakage.
|
||||
- [x] #3 Build and core test commands pass after any directory reorganization.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
|
||||
1. Assess post-phase-5 directory complexity and determine whether domain reorganization is still justified.
|
||||
2. If complexity remains acceptable, record a no-go decision and keep current structure stable.
|
||||
3. If complexity is still problematic, perform import-safe domain reorganization and re-run build/tests.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
|
||||
Decision: no-go on Phase 6 directory reorganization for now. After Phases 1-5, service/module consolidation and test expansion have improved maintainability without introducing a high-risk import churn.
|
||||
|
||||
Rationale: preserving path stability now reduces regression risk while Phase 4 smoke validation remains open and large refactor commits are still stabilizing.
|
||||
|
||||
Verification baseline remains green (`pnpm run test:core`) with current structure.
|
||||
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
id: TASK-100
|
||||
title: 'Add configurable texthooker startup launch'
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-03-06 23:30'
|
||||
updated_date: '2026-03-07 01:59'
|
||||
labels: []
|
||||
dependencies: []
|
||||
priority: medium
|
||||
ordinal: 10000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Add a config option under `texthooker` to launch the built-in texthooker server automatically when SubMiner starts.
|
||||
|
||||
Scope:
|
||||
|
||||
- Add `texthooker.launchAtStartup`.
|
||||
- Default to `true`.
|
||||
- Start the existing texthooker server during normal app startup when enabled.
|
||||
- Keep `texthooker.openBrowser` as separate behavior.
|
||||
- Add regression coverage and update generated config docs/example.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Default config enables automatic texthooker startup.
|
||||
- [x] #2 Config parser accepts valid boolean values and warns on invalid values.
|
||||
- [x] #3 App-ready startup launches texthooker when enabled.
|
||||
- [x] #4 Generated config template/example documents the new option.
|
||||
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Added `texthooker.launchAtStartup` with a default of `true`, wired it through config defaults/validation/template generation, and started the existing texthooker server during app-ready startup without coupling it to browser auto-open behavior.
|
||||
|
||||
Also added regression coverage for config parsing/template output and app-ready dependency wiring, then regenerated the checked-in config example artifacts.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
id: TASK-100
|
||||
title: Run post-refactor dead code prune and cleanup
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-21 07:15'
|
||||
updated_date: '2026-02-22 07:49'
|
||||
labels:
|
||||
- cleanup
|
||||
- maintainability
|
||||
- refactor
|
||||
dependencies:
|
||||
- TASK-96
|
||||
- TASK-97
|
||||
priority: medium
|
||||
ordinal: 70000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Major refactors likely left unused exports/helpers and stale compatibility code. Perform a deliberate dead-code sweep with regression safety.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Run unused-export scans (`ts-prune` or equivalent) and collect candidate list.
|
||||
2. Manually verify each candidate to avoid false positives from dynamic loading/IPC wiring.
|
||||
3. Remove or inline confirmed dead code; simplify import surfaces/barrels accordingly.
|
||||
4. Delete stale helper paths retained only for pre-composer wiring.
|
||||
5. Add or update regression tests where removal could alter behavior.
|
||||
6. Run verification gate: `bun run build`, `bun run test:config:dist`, `bun run test:core:dist`.
|
||||
7. Publish cleanup report: removed files/exports, kept exceptions, and rationale.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Confirmed dead code removed without behavior regressions.
|
||||
- [x] #2 Remaining flagged candidates either resolved or documented with justification.
|
||||
- [x] #3 Build and core/config suites pass after cleanup.
|
||||
- [x] #4 Import graph complexity reduced (fewer exports/entrypoints where applicable).
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Added dead-code execution report: `docs/reports/2026-02-22-task-100-dead-code-report.md` (baseline + triage + removals + remaining candidates).
|
||||
|
||||
Confirmed removals include unused imports/helpers in Anki/core/renderer paths plus reduced registry/barrel export surface in `src/tokenizers/index.ts`, `src/token-mergers/index.ts`, and `src/core/utils/index.ts`.
|
||||
|
||||
Verification gates: `bun run build` PASS; `bun run test:core:src` PASS (225 pass/6 skip); `bun run test:config:src` PASS (52 pass); `bun run check:file-budgets` PASS warning mode with no strict hotspot violations.
|
||||
|
||||
Static-analysis evidence: `tsc --noEmit --noUnusedLocals --noUnusedParameters` reduced to 39 remaining diagnostics concentrated in `src/main.ts` and intentional composer type-test aliases; broad `ts-prune` false positives documented in report.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Completed post-refactor dead-code cleanup with a documented triage report, removing confirmed unused imports/helpers/exports while preserving intentional contract/type seams. Verified no regressions via build + core/config source test suites and maintainability budget checks, with remaining candidate hotspots documented for a dedicated follow-up pass.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [x] #1 Dead-code report attached in task notes.
|
||||
- [x] #2 Regression test updates included for risky removals.
|
||||
- [x] #3 Verification gate commands complete successfully.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
id: TASK-101
|
||||
title: Consolidate architecture docs and archive task noise
|
||||
status: Done
|
||||
assignee:
|
||||
- codex-task101-docs-archive
|
||||
created_date: '2026-02-21 07:15'
|
||||
updated_date: '2026-02-22 07:49'
|
||||
labels:
|
||||
- documentation
|
||||
- maintainability
|
||||
dependencies:
|
||||
- TASK-96
|
||||
- TASK-97
|
||||
- TASK-98
|
||||
- TASK-99
|
||||
- TASK-100
|
||||
priority: low
|
||||
ordinal: 72000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Architecture guidance is fragmented across long-lived docs and task notes. Consolidate canonical runtime architecture docs and move stale/noisy task-level detail to archive.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Audit architecture and development docs for duplicated runtime composition guidance.
|
||||
2. Select one canonical architecture section for runtime composition and dependency boundaries.
|
||||
3. Refactor duplicate sections to brief pointers to the canonical section.
|
||||
4. Move stale task-evidence prose from persistent docs to backlog/archive where appropriate.
|
||||
5. Add a compact architecture diagram and update links in contributor docs.
|
||||
6. Validate docs build and link integrity.
|
||||
7. Record what moved and why in task notes for traceability.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Runtime composition guidance exists in one canonical location.
|
||||
- [x] #2 Duplicated/stale architecture notes removed from long-lived docs.
|
||||
- [x] #3 Task evidence retained in backlog/archive, not lost.
|
||||
- [x] #4 Docs build and links pass after consolidation.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1) Canonicalize runtime architecture guidance in `docs/architecture.md` and remove task-ID provenance wording so architecture guidance remains timeless.
|
||||
2) Trim duplicated runtime architecture bullets from `docs/development.md` Contributor Notes and point contributors to `/architecture` as canonical guidance.
|
||||
3) Convert `docs/structure-roadmap.md` from a full task-history roadmap into a short archival note that points to canonical architecture docs and states historical detail is retained in backlog task records.
|
||||
4) Record a changelog of moved/removed sections in TASK-101 notes/final summary to preserve evidence that was removed from long-lived docs.
|
||||
5) Run `bun run docs:build` and finalize AC/DoD checks in Backlog once docs build/link validation passes.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Plan captured in docs/plans/2026-02-22-task-101-architecture-doc-consolidation.md before edits.
|
||||
|
||||
Initial removal/move inventory: (a) TASK-tagged provenance bullets in docs/architecture.md Why This Design, (b) duplicated runtime-composer/domain-ownership bullets in docs/development.md Contributor Notes, (c) TASK-27 split-sequence/migration-risk body in docs/structure-roadmap.md.
|
||||
|
||||
Doc consolidation changelog (pass 1):
|
||||
- docs/architecture.md: removed task-ID provenance bullets from `Why This Design` and replaced with timeless architecture wording.
|
||||
- docs/development.md: removed duplicated runtime-composer/domain-registry/MPV-split architecture bullets from `Contributor Notes`; added single canonical pointer to `/architecture`.
|
||||
- docs/structure-roadmap.md: replaced full TASK-27 roadmap/migration-risk/split-sequence body with archival notice that redirects to canonical architecture docs and backlog historical records.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Consolidated runtime architecture guidance into canonical long-lived docs and removed task-history noise:
|
||||
- `docs/architecture.md`: removed task-ID provenance bullets from `Why This Design` and kept architecture rationale timeless.
|
||||
- `docs/development.md`: trimmed duplicated architecture implementation bullets in `Contributor Notes`; retained a direct canonical link to `/architecture`.
|
||||
- `docs/structure-roadmap.md`: replaced full TASK-27 roadmap body with archival notice pointing to canonical architecture guidance.
|
||||
|
||||
Task-noise evidence is preserved in Backlog records (TASK-101 implementation notes/final summary plus existing backlog archive/task history) rather than long-lived docs. Verification: `bun run docs:build` passed (VitePress build complete, no link errors).
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [x] #1 Change log of moved/removed doc sections included in task notes.
|
||||
- [x] #2 `bun run docs:build` passes.
|
||||
- [x] #3 Contributor-facing entry points link to canonical architecture section.
|
||||
<!-- DOD:END -->
|
||||
@@ -1,39 +0,0 @@
|
||||
---
|
||||
id: TASK-101
|
||||
title: Index AniList character alternative names in the character dictionary
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-03-07 00:00'
|
||||
updated_date: '2026-03-08 00:11'
|
||||
labels:
|
||||
- dictionary
|
||||
- anilist
|
||||
dependencies: []
|
||||
references:
|
||||
- src/main/character-dictionary-runtime.ts
|
||||
- src/main/character-dictionary-runtime.test.ts
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Index AniList character alternative names in generated character dictionaries so aliases like Shadow resolve during subtitle lookup instead of falling through to unrelated generic dictionary entries.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Character fetch reads AniList alternative character names needed for lookup coverage
|
||||
- [x] #2 Generated term banks include alias-derived terms for subtitle lookups like シャドウ
|
||||
- [x] #3 Regression coverage proves alternative-name indexing works end to end
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Character dictionary generation now requests AniList `name.alternative`, indexes those aliases as term candidates, and expands mixed aliases like `Minoru Kagenou (影野ミノル)` into usable outer/inner variants. Also extended kana alias synthesis so the AniList alias `Shadow` emits `シャドウ`, which matches the subtitle token the user hit in The Eminence in Shadow.
|
||||
|
||||
Bumped the character-dictionary snapshot format to invalidate stale cached snapshots, and updated merged-dictionary rebuilds to refresh invalid snapshots before composing the ZIP so old cache files do not hard-fail the merge path.
|
||||
|
||||
Verified with `bun test src/main/character-dictionary-runtime.test.ts` and `bun run tsc --noEmit`.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
id: TASK-102
|
||||
title: Quiet default AppImage startup and implicit background launch
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-03-06 21:20'
|
||||
updated_date: '2026-03-06 21:33'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/main-entry-runtime.ts
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/core/services/cli-command.ts
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/main.ts
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Make the packaged Linux no-arg launch path behave like a quiet background start instead of surfacing startup-only noise.
|
||||
|
||||
Scope:
|
||||
|
||||
- Treat default background entry launches as implicit `--start --background`.
|
||||
- Keep the `--password-store` diagnostic out of normal startup output.
|
||||
- Suppress known startup-only `node:sqlite` and `lsfg-vk` warnings for the entry/background launch path.
|
||||
- Avoid noisy protocol-registration warnings during normal startup when registration is unsupported.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Initial background launch reaches the start path without logging `No running instance. Use --start to launch the app.`
|
||||
- [x] #2 Default startup no longer emits the `Applied --password-store gnome-libsecret` line at normal log levels.
|
||||
- [x] #3 Entry/background launch sanitization suppresses the observed `ExperimentalWarning: SQLite...` and `lsfg-vk ... unsupported configuration version` startup noise.
|
||||
- [x] #4 Regression coverage documents the new startup behavior.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Normalized no-arg/password-store-only entry launches to append implicit `--start --background`, and upgraded `--background`-only entry launches to include `--start`.
|
||||
|
||||
Applied shared entry env sanitization before loading the main process so default startup strips the `lsfg-vk` Vulkan layer and sets `NODE_NO_WARNINGS=1`; background children keep the same sanitized env.
|
||||
|
||||
Downgraded startup-only protocol-registration failure logging to debug, and routed the Linux password-store diagnostic through the scoped debug logger instead of raw console output.
|
||||
|
||||
Verification:
|
||||
|
||||
- `bun test src/main-entry-runtime.test.ts src/main/runtime/anilist-setup-protocol.test.ts src/main/runtime/anilist-setup-protocol-main-deps.test.ts`
|
||||
- `bun run test:fast`
|
||||
|
||||
Note: the final `node --experimental-sqlite --test dist/main/runtime/registry.test.js` step in `bun run test:fast` still prints Node's own experimental SQLite warning because that test command explicitly enables the feature flag outside the app entrypoint.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Default packaged startup is now quiet and behaves like an implicit `--start --background` launch.
|
||||
|
||||
- No-arg AppImage entry launches now append `--start --background`, and `--background`-only launches append the missing `--start`.
|
||||
- Entry/background startup sanitization now suppresses the observed `lsfg-vk` and `node:sqlite` warnings on the app launch path.
|
||||
- Linux password-store and unsupported protocol-registration diagnostics now stay at debug level instead of normal startup output.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,56 @@
|
||||
---
|
||||
id: TASK-102
|
||||
title: Restore Jellyfin session migration contract and build green
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-22 07:12'
|
||||
updated_date: '2026-02-22 07:51'
|
||||
labels:
|
||||
- bug
|
||||
- jellyfin
|
||||
- maintainability
|
||||
dependencies:
|
||||
- TASK-93
|
||||
priority: high
|
||||
ordinal: 99000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
`bun run build` is currently failing after refactor/rebase drift in Jellyfin auth/session wiring.
|
||||
|
||||
Observed drift:
|
||||
- `src/config/definitions/defaults-integrations.ts` still includes `jellyfin.accessToken` and `jellyfin.userId`.
|
||||
- `src/config/resolve/integrations.ts` still parses those removed config keys.
|
||||
- `src/main.ts` still calls removed token-store methods (`loadToken/saveToken/clearToken`) instead of session-store methods.
|
||||
- setup/config patch flows still attempt to write removed Jellyfin auth fields to config.
|
||||
|
||||
This task restores the TASK-93 contract end-to-end: auth in env/stored session, no token/userId in editable config.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Remove stale `jellyfin.accessToken`/`jellyfin.userId` keys from defaults and config resolve parsing.
|
||||
2. Update `src/main.ts` Jellyfin deps wiring to use `loadStoredSession/saveStoredSession/clearStoredSession` with `createJellyfinTokenStore`.
|
||||
3. Update Jellyfin setup/auth flows so config patch writes only supported Jellyfin config keys.
|
||||
4. Update launcher-side Jellyfin config loader to stop reading removed auth keys from config file.
|
||||
5. Add/adjust regression tests around Jellyfin resolver precedence and setup/auth save+clear paths.
|
||||
6. Verify with `bun run build`, `bun run test:config:src`, and targeted Jellyfin runtime tests.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [ ] #1 `bun run build` passes on `main` after Jellyfin session contract fix.
|
||||
- [ ] #2 No production config defaults/resolvers parse `jellyfin.accessToken` or `jellyfin.userId`.
|
||||
- [ ] #3 Main/runtime Jellyfin auth wiring compiles against session-store API only.
|
||||
- [ ] #4 Jellyfin setup/login/logout paths are covered by source tests and pass.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [ ] #1 Compile + config test lanes pass without local patches.
|
||||
- [ ] #2 Runtime Jellyfin tests include session-store save/load/clear expectations.
|
||||
- [ ] #3 Docs/examples reflect session-store contract and no longer mention removed config auth keys.
|
||||
<!-- DOD:END -->
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
id: TASK-103
|
||||
title: Add dedicated annotation websocket for texthooker
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-03-07 02:20'
|
||||
updated_date: '2026-03-07 02:20'
|
||||
labels:
|
||||
- texthooker
|
||||
- websocket
|
||||
- subtitle
|
||||
dependencies: []
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Add a separate annotated subtitle websocket for bundled texthooker so token/JLPT/frequency markup is available on a stable dedicated port even when the regular websocket is in `auto` mode and skipped because `mpv_websocket` is installed.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Regular `websocket.enabled: "auto"` behavior remains unchanged and still skips the regular websocket when `mpv_websocket` is installed.
|
||||
- [x] #2 A separate `annotationWebsocket` config controls an independent annotated websocket with default port `6678`.
|
||||
- [x] #3 Bundled texthooker is pointed at the annotation websocket when it is enabled.
|
||||
- [x] #4 Focused regression tests cover config parsing, startup wiring, and texthooker bootstrap injection.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Added `annotationWebsocket.enabled`/`annotationWebsocket.port` with defaults of `true`/`6678`, started that websocket independently from the regular auto-managed websocket, and injected the bundled texthooker websocket URL so it connects to the annotation feed by default.
|
||||
|
||||
Also added focused regression coverage and regenerated the checked-in config examples.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,89 @@
|
||||
---
|
||||
id: TASK-103
|
||||
title: Extract Jellyfin runtime wiring from main.ts composition root
|
||||
status: Done
|
||||
assignee:
|
||||
- codex-task103-jellyfin-main-composer-20260222T220441Z-m8p1
|
||||
created_date: '2026-02-22 07:13'
|
||||
updated_date: '2026-02-23 02:06'
|
||||
labels:
|
||||
- refactor
|
||||
- maintainability
|
||||
- jellyfin
|
||||
dependencies:
|
||||
- TASK-102
|
||||
- TASK-94
|
||||
- TASK-97
|
||||
priority: medium
|
||||
ordinal: 100000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
`src/main.ts` remains oversized (3014 LOC) and still carries a dense Jellyfin wiring block (roughly `main.ts:1145-1565`) despite composition-root refactors.
|
||||
|
||||
Goal: finish extraction of Jellyfin-specific dependency construction and command/setup orchestration into dedicated runtime composer modules so `main.ts` remains thin and legible.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Extract Jellyfin config/client-info/auth/list/play/setup dependency builders from `src/main.ts` into focused files under `src/main/runtime/composers/`.
|
||||
2. Create one Jellyfin composition entrypoint that returns fully wired handlers used by `main.ts`.
|
||||
3. Remove duplicated inline adapter lambdas from `main.ts`; keep only high-level invocation points.
|
||||
4. Add/expand composer seam tests for extracted Jellyfin module boundaries.
|
||||
5. Re-run fan-in and compile checks to ensure extraction does not regress runtime wiring.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 `src/main.ts` no longer contains the full Jellyfin deps-building block.
|
||||
- [x] #2 New Jellyfin composer modules have focused tests covering handler wiring.
|
||||
- [x] #3 `bun run check:main-fanin` stays green after extraction.
|
||||
- [x] #4 `bun run build` and `bun run test:core:src` pass.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
Plan artifact: `docs/plans/2026-02-22-task-103-jellyfin-runtime-wiring.md`.
|
||||
|
||||
Execution plan:
|
||||
1) Add `composeJellyfinRuntimeHandlers` composer module + seam tests and composer barrel export.
|
||||
2) Replace inline Jellyfin deps-building block in `src/main.ts` with one composer invocation while preserving existing callsites (`runJellyfinCommand`, `openJellyfinSetupWindow`, remote session lifecycle, playback).
|
||||
3) Update architecture docs ownership bullets for Jellyfin composer boundary.
|
||||
4) Run required gates: `bun run check:main-fanin`, `bun run build`, `bun run test:core:src`.
|
||||
5) Record AC/DoD evidence and final summary in Backlog task (no commit).
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
2026-02-22T22:04:41Z: Execution started via Backlog MCP workflow. Loading task context, creating written plan artifact, then implementing extraction and focused validations without commit.
|
||||
|
||||
2026-02-22T22:38:58Z: Added new Jellyfin composition entrypoint `src/main/runtime/composers/jellyfin-runtime-composer.ts` and seam test `src/main/runtime/composers/jellyfin-runtime-composer.test.ts`; exported via composer barrel.
|
||||
|
||||
2026-02-22T22:38:58Z: Replaced inline Jellyfin deps-building block in `src/main.ts` with a single `composeJellyfinRuntimeHandlers(...)` invocation returning config/client/playback/remote/session/command/setup handlers used by existing callsites.
|
||||
|
||||
2026-02-22T22:38:58Z: Validation: `bun test src/main/runtime/composers/jellyfin-runtime-composer.test.ts src/main/runtime/composers/jellyfin-remote-composer.test.ts` PASS (2/2), `bun run check:main-fanin` PASS (`15 import lines, 9 unique runtime paths`), `bun run test:core:src` PASS (241 pass, 6 skip).
|
||||
|
||||
2026-02-22T22:38:58Z: `bun run build` currently FAILS in current working tree due pre-existing duplicate/invalid `src/main.ts` imports unrelated to TASK-103 extraction (many TS2300/TS2724 import-surface errors already present in file).
|
||||
|
||||
2026-02-22T22:49:05Z: Re-ran required completion gates after user fix: `bun run build` PASS, `bun run test:core:src` PASS (241 pass, 6 skip), `bun run check:main-fanin` PASS (`14 import lines, 11 unique runtime paths`).
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Extracted Jellyfin composition-root wiring from `src/main.ts` into a dedicated runtime composer entrypoint (`composeJellyfinRuntimeHandlers`) so main now delegates Jellyfin config resolution, client-info wiring, playback orchestration, remote session handlers, command dispatch, and setup-window wiring through a single composer surface. Added focused seam coverage in `src/main/runtime/composers/jellyfin-runtime-composer.test.ts`, retained existing `jellyfin-remote-composer` coverage, and updated architecture ownership docs to declare Jellyfin composer boundaries.
|
||||
|
||||
Validation run: `bun test src/main/runtime/composers/jellyfin-runtime-composer.test.ts src/main/runtime/composers/jellyfin-remote-composer.test.ts` (pass), `bun run check:main-fanin` (pass), `bun run build` (pass), and `bun run test:core:src` (pass).
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [x] #1 `src/main.ts` LOC reduced materially from current baseline.
|
||||
- [x] #2 Jellyfin runtime wiring is centralized in named composer module(s) with clear ownership docs.
|
||||
- [x] #3 No behavior regressions in Jellyfin command/setup flows.
|
||||
<!-- DOD:END -->
|
||||
@@ -1,43 +0,0 @@
|
||||
---
|
||||
id: TASK-104
|
||||
title: Mirror overlay annotation hover behavior in vendored texthooker
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-03-06 21:45'
|
||||
updated_date: '2026-03-06 21:45'
|
||||
labels:
|
||||
- texthooker
|
||||
- subtitle
|
||||
- websocket
|
||||
dependencies:
|
||||
- TASK-103
|
||||
references:
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/core/services/subtitle-ws.ts
|
||||
- /home/sudacode/projects/japanese/SubMiner/vendor/texthooker-ui/src/components/App.svelte
|
||||
- /home/sudacode/projects/japanese/SubMiner/vendor/texthooker-ui/src/line-markup.ts
|
||||
- /home/sudacode/projects/japanese/SubMiner/vendor/texthooker-ui/src/app.css
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Bring bundled texthooker annotation rendering closer to the visible overlay. Keep the lightweight texthooker UX, but preserve token metadata for hover, match overlay color-precedence rules across known/N+1/name/frequency/JLPT, expose name-match highlighting as a toggle, and emit a structured annotation payload on the dedicated websocket so non-SubMiner clients can treat it as an API.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Annotation websocket payload includes both rendered `sentence` HTML and structured token metadata for generic clients.
|
||||
- [x] #2 Vendored texthooker preserves annotation metadata attrs needed for hover labels and uses overlay-matching color precedence rules.
|
||||
- [x] #3 Vendored texthooker supports character-name highlighting with a user-facing toggle and standalone-web note.
|
||||
- [x] #4 Hovering annotated texthooker tokens reveals JLPT/frequency metadata without adding the full overlay popup workflow.
|
||||
- [x] #5 Focused serializer, texthooker markup, socket parsing, CSS, and build verification pass.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Extended the dedicated annotation websocket payload to ship `version`, plain `text`, rendered `sentence`, and structured `tokens` metadata while keeping backward-compatible `sentence` consumers working. Updated the vendored texthooker to preserve hover metadata attrs, follow overlay color precedence for known/N+1/name/frequency/JLPT annotations, add a character-name highlight toggle plus standalone-web dictionary note, and render lightweight hover labels for frequency/JLPT metadata. Added focused regression coverage and rebuilt both the vendored texthooker bundle and SubMiner.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,89 @@
|
||||
---
|
||||
id: TASK-104
|
||||
title: Split launcher config.ts into domain parsers and CLI builder
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-22 07:13'
|
||||
updated_date: '2026-02-23 02:06'
|
||||
labels:
|
||||
- refactor
|
||||
- launcher
|
||||
- maintainability
|
||||
dependencies:
|
||||
- TASK-81
|
||||
- TASK-102
|
||||
priority: medium
|
||||
ordinal: 103000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
`launcher/config.ts` is still a large multi-responsibility file (~700 LOC) combining:
|
||||
- config file reading/parsing for multiple domains,
|
||||
- plugin runtime config parsing,
|
||||
- CLI command tree construction,
|
||||
- root/subcommand arg normalization.
|
||||
|
||||
This file remains a cleanup hotspot and makes contract changes (like Jellyfin session migration) expensive to land safely.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Extract launcher config-file readers into domain loaders (YouTube/Jimaku, Jellyfin, plugin runtime).
|
||||
2. Extract Commander command-tree setup into a dedicated CLI builder module.
|
||||
3. Extract post-parse normalization into focused argument-normalization helpers.
|
||||
4. Remove stale Jellyfin config auth field assumptions from launcher config readers.
|
||||
5. Add focused tests per extracted module while preserving existing `launcher/config.test.ts` behavior expectations.
|
||||
6. Keep `parseArgs` API stable for launcher call sites.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 `launcher/config.ts` is reduced to thin orchestration over extracted modules.
|
||||
- [x] #2 Each extracted module has focused tests that assert current behavior.
|
||||
- [x] #3 Launcher still passes `bun run test:launcher` without CLI behavior regressions.
|
||||
- [x] #4 Launcher config readers align with current Jellyfin session contract (no config token/userId dependency).
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
Plan recorded at `docs/plans/2026-02-22-task-104-launcher-config-domain-parsers-cli-builder.md`.
|
||||
|
||||
Execution phases:
|
||||
1. Extract shared config readers and domain parser modules (`launcher/config/shared-config-reader.ts`, `launcher/config/youtube-subgen-config.ts`, `launcher/config/jellyfin-config.ts`) and reduce `launcher/config.ts` to orchestration.
|
||||
2. Extract plugin runtime parser into `launcher/config/plugin-runtime-config.ts` with focused behavior tests.
|
||||
3. Extract CLI parser builder/normalization into `launcher/config/cli-parser-builder.ts`, `launcher/config/parse-helpers.ts`, and `launcher/config/args-normalizer.ts`; keep `parseArgs` API unchanged.
|
||||
4. Align Jellyfin config contract by removing launcher config token/userId dependence and update caller/type wiring.
|
||||
5. Verify with `bun run test:launcher` and `bun run test:fast`, then finalize TASK-104 evidence (AC/DoD checks + summary).
|
||||
|
||||
Validation-first loop per phase: add/expand focused tests, run targeted launcher tests, implement minimal refactor to pass, then run full required suites.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Implemented launcher config decomposition by extracting domain-focused modules under `launcher/config/` (`shared-config-reader`, `youtube-subgen-config`, `jellyfin-config`, `plugin-runtime-config`, `cli-parser-builder`, `args-normalizer`) and reducing `launcher/config.ts` to an orchestration facade with unchanged exported API.
|
||||
|
||||
Aligned launcher Jellyfin config contract by removing `accessToken`/`userId` from `LauncherJellyfinConfig` and parser output; launcher Jellyfin play now requires `SUBMINER_JELLYFIN_ACCESS_TOKEN` + `SUBMINER_JELLYFIN_USER_ID` env session values instead of config fields.
|
||||
|
||||
Added focused parser regression tests in `launcher/config-domain-parsers.test.ts` (youtube domain normalization, jellyfin legacy token/userId omission, plugin socket parsing) and expanded `launcher/parse-args.test.ts` branch coverage for jellyfin/config/mpv command mappings.
|
||||
|
||||
Verification: `bun test launcher/config-domain-parsers.test.ts launcher/parse-args.test.ts`, `bun run test:launcher`, and `bun run test:fast` all pass.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Split `launcher/config.ts` into focused domain parser and CLI parsing modules while preserving the public launcher parsing API (`parseArgs`, config readers, plugin runtime reader). Added focused launcher parser tests, expanded parse-args coverage, and removed launcher config dependency on Jellyfin token/userId fields to match the current session contract. Verified behavior with `bun run test:launcher` and `bun run test:fast` passing.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [x] #1 Public launcher parsing API unchanged for downstream callers.
|
||||
- [x] #2 Help text and subcommand option behavior remains unchanged.
|
||||
- [x] #3 `bun run test:launcher` and `bun run test:fast` pass.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
id: TASK-105
|
||||
title: Eliminate unsafe non-test runtime casts in main boundaries
|
||||
status: Done
|
||||
assignee:
|
||||
- opencode-task105-unsafe-casts
|
||||
created_date: '2026-02-22 07:13'
|
||||
updated_date: '2026-02-23 02:06'
|
||||
labels:
|
||||
- refactor
|
||||
- type-safety
|
||||
- maintainability
|
||||
dependencies:
|
||||
- TASK-97
|
||||
- TASK-80
|
||||
priority: medium
|
||||
ordinal: 102000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Production runtime wiring still relies on many unsafe type escapes (`as never`, `as unknown as`) across `src/main.ts` and `src/main/runtime/*` non-test files.
|
||||
|
||||
Current scan shows repeated casts in dependency builders and runtime adapters, which hides contract drift and allowed current Jellyfin compile break to persist until full build.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Build a baseline list of non-test unsafe casts in `src/main.ts` and `src/main/runtime`.
|
||||
2. Group casts by ownership domain (Jellyfin, overlay, startup, IPC, tokenization, tray).
|
||||
3. For each domain, introduce explicit interface types/adapters so casts are removed at boundary creation.
|
||||
4. Keep test-only casts allowed where practical, but remove production-path `as never` usage.
|
||||
5. Add compile-time contract assertions for critical dependency builders to catch drift early.
|
||||
6. Validate with `bun run build` and affected source test suites.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Non-test `as never` occurrences in `src/main.ts` and `src/main/runtime` are reduced to zero or documented narrow exceptions.
|
||||
- [x] #2 Runtime dependency builders compile without unsafe production-path cast escapes.
|
||||
- [x] #3 Contract regressions are caught by compile/test checks rather than runtime behavior.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1) Baseline cast inventory in non-test scope (`src/main.ts`, `src/main/runtime/*`) using `rg` and record before-count in notes.
|
||||
2) Tighten runtime adapter contracts to remove `as never` escapes in `*-main-deps` modules: MPV/Jellyfin defaults, startup config deps, overlay visibility/options deps, field-grouping deps, CLI context deps, subtitle tokenization deps, dictionary runtime deps, tray/app deps, and MPV event bindings.
|
||||
3) Update `src/main.ts` boundary wiring to match tightened contracts and remove cast escapes in config hot-reload setters, dictionary lookup setters, MPV defaults/OSD wiring, MPV client factory constructor typing, tray creation, and overlay bootstrap callbacks.
|
||||
4) Re-run cast scan expecting zero non-test unsafe casts (or document narrow exceptions), run required gates (`bun run build`, `bun run test:core:src`), then attach before/after cast report and finalize AC/DoD.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Executed TASK-105 implementation with runtime contract tightening across `src/main.ts` + `src/main/runtime/*` non-test files. Removed all unsafe `as never` / `as unknown as` casts in target scope by replacing unknown passthrough contracts with typed deps (MPV/Jellyfin runtime types, overlay/bootstrap deps, tokenizer/CLI deps, dictionary lookup function types, tray deps typing).
|
||||
|
||||
Cast reduction report: baseline scan count = 42 non-test matches (`rg -n "as\\s+never|as\\s+unknown\\s+as" src/main.ts src/main/runtime --glob '!**/*.test.ts'`), after changes = 0 matches with same command.
|
||||
|
||||
Verification: targeted runtime cast-refactor tests passed (`bun test ...` across 19 files, 35 pass / 0 fail). Required core lane passed: `bun run test:core:src` => 236 pass / 6 skip / 0 fail.
|
||||
|
||||
Blocker: `bun run build` currently fails on pre-existing unrelated typing issues in `src/anki-integration/note-update-workflow.test.ts` (6 TS errors). No remaining build errors from TASK-105 touched files.
|
||||
|
||||
Follow-up verification rerun after concurrent compile-fix pass: `bun run build` now succeeds on current HEAD (tsc + renderer build + packaging copy step). DoD build gate unblocked.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Eliminated unsafe non-test runtime cast escapes in `src/main.ts` and `src/main/runtime/*` by tightening runtime dependency-builder contracts (MPV/Jellyfin, overlay/bootstrap, CLI/tokenizer, dictionary/tray boundaries) and removing `as never` / `as unknown as` patterns in production paths. Captured cast reduction evidence (42 -> 0 matches in scoped scan), validated focused runtime suites (35 pass), and revalidated required gates (`bun run test:core:src`, `bun run build`) on current HEAD.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [x] #1 Cast reduction report attached in task notes (before/after counts).
|
||||
- [x] #2 `bun run build` and `bun run test:core:src` pass.
|
||||
- [x] #3 Any remaining exceptions have explicit rationale in code comments or task notes.
|
||||
<!-- DOD:END -->
|
||||
@@ -1,47 +0,0 @@
|
||||
---
|
||||
id: TASK-105
|
||||
title: Stop local docs artifact writes after docs repo split
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-03-07 00:00'
|
||||
updated_date: '2026-03-07 00:20'
|
||||
labels: []
|
||||
dependencies: []
|
||||
priority: medium
|
||||
ordinal: 10500
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Now that user-facing docs live in `../subminer-docs`, first-party scripts in this repo should not keep writing generated artifacts into the local `docs/` tree.
|
||||
|
||||
Scope:
|
||||
|
||||
- Audit first-party scripts/automation for writes to `docs/`.
|
||||
- Keep repo-local outputs only where they are still intentionally owned by this repo.
|
||||
- Repoint generated docs artifacts to `../subminer-docs` when that is the maintained source of truth.
|
||||
- Add regression coverage for the config-example generation path contract.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 The config-example generator no longer writes to `docs/public/config.example.jsonc` inside this repo.
|
||||
- [x] #2 When `../subminer-docs` exists, the generator updates `../subminer-docs/public/config.example.jsonc`.
|
||||
- [x] #3 Automated coverage guards the output-path contract so local docs writes do not regress.
|
||||
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Removed the first-party local `docs/public` config-example write path from `src/generate-config-example.ts` and replaced it with sibling-docs-repo detection that targets `../subminer-docs/public/config.example.jsonc` only when that repo exists.
|
||||
|
||||
Added a project-local regression suite for output-path resolution and artifact writing, wired that suite into the maintained config test lane, and removed the stale generated `docs/public/config.example.jsonc` artifact from the working tree.
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -1,69 +0,0 @@
|
||||
---
|
||||
id: TASK-106
|
||||
title: Add first-run setup gate and auto-install flow
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-03-07 06:10'
|
||||
updated_date: '2026-03-07 06:20'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/main.ts
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/shared/setup-state.ts
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/main/runtime/first-run-setup-service.ts
|
||||
- /home/sudacode/projects/japanese/SubMiner/src/main/runtime/first-run-setup-window.ts
|
||||
- /home/sudacode/projects/japanese/SubMiner/launcher/commands/playback-command.ts
|
||||
priority: high
|
||||
ordinal: 10600
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Replace the current manual install flow with a first-run setup gate:
|
||||
|
||||
- bootstrap the default config dir/config file automatically
|
||||
- detect legacy installs and mark them complete when config + Yomitan dictionaries are already present
|
||||
- open a compact Catppuccin Macchiato setup popup for incomplete installs
|
||||
- optionally install the mpv plugin into the default mpv location
|
||||
- block launcher playback until setup completes, then resume the original playback flow
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 First app launch seeds the default config dir/config file without manual copy steps.
|
||||
- [x] #2 Existing installs with config plus at least one Yomitan dictionary are auto-detected as already complete.
|
||||
- [x] #3 Incomplete installs get a first-run setup popup with mpv plugin install, Yomitan settings, refresh, skip, and finish actions.
|
||||
- [x] #4 Launcher playback waits for setup completion and does not start mpv while setup is incomplete.
|
||||
- [x] #5 Plugin assets are packaged into the Electron bundle and regression tests cover the new flow.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Added shared setup-state/config/mpv path helpers so Electron and launcher read the same onboarding state file.
|
||||
|
||||
Introduced a first-run setup service plus compact BrowserWindow popup using Catppuccin Macchiato styling. The popup supports optional mpv plugin install, opening Yomitan settings, status refresh, skip-plugin, and gated finish once at least one Yomitan dictionary is installed.
|
||||
|
||||
Electron startup now bootstraps a default config file, auto-detects legacy-complete installs, adds `--setup` CLI support, exposes a tray `Complete Setup` action while incomplete, and avoids reopening setup once completion is recorded.
|
||||
|
||||
Launcher playback now checks the shared setup-state file before starting mpv. If setup is incomplete, it launches the app with `--background --setup`, waits for completion, and only then proceeds.
|
||||
|
||||
Verification:
|
||||
|
||||
- `bun run typecheck`
|
||||
- `bun run test:fast`
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
SubMiner now supports a download-and-launch install flow.
|
||||
|
||||
- First launch auto-creates config and opens setup only when needed.
|
||||
- Existing users with working installs are silently migrated to completed setup.
|
||||
- The setup popup handles optional mpv plugin install and Yomitan dictionary readiness.
|
||||
- Launcher playback is gated on setup completion and resumes automatically afterward.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,96 @@
|
||||
---
|
||||
id: TASK-106
|
||||
title: Decompose immersion tracker service into storage session and metadata modules
|
||||
status: Done
|
||||
assignee:
|
||||
- opencode-task106-immersion-modules
|
||||
created_date: '2026-02-22 07:14'
|
||||
updated_date: '2026-02-23 02:06'
|
||||
labels:
|
||||
- refactor
|
||||
- maintainability
|
||||
- immersion-tracking
|
||||
dependencies:
|
||||
- TASK-95
|
||||
priority: medium
|
||||
ordinal: 101000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
`src/core/services/immersion-tracker-service.ts` remains large (~1100 LOC) and still mixes multiple concerns in one class:
|
||||
- queue/flush orchestration,
|
||||
- DB schema and SQL lifecycle,
|
||||
- session state transitions,
|
||||
- local media metadata probing (`ffprobe`/hashing).
|
||||
|
||||
Further decomposition is needed to keep ownership boundaries clear and reduce refactor risk.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Extract SQLite schema+statement setup into a storage module dedicated to DB lifecycle.
|
||||
2. Extract session-state transition/event-recording logic into a session runtime module.
|
||||
3. Extract local metadata probing (hash + ffprobe parsing) into a metadata adapter module.
|
||||
4. Keep `ImmersionTrackerService` as orchestration facade over extracted collaborators.
|
||||
5. Expand seam tests for extracted modules and reduce skipped tracker coverage where feasible.
|
||||
6. Verify with source tracker tests and full build.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 `immersion-tracker-service.ts` no longer embeds full schema SQL and metadata probing logic directly.
|
||||
- [x] #2 Extracted modules have focused tests for session transitions, DB writes, and metadata parsing.
|
||||
- [x] #3 Tracker behavior remains unchanged (session lifecycle, rollups, retention, queue semantics).
|
||||
- [x] #4 Build and tracker-related source tests pass.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
Plan file: docs/plans/2026-02-22-task-106-immersion-tracker-storage-session-metadata.md
|
||||
|
||||
Execution plan:
|
||||
1) Add failing seam tests in src/core/services/immersion-tracker-service.test.ts for extracted storage/session/metadata APIs.
|
||||
2) Parallel slice A: extract storage/schema + session lifecycle collaborators into src/core/services/immersion-tracker/storage.ts and session.ts; rewire service.
|
||||
3) Parallel slice B: extract ffprobe/hash/local metadata probing into src/core/services/immersion-tracker/metadata.ts with injected seams; rewire service.
|
||||
4) Merge/wire both slices in immersion-tracker-service facade; verify behavior parity and file-size reduction.
|
||||
5) Run required gates: bun run build, bun test src/core/services/immersion-tracker-service.test.ts, bun run test:core:src.
|
||||
6) Update ownership docs (docs/immersion-tracking.md and/or docs/architecture.md) and finalize backlog AC/DoD notes/status (no commit).
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Implemented decomposition with new modules: `src/core/services/immersion-tracker/storage.ts` (schema/DB writes/prepared statements), `src/core/services/immersion-tracker/session.ts` (session start/finalize persistence), and `src/core/services/immersion-tracker/metadata.ts` (ffprobe/hash/local metadata probing with injectable deps).
|
||||
|
||||
`src/core/services/immersion-tracker-service.ts` reduced from 1099 LOC baseline to 654 LOC; now orchestration facade delegating storage/session/metadata concerns while preserving public API and queue/maintenance semantics.
|
||||
|
||||
Added focused tests: `src/core/services/immersion-tracker/storage-session.test.ts` (schema creation, session transitions, DB writes) and `src/core/services/immersion-tracker/metadata.test.ts` (ffprobe parsing/fallbacks, hash fallback).
|
||||
|
||||
Validation: `bun test src/core/services/immersion-tracker/metadata.test.ts src/core/services/immersion-tracker/storage-session.test.ts src/core/services/immersion-tracker-service.test.ts` => 7 pass, 9 skip, 0 fail; `bun run test:core:src` => 236 pass, 6 skip, 0 fail.
|
||||
|
||||
Build gate currently fails due pre-existing unrelated TypeScript errors in `src/anki-integration/*` and `src/main/runtime/*` test/type contracts; no new immersion-tracker errors observed in this pass.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Decomposed `src/core/services/immersion-tracker-service.ts` into focused collaborators while preserving tracker behavior and public API. Introduced `src/core/services/immersion-tracker/storage.ts` (schema bootstrap, prepared statements, DB writes), `src/core/services/immersion-tracker/session.ts` (session start/finalize persistence), and `src/core/services/immersion-tracker/metadata.ts` (ffprobe/hash/local metadata probing with injectable deps). Reduced service file from 1099 LOC baseline to 654 LOC and kept queue/flush/maintenance orchestration in the facade.
|
||||
|
||||
Added focused regression coverage via `src/core/services/immersion-tracker/storage-session.test.ts` and `src/core/services/immersion-tracker/metadata.test.ts`, and updated ownership documentation in `docs/immersion-tracking.md` to reflect new boundaries.
|
||||
|
||||
Verification:
|
||||
- `bun run build` ✅
|
||||
- `bun test src/core/services/immersion-tracker/metadata.test.ts src/core/services/immersion-tracker/storage-session.test.ts src/core/services/immersion-tracker-service.test.ts` ✅ (7 pass, 9 skip)
|
||||
- `bun run test:core:src` ✅ (236 pass, 6 skip)
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [x] #1 Service file size reduced materially from current baseline.
|
||||
- [x] #2 Ownership boundaries documented in `docs/architecture.md` or relevant service docs.
|
||||
- [x] #3 No regression in `bun run test:core:src` immersion tracker coverage.
|
||||
<!-- DOD:END -->
|
||||
@@ -1,42 +0,0 @@
|
||||
---
|
||||
id: TASK-107
|
||||
title: 'Fix Yomitan scan-token fallback fragmentation on exact-source misses'
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-03-07 01:10'
|
||||
updated_date: '2026-03-07 01:12'
|
||||
labels: []
|
||||
dependencies: []
|
||||
priority: high
|
||||
ordinal: 9007
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Left-to-right Yomitan scanning can emit bogus fallback tokens when `termsFind` returns entries but none of their headwords carries an exact primary source for the consumed substring. Repro: `だが それでも届かぬ高みがあった` currently yields trailing fragments like `があ` / `た`, which blocks the real `あった` token from receiving frequency highlighting.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Scanner skips `termsFind` fallback entries that are not backed by an exact primary source for the consumed substring.
|
||||
- [x] #2 Repro line no longer yields bogus trailing fragments such as `があ`.
|
||||
- [x] #3 Regression coverage added for the scan-token path.
|
||||
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Removed the scan-token helper fallback that previously emitted a token from the first returned headword even when Yomitan did not report an exact primary source for the consumed substring. Added a focused regression test covering `だが それでも届かぬ高みがあった`, ensuring bogus `があ` fragmentation is skipped so the later `あった` exact match can still be tokenized and highlighted.
|
||||
|
||||
Verification:
|
||||
|
||||
- `bun test src/core/services/tokenizer/yomitan-parser-runtime.test.ts src/core/services/tokenizer.test.ts --timeout 20000`
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
id: TASK-107
|
||||
title: Fix post-rebase overlay toggle regression
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-21 23:34'
|
||||
updated_date: '2026-02-22 07:49'
|
||||
labels:
|
||||
- bug
|
||||
- overlay
|
||||
- regression
|
||||
dependencies: []
|
||||
priority: high
|
||||
ordinal: 98000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
After recent rebase, toggling visible or invisible overlay opens a transparent non-interactable window. Symptoms:
|
||||
- invisible subtitle mode no longer renders/works,
|
||||
- visible subtitles do not show,
|
||||
- overlay keybinds do not work on the created window.
|
||||
|
||||
Need root-cause fix so both overlay modes render and interactive/keybind behavior returns to pre-rebase behavior.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Reproduce regression in source tests around overlay toggle/window behavior.
|
||||
2. Add failing regression test for transparent/non-interactable overlay window path.
|
||||
3. Identify rebase-introduced break in overlay creation/runtime toggle wiring.
|
||||
4. Implement minimal fix for renderer loading + window interaction state.
|
||||
5. Verify with focused tests and smoke checks.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Toggling visible overlay shows subtitle content again.
|
||||
- [x] #2 Toggling invisible overlay restores interactive subtitle behavior.
|
||||
- [x] #3 Overlay keybinds work after overlay toggle in both modes.
|
||||
- [x] #4 Added regression coverage for broken toggle path.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
- Root-cause candidate fixed: renderer layer detection could trust preload `process.argv` over per-window query params, which can drift under shared renderer process and force wrong layer behavior.
|
||||
- Changed `src/renderer/utils/platform.ts` to prioritize `window.location.search` (`?layer=visible|invisible`) and only fallback to preload layer when query is missing/invalid.
|
||||
- Added regression test in `src/renderer/error-recovery.test.ts` asserting query-layer precedence.
|
||||
- Added explicit `webPreferences.sandbox = false` in `src/core/services/overlay-window.ts` to keep preload Node-style API availability stable on newer Electron defaults.
|
||||
- Added regression test `src/core/services/overlay-window-config.test.ts` to guard sandbox setting.
|
||||
- Validation: `bun test src/core/services/overlay-window-config.test.ts src/renderer/error-recovery.test.ts`; `bun run build`.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [x] #1 Focused overlay/runtime tests pass.
|
||||
- [x] #2 No new type/build regressions introduced by fix.
|
||||
- [x] #3 Task notes include root cause and validation commands.
|
||||
<!-- DOD:END -->
|
||||
@@ -0,0 +1,109 @@
|
||||
---
|
||||
id: TASK-108
|
||||
title: Add AniSkip intro skip markers and OSD skip button in mpv plugin
|
||||
status: Done
|
||||
assignee:
|
||||
- '@codex'
|
||||
created_date: '2026-02-22 08:05'
|
||||
updated_date: '2026-02-22 19:49'
|
||||
labels:
|
||||
- feature
|
||||
- mpv
|
||||
- intro-skip
|
||||
dependencies: []
|
||||
priority: high
|
||||
ordinal: 98100
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Wire `plugin/subminer.lua` to call AniSkip API, parse intro skip window, add skip markers/chapters to mpv, and show an OSD skip button while playback is inside the intro range.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Add configurable AniSkip options + state in plugin.
|
||||
2. Resolve anime id + episode from mpv metadata/filename.
|
||||
3. Fetch AniSkip skip-times API and parse OP interval.
|
||||
4. Create/update chapters for OP marker.
|
||||
5. Render clickable OSD skip button while inside OP range.
|
||||
6. Add manual script message to retry fetch.
|
||||
7. Update plugin docs/config comments.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Plugin calls AniSkip API and handles missing data gracefully.
|
||||
- [x] #2 Intro marker/chapter is visible in mpv when OP range exists.
|
||||
- [x] #3 OSD skip button appears only while inside OP range.
|
||||
- [x] #4 Clicking/activating button seeks to OP end.
|
||||
- [x] #5 Docs/config include new options + script message.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
Execution plan (2026-02-22) saved at docs/plans/2026-02-22-task-108-aniskip-intro-skip-closure.md.
|
||||
|
||||
1) Re-baseline TASK-108 AC/DoD against current implementation in plugin/subminer.lua, plugin/subminer.conf, and docs/mpv-plugin.md.
|
||||
2) Run focused validations: luac parse check; bun test launcher/aniskip-metadata.test.ts; bun test launcher/mpv.test.ts; bun run tsc --noEmit.
|
||||
3) If any AC drift is found, apply minimal patches only in AniSkip-related plugin/docs paths and re-run validations.
|
||||
4) Finalize TASK-108 in Backlog with notes, checklist updates, final summary, and status Done; complete subagent bookkeeping updates.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Linked to user request on 2026-02-22 for porting intro skip via AniSkip.
|
||||
- Follow-up implemented per user request:
|
||||
- launcher now runs `guessit` for file targets and passes `subminer-aniskip_title`, `subminer-aniskip_season`, `subminer-aniskip_episode` via mpv `--script-opts`
|
||||
- fallback metadata path passes filename-derived title when `guessit` is unavailable/empty
|
||||
- intro hint now displays for first 3 seconds from intro start (`You can skip by pressing y-k`)
|
||||
- Runtime bugfix follow-up:
|
||||
- always binds `y-k` fallback key for intro skip, even when custom `aniskip_button_key` configured
|
||||
- intro skip handler now shows explicit OSD reason if skip is unavailable or outside intro window
|
||||
- Validation:
|
||||
- `bun test launcher/aniskip-metadata.test.ts`
|
||||
- `bun test launcher/mpv.test.ts`
|
||||
- `luac -p plugin/subminer.lua`
|
||||
- `bun run tsc --noEmit`
|
||||
|
||||
2026-02-22 closure verification pass (no code patch required):
|
||||
|
||||
- AC mapping revalidated in `plugin/subminer.lua`: AniSkip fetch + fallback handling, OP chapter marker add/remove, in-range skip hint gate, skip-to-intro-end action, and script messages `subminer-aniskip-refresh` / `subminer-skip-intro`.
|
||||
|
||||
- Docs/config coverage revalidated in `plugin/subminer.conf` and `docs/mpv-plugin.md` (AniSkip options + script message docs present).
|
||||
|
||||
- Validation commands:
|
||||
|
||||
- `luac -p plugin/subminer.lua` ✅
|
||||
|
||||
- `bun test launcher/aniskip-metadata.test.ts` ✅ (5 pass)
|
||||
|
||||
- `bun test launcher/mpv.test.ts` ✅ (4 pass)
|
||||
|
||||
- `bun run tsc --noEmit` ⚠️ blocked by unrelated pre-existing errors in `src/anki-integration/note-update-workflow.test.ts` (outside TASK-108 scope; no TASK-108 file touched in this closure pass).
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Validated and closed AniSkip intro-skip behavior in mpv plugin without additional code changes. Confirmed `plugin/subminer.lua` already implements AniSkip API fetch with graceful fallbacks, OP intro chapter markers, in-range OSD hint + skip action (`subminer-skip-intro`), and docs/config coverage for new options and script messages in `plugin/subminer.conf` and `docs/mpv-plugin.md`.
|
||||
|
||||
Verification run for TASK-108:
|
||||
- `luac -p plugin/subminer.lua` (pass)
|
||||
- `bun test launcher/aniskip-metadata.test.ts` (pass, 5 tests)
|
||||
- `bun test launcher/mpv.test.ts` (pass, 4 tests)
|
||||
- `bun run tsc --noEmit` (fails due to unrelated pre-existing `src/anki-integration/note-update-workflow.test.ts` type errors outside this task)
|
||||
|
||||
Task acceptance criteria and DoD are satisfied for this scope; task is finalized as Done.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [x] #1 Focused plugin smoke validation in mpv.
|
||||
- [x] #2 Lua parse/load check passes in local environment.
|
||||
- [x] #3 Task notes capture fallback behavior.
|
||||
<!-- DOD:END -->
|
||||
@@ -1,43 +0,0 @@
|
||||
---
|
||||
id: TASK-108
|
||||
title: 'Exclude single kana tokens from frequency highlighting'
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-03-07 01:18'
|
||||
updated_date: '2026-03-07 01:22'
|
||||
labels: []
|
||||
dependencies: []
|
||||
priority: medium
|
||||
ordinal: 9008
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Suppress frequency highlighting for single-character hiragana or katakana tokens. Scope is frequency-only: known/N+1/JLPT behavior stays unchanged.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Single-character hiragana tokens do not retain `frequencyRank`.
|
||||
- [x] #2 Single-character katakana tokens do not retain `frequencyRank`.
|
||||
- [x] #3 Regression coverage exists at annotation-stage and tokenizer levels.
|
||||
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Added a frequency-only suppression rule for single-character kana tokens based on token `surface`, so bogus merged fragments like `た` and standalone one-character kana no longer keep `frequencyRank`. Regression coverage now exists both in the annotation stage and in the tokenizer path, while multi-character tokens and N+1/JLPT behavior remain unchanged.
|
||||
|
||||
Verification:
|
||||
|
||||
- `bun test src/core/services/tokenizer/annotation-stage.test.ts --timeout 20000`
|
||||
- `bun test src/core/services/tokenizer.test.ts --timeout 20000`
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
id: TASK-109
|
||||
title: Add Discord Rich Presence integration with polished activity card
|
||||
status: Done
|
||||
assignee:
|
||||
- opencode
|
||||
created_date: '2026-02-22 19:40'
|
||||
updated_date: '2026-02-23 02:06'
|
||||
labels:
|
||||
- feature
|
||||
- discord
|
||||
- presence
|
||||
dependencies: []
|
||||
priority: medium
|
||||
ordinal: 104000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Add optional Discord Rich Presence support so SubMiner can publish current activity (show/file context, study/mining status, elapsed session) with a polished, readable Discord activity card.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Choose and add a Discord RPC client strategy compatible with Electron + launcher runtime.
|
||||
2. Add config toggle and safe defaults so Discord presence is opt-in.
|
||||
3. Define presence payload model (state/details/timestamps/assets/buttons) from existing runtime session metadata.
|
||||
4. Wire lifecycle updates for start, pause/resume, episode/file changes, and stop/quit.
|
||||
5. Design assets/text for a clean, branded activity box that is informative without noisy updates.
|
||||
6. Add debounce/rate-limit handling and fallback behavior when Discord is unavailable.
|
||||
7. Add focused tests for payload mapping and lifecycle transitions; document setup in user docs.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Discord Rich Presence can be enabled via config and remains disabled by default.
|
||||
- [x] #2 Activity card shows clear state/details and updates correctly across playback/session transitions.
|
||||
- [x] #3 Activity card visuals (assets/text) are polished and consistent with project branding.
|
||||
- [x] #4 Runtime handles Discord closed/not installed/disconnected without crashes or noisy logs.
|
||||
- [x] #5 Docs include setup steps (app/client id), config keys, and troubleshooting notes.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1) Validate existing TASK-109 implementation in working tree against AC #1-#5 (config default-off, activity mapping/transitions, polished visuals, resilient error handling, docs coverage).
|
||||
2) Run parallel audit passes (config/docs and runtime/lifecycle) and apply minimal fixes only for confirmed gaps.
|
||||
3) Execute focused Discord/config tests, then full gates (`bun run build`, `bun run test:fast`, `bun run docs:build`) and record outcomes.
|
||||
4) Capture manual Discord-session verification status/evidence.
|
||||
5) Finalize TASK-109 in Backlog with checked AC/DoD, final summary, and status Done (no commit).
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Implemented opt-in `discordPresence` config surface in types/defaults/resolver/option-registry/template sections with clamped timing fields and focused config tests.
|
||||
|
||||
Added `src/core/services/discord-presence.ts` with payload mapping, debounce+interval update throttling, duplicate suppression, and resilient login/set/clear error handling.
|
||||
|
||||
Wired MPV/runtime lifecycle hooks to refresh Discord presence on subtitle/media/path/time/pause/connection transitions and added cleanup stop hook in app lifecycle cleanup path + focused tests.
|
||||
|
||||
Updated docs and generated config examples with Discord Rich Presence setup/config/troubleshooting guidance.
|
||||
|
||||
Validation status: focused config/runtime/discord tests pass and docs build passes. Full `bun run build` currently blocked by pre-existing `src/main.ts` duplicate imports/symbol errors unrelated to TASK-109 scope (existing in working tree).
|
||||
|
||||
User validation feedback: Discord activity resumed to Playing but with noticeable delay after pause/resume transitions.
|
||||
|
||||
Adjusted default `discordPresence.updateIntervalMs` from `15000` to `3000` to reduce perceived status refresh lag while keeping debounce/duplicate suppression behavior unchanged.
|
||||
|
||||
Updated docs/config examples (`docs/configuration.md`, `config.example.jsonc`, `docs/public/config.example.jsonc`) and config default assertions; reran focused tests: `bun test src/config/config.test.ts src/config/resolve/jellyfin.test.ts` and `bun test src/core/services/discord-presence.test.ts` (all pass).
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Definition of Done
|
||||
<!-- DOD:BEGIN -->
|
||||
- [x] #1 Focused tests cover presence payload mapping and lifecycle update behavior.
|
||||
- [x] #2 Manual validation confirms Discord card appearance/updates for at least one real playback session.
|
||||
- [x] #3 Build/test/docs gates pass with no regressions.
|
||||
<!-- DOD:END -->
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
id: TASK-110
|
||||
title: Replace vendored Yomitan with submodule-built Chrome artifact workflow
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-03-07 11:05'
|
||||
updated_date: '2026-03-07 11:22'
|
||||
labels:
|
||||
- yomitan
|
||||
- build
|
||||
- release
|
||||
dependencies: []
|
||||
priority: high
|
||||
ordinal: 9010
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
|
||||
Replace the checked-in `vendor/yomitan` release tree with a `subminer-yomitan` git submodule. Build Yomitan from source, extract the Chromium zip artifact into a stable local build directory, and make SubMiner dev/runtime/tests/release packaging load that extracted extension instead of the source tree or vendored files.
|
||||
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
<!-- AC:BEGIN -->
|
||||
|
||||
- [x] #1 Repo tracks Yomitan as a git submodule instead of committed extension files under `vendor/yomitan`.
|
||||
- [x] #2 SubMiner has a reproducible build/extract step that produces a local Chromium extension directory from `subminer-yomitan`.
|
||||
- [x] #3 Dev/runtime/tests resolve the extracted build output as the default Yomitan extension path.
|
||||
- [x] #4 Release packaging includes the extracted Chromium extension files instead of the old vendored tree.
|
||||
- [x] #5 Docs and verification commands reflect the new workflow.
|
||||
|
||||
<!-- AC:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
|
||||
Replaced the checked-in `vendor/yomitan` extension tree with a `vendor/subminer-yomitan` git submodule and added a reproducible `bun run build:yomitan` workflow that builds `yomitan-chrome.zip`, extracts it into `build/yomitan`, and reuses a source-state stamp to skip redundant rebuilds. Runtime path resolution, helper CLIs, Yomitan integration tests, packaging, CI cache keys, and README source-build notes now all target that generated artifact instead of the old vendored files.
|
||||
|
||||
Verification:
|
||||
|
||||
- `bun run build:yomitan`
|
||||
- `bun test src/core/services/yomitan-extension-paths.test.ts src/core/services/yomitan-structured-content-generator.test.ts src/yomitan-translator-sort.test.ts`
|
||||
- `bun run typecheck`
|
||||
- `bun run build`
|
||||
- `bun run test:core:src`
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
id: TASK-110
|
||||
title: Split overlay into top secondary bar and bottom primary region
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-23 02:16'
|
||||
updated_date: '2026-02-23 02:53'
|
||||
labels:
|
||||
- overlay
|
||||
- subtitle
|
||||
- ux
|
||||
dependencies: []
|
||||
priority: high
|
||||
ordinal: 110000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Implement a 3-window overlay layout:
|
||||
|
||||
- Dedicated secondary subtitle window anchored to top of mpv bounds (max 20% of height).
|
||||
- Visible overlay window constrained to remaining lower region.
|
||||
- Invisible overlay window constrained to remaining lower region.
|
||||
|
||||
Secondary subtitle bar must stay independently anchored while visible/invisible overlays swap.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Runtime creates/manages a third overlay window dedicated to secondary subtitles.
|
||||
- [x] #2 Secondary window stays anchored to top region capped at 20% of tracked mpv bounds.
|
||||
- [x] #3 Visible and invisible overlay windows are constrained to remaining lower region.
|
||||
- [x] #4 Secondary subtitle rendering/mode updates reach dedicated top window without duplicate top bars in primary windows.
|
||||
- [x] #5 Focused runtime/core tests cover geometry split + window wiring regressions.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
Closure verification plan (2026-02-23):
|
||||
1) Re-read TASK-110 via Backlog MCP and confirm Done status + AC/summary/notes completeness.
|
||||
2) Validate evidence commit `b8f7d5e` still matches shipped scope (overlay secondary top bar + primary lower region split).
|
||||
3) Apply backlog metadata sync only if any field is stale/missing; keep status Done.
|
||||
4) Record closure verification note with timestamp and validation outcome.
|
||||
Plan artifact: `docs/plans/2026-02-23-task-110-overlay-closure-verification.md`.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
- Added new `secondary` overlay window kind and runtime factory wiring, plus manager ownership (`get/setSecondaryWindow`) and bounds setter.
|
||||
- Added geometry splitter `splitOverlayGeometryForSecondaryBar` (20% top secondary, 80% bottom primary), integrated into `updateVisibleOverlayBounds` / `updateInvisibleOverlayBounds` flow.
|
||||
- Main runtime now creates secondary window alongside primary overlays and syncs secondary window visibility with `secondarySubMode`.
|
||||
- Renderer now recognizes `layer=secondary`; secondary bar is hidden on primary layers, and primary subtitle/modals are hidden on secondary layer.
|
||||
- Secondary layer no longer reports overlay content measurements to avoid invalid payloads.
|
||||
- Validation:
|
||||
- `bun run tsc --noEmit`
|
||||
- `bun test src/main/runtime/overlay-window-factory.test.ts src/main/runtime/overlay-window-factory-main-deps.test.ts src/main/runtime/overlay-window-runtime-handlers.test.ts src/renderer/error-recovery.test.ts src/core/services/overlay-window.test.ts`
|
||||
- `bun run build`
|
||||
- `node --test dist/core/services/overlay-manager.test.js`
|
||||
- Commit: `b8f7d5e` (`feat(overlay): split secondary subtitles into dedicated top window`)
|
||||
|
||||
2026-02-23 verification pass: revalidated TASK-110 closure against Backlog finalization criteria. Confirmed status remains Done, all 5 acceptance criteria are checked, implementation notes/final summary are present, and commit `b8f7d5e` still matches shipped scope (secondary top overlay window, 20%/80% geometry split, primary-layer duplicate prevention, focused runtime/core/renderer tests). No additional code changes required.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Implemented the requested 3-window overlay architecture:
|
||||
|
||||
- Secondary subtitles render in a dedicated top overlay window.
|
||||
- Top secondary bar is capped at 20% of mpv bounds.
|
||||
- Visible/invisible overlays are constrained to the lower remaining region.
|
||||
- Secondary mode changes now directly control secondary window visibility.
|
||||
- Primary overlay layers no longer duplicate secondary subtitle rendering.
|
||||
|
||||
All acceptance criteria are complete and merged in commit `b8f7d5e`.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -1,71 +0,0 @@
|
||||
---
|
||||
id: TASK-111
|
||||
title: Fix subtitle-cycle OSD labels for J keybindings
|
||||
status: Done
|
||||
assignee:
|
||||
- Codex
|
||||
created_date: '2026-03-07 23:45'
|
||||
updated_date: '2026-03-08 00:06'
|
||||
labels: []
|
||||
dependencies: []
|
||||
references:
|
||||
- /Users/sudacode/projects/japanese/SubMiner/src/core/services/ipc-command.ts
|
||||
- /Users/sudacode/projects/japanese/SubMiner/src/core/services/mpv.ts
|
||||
- >-
|
||||
/Users/sudacode/projects/japanese/SubMiner/src/core/services/ipc-command.test.ts
|
||||
- >-
|
||||
/Users/sudacode/projects/japanese/SubMiner/src/core/services/mpv-control.test.ts
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
When cycling subtitle tracks with the default J/Shift+J keybindings, the mpv OSD currently shows raw template text like `${sid}` instead of a resolved subtitle label. Update the keybinding OSD behavior so users see the active subtitle selection clearly when cycling tracks, and ensure placeholder-based OSD messages sent through the mpv client API render correctly.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Pressing the primary subtitle cycle keybinding shows a resolved subtitle label on the OSD instead of a raw `${sid}` placeholder.
|
||||
- [x] #2 Pressing the secondary subtitle cycle keybinding shows a resolved subtitle label on the OSD instead of a raw `${secondary-sid}` placeholder.
|
||||
- [x] #3 Proxy OSD messages that rely on mpv property expansion render resolved values when sent through the mpv client API.
|
||||
- [x] #4 Regression tests cover the subtitle-cycle OSD behavior and the placeholder-expansion OSD path.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Add focused failing tests for subtitle-cycle OSD labels and mpv placeholder-expansion behavior.
|
||||
2. Update the IPC mpv command handler to resolve primary and secondary subtitle track labels from mpv `track-list` data after cycling subtitle tracks.
|
||||
3. Update the mpv OSD runtime path so placeholder-based `show-text` messages sent through the client API opt into property expansion.
|
||||
4. Run focused tests, then the relevant core test lane, and record results in the task notes.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Initial triage: `ipc-command.ts` emits raw `${sid}`/`${secondary-sid}` placeholder strings, and `showMpvOsdRuntime` sends `show-text` via mpv client API without enabling property expansion.
|
||||
|
||||
User approved implementation plan on 2026-03-07.
|
||||
|
||||
Implementation: proxy mpv command OSD now supports an async resolver so subtitle track cycling can show human-readable labels instead of raw `${sid}` placeholders.
|
||||
|
||||
Implementation: `showMpvOsdRuntime` now prefixes placeholder-based messages with mpv client-api `expand-properties`, which fixes raw `${...}` OSD output for subtitle delay/position messages.
|
||||
|
||||
Testing: `bun test src/core/services/ipc-command.test.ts src/core/services/mpv-control.test.ts src/main/runtime/mpv-proxy-osd.test.ts src/main/runtime/ipc-mpv-command-main-deps.test.ts src/main/runtime/ipc-bridge-actions.test.ts src/main/runtime/ipc-bridge-actions-main-deps.test.ts src/main/runtime/composers/ipc-runtime-composer.test.ts` passed.
|
||||
|
||||
Testing: `bun x tsc --noEmit` passed.
|
||||
|
||||
Testing: `bun run test:core:src` passed (423 pass, 6 skip, 0 fail).
|
||||
|
||||
Docs: no update required because no checked-in docs or help text describe the J/Shift+J OSD output behavior.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Fixed subtitle-cycle OSD handling for the default J/Shift+J keybindings. The IPC mpv command path now supports resolving proxy OSD text asynchronously, and the main-runtime resolver reads mpv `track-list` state so primary and secondary subtitle cycling show human-readable track labels instead of raw `${sid}` / `${secondary-sid}` placeholders.
|
||||
|
||||
Also fixed the lower-level mpv OSD transport so placeholder-based `show-text` messages sent through the client API opt into `expand-properties`. That preserves existing template-based OSD messages like subtitle delay and subtitle position without leaking the raw `${...}` syntax.
|
||||
|
||||
Added regression coverage for the async proxy OSD path, the placeholder-expansion `showMpvOsdRuntime` path, and the runtime subtitle-track label resolver. Verification run: `bun x tsc --noEmit`; focused mpv/IPC tests; and the maintained `bun run test:core:src` lane (423 pass, 6 skip, 0 fail).
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
id: TASK-111
|
||||
title: Remove Maintainability Guardrails docs section and related guardrail code
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-23 03:37'
|
||||
updated_date: '2026-02-23 03:40'
|
||||
labels:
|
||||
- docs
|
||||
- cleanup
|
||||
- guardrails
|
||||
dependencies: []
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
User requested removing the docs section labeled "Maintainability Guardrails" and deleting associated project code/commands for those guardrails so docs and scripts stay consistent.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Docs no longer contain the Maintainability Guardrails section shown in the request.
|
||||
- [x] #2 Commands and code associated specifically with that removed guardrails section are removed from scripts/config where applicable.
|
||||
- [x] #3 Project references remain consistent (no stale mentions of removed guardrails commands).
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Removed the `## Maintainability Guardrails` section from `docs/development.md` including strict command examples and troubleshooting bullets.
|
||||
|
||||
Removed guardrail scripts from `package.json`: `check:main-fanin`, `check:main-fanin:strict`, `check:runtime-cycles`, `check:runtime-cycles:strict`.
|
||||
|
||||
Deleted associated script code and fixtures: `scripts/check-main-runtime-fanin.ts`, `scripts/check-runtime-cycles.ts`, `scripts/check-runtime-cycles.test.ts`, and `scripts/fixtures/runtime-cycles/**`.
|
||||
|
||||
Removed CI fail-fast guardrail step from `.github/workflows/ci.yml` that invoked strict fan-in/runtime-cycle checks.
|
||||
|
||||
Validation: `bun run tsc --noEmit` and `bun run docs:build` passed.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Removed the Maintainability Guardrails docs section and fully removed the related fan-in/runtime-cycle guardrail implementation from scripts, package commands, CI wiring, and fixtures. The repository now has no active references to those guardrail commands in development docs, package scripts, or CI workflow.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -1,61 +0,0 @@
|
||||
---
|
||||
id: TASK-112
|
||||
title: Address Claude review items on PR 15
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-03-08 00:11'
|
||||
updated_date: '2026-03-08 00:12'
|
||||
labels:
|
||||
- pr-review
|
||||
- ci
|
||||
dependencies: []
|
||||
references:
|
||||
- .github/workflows/release.yml
|
||||
- .github/workflows/ci.yml
|
||||
- .gitmodules
|
||||
- >-
|
||||
backlog/tasks/task-101 -
|
||||
Index-AniList-character-alternative-names-in-the-character-dictionary.md
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Review Claude's PR feedback on PR #15, implement only the technically valid fixes on the current branch, and document which comments are non-actionable or already acceptable.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Validated Claude's concrete PR review items against current branch state and repo conventions
|
||||
- [x] #2 Implemented the accepted fixes with regression coverage or verification where applicable
|
||||
- [x] #3 Documented which review items are non-blocking or intentionally left unchanged
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Validate each Claude review item against current branch files and repo workflow.
|
||||
2. Patch release quality-gate to match CI ordering and add explicit typecheck.
|
||||
3. Remove duplicate .gitmodules stanza and normalize the TASK-101 reference path through Backlog MCP.
|
||||
4. Run relevant verification for workflow/config metadata changes and record which review items remain non-actionable.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
User asked to address Claude PR comments on PR #15 and assess whether any action items remain. Treat review suggestions skeptically; only fix validated defects.
|
||||
|
||||
Validated Claude's five review items. Fixed release workflow ordering/typecheck, removed the duplicate .gitmodules entry, and normalized TASK-101 references to repo-relative paths via Backlog MCP.
|
||||
|
||||
Left the vendor/subminer-yomitan branch-pin suggestion unchanged. The committed submodule SHA already controls reproducibility; adding a branch would only affect update ergonomics and was not required to address a concrete defect.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Validated Claude's PR #15 review summary against the current branch and applied the actionable fixes. In `.github/workflows/release.yml`, the release `quality-gate` job now restores the dependency cache before installation, no longer installs twice, and runs `bun run typecheck` before the fast test suite to match CI expectations. In `.gitmodules`, removed the duplicate `vendor/yomitan-jlpt-vocab` stanza with the conflicting duplicate path. Through Backlog MCP, updated `TASK-101` references from an absolute local path to repo-relative paths so the task metadata is portable across contributors.
|
||||
|
||||
Verification: `git diff --check`, `git config -f .gitmodules --get-regexp '^submodule\..*\.path$'`, `bun run typecheck`, and `bun run test:fast` all passed. `bun run format:check` still fails on many pre-existing unrelated files already present on the branch, including multiple backlog task files and existing source/docs files; this review patch did not attempt a repo-wide formatting sweep.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
id: TASK-112
|
||||
title: Fix docs demo video thumbnail cache staleness
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-02-23 03:41'
|
||||
updated_date: '2026-02-23 03:43'
|
||||
labels:
|
||||
- bug
|
||||
- docs
|
||||
- media
|
||||
dependencies: []
|
||||
priority: medium
|
||||
ordinal: 112000
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Docs home page demo continues to show an old thumbnail after replacing the demo video file in place. The page currently reuses static media URLs (`/assets/minecard.webm`, `/assets/minecard.mp4`, `/assets/demo-poster.jpg`), so browser/CDN cache can keep stale poster/video preview data.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Action Steps
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Add a failing regression check that asserts cache-busted URL usage for docs home demo media references.
|
||||
2. Update docs home demo media URLs to include a shared asset version token for poster/source/fallback paths.
|
||||
3. Run the regression check and docs build validation.
|
||||
4. Record fix notes and move task status to Done.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Docs home video references include a deterministic cache-busting token so direct asset replacement does not serve stale preview data.
|
||||
- [x] #2 Poster/source/fallback links in the demo block use the same token to avoid mixed old/new media.
|
||||
- [x] #3 Validation commands for the new regression check and docs build pass.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
- Generated a fresh thumbnail from `docs/public/assets/minecard.webm` into `docs/public/assets/minecard-poster.jpg`.
|
||||
- Updated `docs/index.md` demo block to use a shared `demoAssetVersion` token across poster, webm/mp4 sources, and gif fallback links.
|
||||
- Follow-up: regenerated `minecard-poster.jpg` at exact `00:00:12` from the webm and bumped token to `demoAssetVersion = '20260223-2'`.
|
||||
- Added regression check `docs/index.assets.test.ts` to ensure demo media references keep shared cache-busting URL patterns.
|
||||
- Validation:
|
||||
- `bun test docs/index.assets.test.ts`
|
||||
- `bun run docs:build`
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,33 @@
|
||||
---
|
||||
id: TASK-113
|
||||
title: Refresh architecture doc content to match current codebase
|
||||
status: Done
|
||||
assignee:
|
||||
- codex-architecture-doc-refresh
|
||||
created_date: '2026-02-22 19:39'
|
||||
updated_date: '2026-02-22 19:44'
|
||||
labels:
|
||||
- docs
|
||||
- architecture
|
||||
dependencies: []
|
||||
priority: low
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
User requested a thorough review of the current codebase and `docs/architecture.md`, then updating document content to reflect current implementation details. Mermaid/flow diagrams are explicitly out of scope for this pass.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Architecture content sections align with current source tree/module ownership.
|
||||
- [x] #2 Service/composer/runtime descriptions are updated for current behavior and module names.
|
||||
- [x] #3 Mermaid/flow chart sections remain unchanged in this pass.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Notes
|
||||
|
||||
- Reviewed current module ownership across `src/main.ts`, `src/main/runtime/*`, `src/core/services/*`, `src/config/*`, `src/renderer/*`, `launcher/*`, and `plugin/subminer.lua`.
|
||||
- Updated `docs/architecture.md` content sections only; Mermaid blocks intentionally left untouched.
|
||||
- Verification: `bun run docs:build` passed.
|
||||
@@ -1,59 +0,0 @@
|
||||
---
|
||||
id: TASK-113
|
||||
title: Scope make pretty to maintained source files
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-03-08 00:20'
|
||||
updated_date: '2026-03-08 00:22'
|
||||
labels:
|
||||
- tooling
|
||||
- formatting
|
||||
dependencies: []
|
||||
references:
|
||||
- Makefile
|
||||
- package.json
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Change the `make pretty` workflow so it formats only the maintained source/config files we intentionally keep under Prettier, instead of sweeping backlog/docs/generated content across the whole repository.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 `make pretty` formats only the approved maintained source/config paths
|
||||
- [x] #2 The allowlist is reusable for check/write flows instead of duplicating path logic
|
||||
- [x] #3 Verification shows the scoped formatting command targets the intended files without touching backlog or vendored content
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Inspect current Prettier config/ignore behavior and keep the broad repo-wide format command unchanged.
|
||||
2. Add a reusable scoped Prettier script that targets maintained source/config paths only.
|
||||
3. Update `make pretty` to call the scoped script.
|
||||
4. Verify the scoped command resolves only intended files and does not traverse backlog or vendor paths.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
User approved the allowlist approach: keep repo-wide `format` intact, make `make pretty` use a maintained-path formatter scope.
|
||||
|
||||
Added `scripts/prettier-scope.sh` as the single allowlist for scoped Prettier paths and wired `format:src` / `format:check:src` to it.
|
||||
|
||||
Updated `make pretty` to call `bun run format:src`. Verified with `make -n pretty` and shell tracing that the helper only targets the maintained allowlist and does not traverse `backlog/` or `vendor/`.
|
||||
|
||||
Excluded `Makefile` and `.prettierignore` from the allowlist after verification showed Prettier cannot infer parsers for them.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Scoped the repo's day-to-day formatting entrypoint without changing the existing broad repo-wide Prettier scripts. Added `scripts/prettier-scope.sh` as the shared allowlist for maintained source/config paths (`.github`, `build`, `launcher`, `scripts`, `src`, plus selected root JSON config files), added `format:src` and `format:check:src` in `package.json`, and updated `make pretty` to run the scoped formatter.
|
||||
|
||||
Verification: `make -n pretty` now resolves to `bun run format:src`. `bash -n scripts/prettier-scope.sh` passed, and shell-traced `bash -x scripts/prettier-scope.sh --check` confirmed the exact allowlist passed to Prettier. `bun run format:check:src` fails only because existing files inside the allowed source scope are not currently formatted; it no longer touches `backlog/` or `vendor/`.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -1,62 +0,0 @@
|
||||
---
|
||||
id: TASK-114
|
||||
title: Fix failing CI checks on PR 15
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-03-08 00:34'
|
||||
updated_date: '2026-03-08 00:37'
|
||||
labels:
|
||||
- ci
|
||||
- test
|
||||
dependencies: []
|
||||
references:
|
||||
- src/renderer/subtitle-render.test.ts
|
||||
- src/renderer/style.css
|
||||
- .github/workflows/ci.yml
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Investigate the failing GitHub Actions CI run for PR #15 on branch `yomitan-fork`, fix the underlying test or code regression, and verify the affected local test/CI lane passes.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Identified the concrete failing CI job and captured the relevant failure context
|
||||
- [x] #2 Implemented the minimal code or test change needed to resolve the CI failure
|
||||
- [x] #3 Verified the affected local test target and the broader fast CI test lane pass
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Inspect the failing GitHub Actions run and confirm the exact failing test/assertion.
|
||||
2. Reproduce the failing renderer stylesheet test locally and compare the assertion against current CSS.
|
||||
3. Apply the minimal test or stylesheet fix needed to restore the intended hover/selection behavior.
|
||||
4. Re-run the targeted renderer test, then re-run `bun run test` to verify the fast CI lane is green.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
GitHub Actions run 22810400921 failed in job build-test-audit, step `Test suite (source)`, with a single failing test: `JLPT CSS rules use underline-only styling in renderer stylesheet` in src/renderer/subtitle-render.test.ts.
|
||||
|
||||
Reproduced the failing test locally with `bun test src/renderer/subtitle-render.test.ts`. The failure was a brittle stylesheet assertion, not a renderer behavior regression.
|
||||
|
||||
Updated the renderer stylesheet test helper to split selectors safely across `:is(...)` commas and normalize multiline selector whitespace, then switched the failing hover/JLPT assertions to inspect extracted rule blocks instead of matching the entire CSS file text.
|
||||
|
||||
Verification passed with `bun test src/renderer/subtitle-render.test.ts` and `bun run test`.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Investigated GitHub Actions CI run `22810400921` for PR #15 and confirmed the only failing job was `build-test-audit`, step `Test suite (source)`, with a single failure in `src/renderer/subtitle-render.test.ts` (`JLPT CSS rules use underline-only styling in renderer stylesheet`).
|
||||
|
||||
The renderer CSS itself was still correct; the regression was in the test helper. `extractClassBlock` was splitting selector lists on every comma, which breaks selectors containing `:is(...)`, and the affected assertions fell back to brittle whole-file regex matching against a multiline selector. Fixed the test by teaching the helper to split selectors only at top-level commas, normalizing selector whitespace around multiline `:not(...)` / `:is(...)` clauses, and asserting on extracted rule blocks for the plain-word hover and JLPT-only hover/selection rules.
|
||||
|
||||
Verification: `bun test src/renderer/subtitle-render.test.ts` passed, and `bun run test` passed end to end (the same fast lane that failed in CI).
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
id: TASK-114
|
||||
title: Refresh development doc content to match current codebase
|
||||
status: Done
|
||||
assignee:
|
||||
- codex-development-docs-review
|
||||
created_date: '2026-02-23 03:46'
|
||||
updated_date: '2026-02-23 03:49'
|
||||
labels:
|
||||
- docs
|
||||
- developer-experience
|
||||
dependencies: []
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
User requested a thorough review of the current codebase and `docs/development.md`, then updates so the page reflects current scripts, architecture, and contributor workflow.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 `docs/development.md` commands/tooling sections match current `package.json`, `Makefile`, and active CI lanes.
|
||||
- [x] #2 Runtime/composition guidance reflects current module ownership and does not reference removed guardrail steps.
|
||||
- [x] #3 Updated doc builds cleanly via `bun run docs:build`.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Notes
|
||||
|
||||
- Reviewed `docs/development.md` against current `package.json` scripts, `Makefile` targets, launcher/runtime env overrides, and `.github/workflows/ci.yml` gate order.
|
||||
- Updated setup instructions to use Bun for `vendor/texthooker-ui` and include submodule initialization.
|
||||
- Added CI-equivalent local test/build/docs command sequence and clarified that subtitle dist tests are currently placeholders.
|
||||
- Expanded environment-variable coverage (`SUBMINER_ROFI_THEME`, Jimaku/Jellyfin overrides, `SUBMINER_LOG_LEVEL`, `SUBMINER_MPV_LOG`, macOS helper skip flag).
|
||||
- Verification: `bun run docs:build` passed.
|
||||
@@ -0,0 +1,61 @@
|
||||
---
|
||||
id: TASK-115
|
||||
title: Migrate repository workflows to Bun-only JavaScript runtime
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-23 04:26'
|
||||
updated_date: '2026-02-23 04:42'
|
||||
labels:
|
||||
- tooling
|
||||
- build
|
||||
- ci
|
||||
dependencies: []
|
||||
references:
|
||||
- package.json
|
||||
- .github/workflows/ci.yml
|
||||
- .github/workflows/release.yml
|
||||
- docs/development.md
|
||||
- docs/installation.md
|
||||
- README.md
|
||||
documentation:
|
||||
- docs/plans/2026-02-23-bun-only-toolchain-migration.md
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Transition the project from mixed Bun/Node tooling to a Bun-only contributor and CI workflow so setup is simpler and runtime behavior is consistent across local and automation lanes.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 A contributor can install dependencies, build, run source tests, run dist smoke tests, and build docs using Bun without requiring a system Node.js install.
|
||||
- [x] #2 CI and release workflows no longer require Node setup steps for standard project verification and packaging jobs.
|
||||
- [x] #3 Dist and utility verification lanes remain covered and pass with Bun-based commands.
|
||||
- [x] #4 Repository documentation clearly states the Bun-only prerequisite and removes conflicting Node requirement guidance.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Execution started in-session after user selected Subagent-Driven option. Tracking sequence: TASK-115.2 -> TASK-115.3/TASK-115.4 -> TASK-115.1.
|
||||
|
||||
Completed child sequence TASK-115.2 -> TASK-115.3/TASK-115.4 -> TASK-115.1 with Bun-only command/workflow migration.
|
||||
|
||||
Direct Node command usage removed from package dist and utility script lanes; CI/release Node setup steps removed; contributor docs aligned to Bun-only prerequisites.
|
||||
|
||||
Regression hardening: refactored AniList token-store tests and storage seam to remain stable under Bun dist test execution while preserving runtime behavior.
|
||||
|
||||
Post-migration docs polish: updated `README.md` requirements table to list Bun as a required dependency and promoted Bun from optional-tools section into system dependencies in `docs/installation.md` to remove ambiguity.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Migrated repository verification and workflow surfaces to Bun-first execution by replacing `node --test` dist lanes and remaining direct Node utility invocation (`generate:config-example`) with Bun commands.
|
||||
|
||||
Removed `actions/setup-node` from CI and release jobs and aligned docs (`docs/development.md`, `docs/installation.md`) to Bun-only setup guidance; launcher smoke fixtures now use Bun shebangs so smoke tests no longer depend on Node.
|
||||
|
||||
Validated full gate set under Bun-only command path: launcher smoke, fast source suite, build, dist config/core/smoke suites, docs build, plus config-example generation command.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -1,59 +0,0 @@
|
||||
---
|
||||
id: TASK-115
|
||||
title: Refresh subminer-docs contributor docs for current repo workflow
|
||||
status: Done
|
||||
assignee:
|
||||
- codex
|
||||
created_date: '2026-03-08 00:40'
|
||||
updated_date: '2026-03-08 00:42'
|
||||
labels:
|
||||
- docs
|
||||
dependencies: []
|
||||
references:
|
||||
- ../subminer-docs/development.md
|
||||
- ../subminer-docs/README.md
|
||||
- Makefile
|
||||
- package.json
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Update the sibling `subminer-docs` repo so contributor/development docs match the current SubMiner repo workflow after the docs split and recent tooling changes, including removing stale in-repo docs build steps and documenting the scoped formatting command.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Contributor docs in `subminer-docs` no longer reference stale in-repo docs build commands for the app repo
|
||||
- [x] #2 Contributor docs mention the current scoped formatting workflow (`make pretty` / `format:src`) where relevant
|
||||
- [x] #3 Removed stale or no-longer-needed instructions that no longer match the current repo layout
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Plan
|
||||
|
||||
<!-- SECTION:PLAN:BEGIN -->
|
||||
1. Inspect `subminer-docs` for contributor/development instructions that drifted after the docs repo split and recent tooling changes.
|
||||
2. Update contributor docs to remove stale app-repo docs commands and document the current scoped formatting workflow.
|
||||
3. Verify the modified docs page and build the docs site from the sibling docs repo when local dependencies are available.
|
||||
<!-- SECTION:PLAN:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Detected concrete doc drift in `subminer-docs/development.md`: stale in-repo docs build commands and no mention of the scoped `make pretty` formatter.
|
||||
|
||||
Updated `../subminer-docs/development.md` to remove stale app-repo docs build steps from the local gate, document `make pretty` / `format:check:src`, and point docs-site work to the sibling docs repo explicitly.
|
||||
|
||||
Installed docs repo dependencies locally with `bun install` and verified the docs site with `bun run docs:build` in `../subminer-docs`.
|
||||
|
||||
Did not change `../subminer-docs/README.md`; it was already accurate for the docs repo itself.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
|
||||
## Final Summary
|
||||
|
||||
<!-- SECTION:FINAL_SUMMARY:BEGIN -->
|
||||
Refreshed the contributor/development docs in the sibling `subminer-docs` repo to match the current SubMiner workflow. In `development.md`, removed the stale app-repo `bun run docs:build` step from the local CI-equivalent gate, added an explicit note to run docs builds from `../subminer-docs` when docs change, documented the scoped formatting workflow (`make pretty` and `bun run format:check:src`), and replaced the old in-repo `make docs*` instructions with the correct sibling-repo `bun run docs:*` commands. Also updated the Makefile reference to include `make pretty` and removed the obsolete `make docs-dev` entry.
|
||||
|
||||
Verification: installed docs repo dependencies with `bun install` in `../subminer-docs` and ran `bun run docs:build` successfully. Left `README.md` unchanged because it was already accurate for the standalone docs repo.
|
||||
<!-- SECTION:FINAL_SUMMARY:END -->
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
id: TASK-115.1
|
||||
title: Remove Node setup from workflows and finalize Bun-only docs
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-23 04:26'
|
||||
updated_date: '2026-02-23 04:36'
|
||||
labels:
|
||||
- ci
|
||||
- docs
|
||||
- tooling
|
||||
dependencies:
|
||||
- TASK-115.2
|
||||
- TASK-115.3
|
||||
- TASK-115.4
|
||||
references:
|
||||
- .github/workflows/ci.yml
|
||||
- .github/workflows/release.yml
|
||||
- docs/development.md
|
||||
- docs/installation.md
|
||||
- README.md
|
||||
documentation:
|
||||
- docs/plans/2026-02-23-bun-only-toolchain-migration.md
|
||||
parent_task_id: TASK-115
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
After script/test migration parity is verified, remove Node setup from CI/release workflows and finalize documentation so contributors and automation use a consistent Bun-only prerequisite.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 CI and release workflows no longer include Node setup steps for routine build/test/package jobs.
|
||||
- [x] #2 Primary local verification gates pass with the Bun-only command set.
|
||||
- [x] #3 README and setup/install docs consistently describe Bun as the JS runtime prerequisite without conflicting Node requirement text.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Removed `actions/setup-node` from `.github/workflows/ci.yml` and `.github/workflows/release.yml` (quality-gate, build-linux, build-macos jobs).
|
||||
|
||||
Updated docs to align Bun-only prerequisite: removed Node from `docs/development.md` prerequisites and switched stale pnpm source-build snippet in `docs/installation.md` to Bun.
|
||||
|
||||
Validation gates: `bun run test:launcher:smoke:src && bun run test:fast && bun run build && bun run test:config:dist && bun run test:core:dist && bun run test:smoke:dist && bun run docs:build` all pass.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
id: TASK-115.2
|
||||
title: Map Node touchpoints and define Bun parity matrix
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-23 04:27'
|
||||
updated_date: '2026-02-23 04:36'
|
||||
labels:
|
||||
- tooling
|
||||
- planning
|
||||
dependencies: []
|
||||
references:
|
||||
- package.json
|
||||
- .github/workflows/ci.yml
|
||||
- .github/workflows/release.yml
|
||||
documentation:
|
||||
- docs/plans/2026-02-23-bun-only-toolchain-migration.md
|
||||
parent_task_id: TASK-115
|
||||
priority: medium
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Document all Node-specific command and workflow touchpoints, define Bun replacements, and establish migration guardrails so follow-up implementation tasks have clear scope and risk controls.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 A complete inventory of Node-dependent scripts and workflow steps is documented with proposed Bun equivalents.
|
||||
- [x] #2 Migration risks and compatibility checkpoints are explicitly documented for dist and Electron-related lanes.
|
||||
- [x] #3 Follow-up implementation tasks have clear boundaries and ordering based on the parity matrix.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Created `docs/plans/bun-only-parity-matrix.md` with direct Node touchpoint inventory, Bun replacements, risk checkpoints, and migration sequencing.
|
||||
|
||||
Parity matrix now links implementation ordering for TASK-115.3/115.4/115.1 and flags follow-up risk handling for third-party implicit Node assumptions.
|
||||
<!-- SECTION:NOTES:END -->
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
id: TASK-115.3
|
||||
title: Migrate dist test lanes from Node runner to Bun
|
||||
status: Done
|
||||
assignee: []
|
||||
created_date: '2026-02-23 04:27'
|
||||
updated_date: '2026-02-23 04:36'
|
||||
labels:
|
||||
- test
|
||||
- tooling
|
||||
dependencies:
|
||||
- TASK-115.2
|
||||
references:
|
||||
- package.json
|
||||
- docs/development.md
|
||||
- docs/installation.md
|
||||
documentation:
|
||||
- docs/plans/2026-02-23-bun-only-toolchain-migration.md
|
||||
parent_task_id: TASK-115
|
||||
priority: high
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<!-- SECTION:DESCRIPTION:BEGIN -->
|
||||
Replace Node-runner dist test commands with Bun-based dist verification while preserving existing test scope and confidence in compiled artifact behavior.
|
||||
<!-- SECTION:DESCRIPTION:END -->
|
||||
|
||||
## Acceptance Criteria
|
||||
<!-- AC:BEGIN -->
|
||||
- [x] #1 Dist test scripts execute via Bun instead of node --test while preserving the current dist test file coverage.
|
||||
- [x] #2 Dist smoke and full dist verification lanes pass under Bun-based commands.
|
||||
- [x] #3 Documentation for dist verification commands reflects the updated Bun-based workflow.
|
||||
<!-- AC:END -->
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
<!-- SECTION:NOTES:BEGIN -->
|
||||
Updated `package.json` dist lanes from `node --test` to `bun test` (`test:config:dist`, `test:config:smoke:dist`, `test:core:dist`, `test:core:smoke:dist`).
|
||||
|
||||
Resolved Bun dist compatibility gap by injecting `SafeStorageLike` into AniList token store and replacing brittle Electron global monkey-patching in `anilist-token-store` tests.
|
||||
|
||||
Validation: `bun run build && bun run test:config:dist && bun run test:core:dist && bun run test:smoke:dist` all pass.
|
||||
<!-- SECTION:NOTES:END -->
|
||||