feat(library): rating line, manga finish-flip notify, game links, dedupe

- render **Rating:** line in manga/book/game/comic body (after read/play
  status, gated on rating != '0' + stars non-empty), matching watchlist's
  render.ts convention
- manga finish-flip now notifies user (final chapters out), matching
  chapter-flip's existing notify path
- game renderGame emits ## Links (Steam by appid, RAWG by url) — fixes
  latent owned-heading strip where user-added Links sections silently
  vanished since games never re-rendered the heading
- move duplicated deriveReadStatus/deriveRating/parseNumOrNull into
  library/convert.ts, import across specs; zero behavior change
This commit is contained in:
afiqzudinhadi 2026-08-03 16:29:02 +08:00
parent d2a6940270
commit c14da19c47
13 changed files with 140 additions and 83 deletions

View file

@ -171,6 +171,15 @@ describe('renderComic golden', () => {
expect(out).toContain('## My Notes\n\nlove this reboot');
});
test('rating line present when rating set', () => {
expect(renderComic(RECORD, '')).toContain('**Rating:** ⭐️⭐️⭐️⭐️ (4/5)');
});
test('rating 0 -> Rating line absent', () => {
const r = { ...RECORD, rating: '0', ratingStars: '' };
expect(renderComic(r, '')).not.toContain('**Rating:**');
});
test('no last_read_issue -> Progress line omitted', () => {
const r = { ...RECORD, lastReadIssue: '' };
expect(renderComic(r, '')).not.toContain('**Progress:**');