fix: address coderabbit review findings

This commit is contained in:
2026-03-15 14:26:30 -07:00
parent 5c31be99b5
commit 87bf3cef0c
18 changed files with 330 additions and 65 deletions

View File

@@ -9,7 +9,7 @@ Minimize the time between a subtitle line appearing and annotations being displa
## Current Pipeline (Warm State)
```
```text
MPV subtitle change (0ms)
-> IPC to main (5ms)
-> Cache check (2ms)
@@ -25,7 +25,7 @@ MPV subtitle change (0ms)
## Target Pipeline
```
```text
MPV subtitle change (0ms)
-> IPC to main (5ms)
-> Cache check (2ms)
@@ -142,7 +142,7 @@ Collapse the 4 sequential annotation passes (`applyKnownWordMarking` -> `applyFr
### Current Flow (4 passes, 4 array copies)
```
```text
tokens (already have frequencyRank values from parser-level applyFrequencyRanks)
-> applyKnownWordMarking() // .map() -> new array
-> applyFrequencyMarking() // .map() -> new array (POS-based filtering only)

View File

@@ -17,6 +17,7 @@
## File Structure
### New Files
| File | Responsibility |
|------|---------------|
| `src/core/services/subtitle-cue-parser.ts` | Parse SRT/VTT/ASS files into `SubtitleCue[]` (timing + text) |
@@ -25,6 +26,7 @@
| `src/core/services/subtitle-prefetch.test.ts` | Tests for prefetch service |
### Modified Files
| File | Change |
|------|--------|
| `src/core/services/subtitle-processing-controller.ts` | Add `preCacheTokenization` + `isCacheFull` to public interface |
@@ -34,6 +36,7 @@
| `src/renderer/subtitle-render.ts` | `cloneNode` template + `replaceChildren()` |
| `src/main.ts` | Wire up prefetch service |
---
## Chunk 1: Batched Annotation Pass + DOM Template Pooling
@@ -1554,17 +1557,32 @@ subtitle processing, and restarts on cache invalidation."
### Task 10: Full test suite and type check
- [ ] **Step 1: Run full test suite**
- [ ] **Step 1: Run handoff type check**
Run: `bun run test`
Expected: 500+ pass, 1 pre-existing fail in immersion-tracker-service.
- [ ] **Step 2: Run TypeScript type check**
Run: `bun run tsc`
Run: `bun run typecheck`
Expected: No type errors.
- [ ] **Step 3: Review all commits on the branch**
- [ ] **Step 2: Run fast test lane**
Run: `bun run test:fast`
Expected: Fast unit/integration tests pass.
- [ ] **Step 3: Run environment-sensitive test lane**
Run: `bun run test:env`
Expected: Environment/runtime-sensitive tests pass.
- [ ] **Step 4: Run production build**
Run: `bun run build`
Expected: Production build succeeds.
- [ ] **Step 5: Run dist smoke test**
Run: `bun run test:smoke:dist`
Expected: Dist smoke tests pass.
- [ ] **Step 6: Review all commits on the branch**
Run: `git log --oneline main..HEAD`
Expected: ~8 focused commits, one per logical change.