Commit graph

18 commits

Author SHA1 Message Date
wujunchen
174fa7295d feat: expose streaming timeout setting
Change-Id: Ide69c0f0fe208a557024f9f77d83c9d1215391cf
2026-04-26 18:14:43 +08:00
wujunchen
9098de6884 feat: validate batch folder input
Change-Id: I137fa046e77781e063ee782af4321b7277d64d51
2026-04-26 18:12:38 +08:00
wujunchen
d8dc82362b feat: support cancellable batch generation
Change-Id: I89302f58995e4e15fbf77c20c87a94832e572d20
2026-04-26 18:10:17 +08:00
wujunchen
ebc882c2f1 refactor: encapsulate cache rename
Change-Id: I89ee56c071c8e5404f8eb9ea744172957811d714
2026-04-26 18:05:38 +08:00
wujunchen
fe05ed1a2d test: cover generation orchestration
Change-Id: Iff416f01c0f09111e67e1ad67957b85fdb19623a
2026-04-26 17:59:35 +08:00
wujunchen
2d4bef9539 refactor: extract batch generation helpers
Change-Id: I16ad657b783b65cc5b3e36a6ea163cc19740b651
2026-04-26 17:54:35 +08:00
Claude
a74e7c3e07
test: add tests for i18n, streaming, and cli modules
Extend tests/modules.test.js with:
- parseSseBuffer: partial buffer, multi-event chunk, skipped non-data lines,
  malformed JSON line handling
- i18n: multi-variable interpolation, zh translation, missing-key fallback
- cli: resolveCliPath with override path trimming and mocked fs.existsSync
  to verify filesystem search and bare-name fallback

https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
2026-04-26 06:15:30 +00:00
Claude
dbb8ea4a5b
refactor: make cache entry updates immutable
touchCacheEntry() now returns a new object via spread instead of mutating
the entry in-place. CacheManager.replaceCards() likewise creates a new entry
object instead of mutating existing fields. Update tests to assert the new
immutable semantics (returned value differs from input by reference).

https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
2026-04-26 06:12:55 +00:00
wujunchen
b7d1a25543 security: strip path traversal segments from vault paths
Reject '..' and '.' segments in normalizeVaultPath to prevent
exportFolder from escaping the vault root directory.

Change-Id: Ib4da19f9d0aa1236a3b77b6f2cc722fcff408131
2026-04-26 09:48:19 +08:00
wujunchen
447ad1414b feat: add streaming API responses for OpenAI Chat and Anthropic
Implement SSE streaming for API backends that support it (OpenAI Chat
Completions and Anthropic Messages). During generation the view shows
a live streaming preview with accumulated text. Adds a streaming toggle
in settings (enabled by default). Non-streaming-capable formats (Gemini,
OpenAI Responses) and CLI backends continue using the existing path.

Change-Id: I3361a5ca5aec3e25a7d16e4fb585185f6fc0695e
2026-04-26 09:30:51 +08:00
wujunchen
3b02cfa480 test: add comprehensive unit tests for pure modules
Cover anchor, schema, cache, cards, navigation, markdown, vault, i18n,
scroll, settings, prompt, providers, and generation-job-manager modules
with focused assertions testing edge cases and expected behavior.

Change-Id: I49e1f104e04a3dbafe66c19adf24ac5d0e3a7c54
2026-04-26 09:25:23 +08:00
wujunchen
532cd31ef4 refactor: extract View, Modal, and SettingsTab from main.ts
Move ParallelReaderView to src/view.ts (341 lines),
CardEditModal to src/modal.ts (56 lines),
ParallelReaderSettingTab to src/settings-tab.ts (370 lines).
Add PluginHost interface in types.ts to break circular deps.
main.ts reduced from 1613 to 588 lines.

Change-Id: I90902e914f162ff92b9a7f7c190b4d397a2c8c12
2026-04-25 23:40:56 +08:00
wujunchen
d8880d41b2 refactor: split UI helpers module
Change-Id: I1abcd20b75608261b2d004550c011eeba76d35bf
2026-04-25 21:32:32 +08:00
wujunchen
5f6f18677b refactor: split CLI backend module
Change-Id: I7450dface429972b71b173973e6f71393d83303e
2026-04-25 19:58:29 +08:00
wujunchen
206a50f8d0 fix: guard regeneration and scroll sync
Change-Id: I08e2c55d5e88a51bad9a007e57962ebe48dc7c64
2026-04-25 19:52:27 +08:00
wujunchen
5c2c97fdbe feat: improve reader cache and card UX
Change-Id: Ie1b5c5ba1a6538b701af2591effd1845dca2f670
2026-04-25 19:44:39 +08:00
wujunchen
08f510c65c refactor: split prompt and add localized UI
Move prompt and anchor matching into dedicated modules, add Chinese/English UI translation support, and cover cache fingerprint and translation behavior with tests.

Change-Id: Ieadc2197cba31cf750b83e2893909127da8ecca5
2026-04-25 15:15:26 +08:00
wujunchen
1fada9f472 feat: add TypeScript build and provider architecture
Introduce an esbuild/TypeScript source layout while keeping the generated Obsidian main.js entrypoint. Add provider-format adapters, structured-output requests, settings-aware bounded cache, prompt controls, concurrency guards, and regression tests.

Change-Id: I8ecbc4c6eff3925249778732bd75747619b818e4
2026-04-25 14:12:17 +08:00