Commit graph

15 commits

Author SHA1 Message Date
wujunchen
a49e5cd2ec chore: upgrade biome noExplicitAny from off to warn
Enable noExplicitAny as a warning so remaining any usages are visible
in lint output. 20 warnings exist in API response handlers and Obsidian
internal type access — these are intentional and documented.

Change-Id: I96c190e594bc3391256f77a59e155f23436d3db3
2026-04-26 08:59:40 +08:00
wujunchen
31e57c8b19 refactor: enable noImplicitAny and add type annotations
Turn on noImplicitAny in tsconfig.json. Add explicit type annotations
to all 137 previously untyped parameters across main.ts, view.ts,
modal.ts, settings-tab.ts, providers.ts, cli.ts, anchor.ts, scroll.ts,
ui-helpers.ts, vault.ts, and settings.ts.

Change-Id: Icc5a69ab57113e9f6dc08dd97e3a8fa5e7e24937
2026-04-26 08:58:41 +08:00
wujunchen
89139c37dc refactor: replace PluginHost any types with Obsidian App/TFile
Use App, TFile, PluginManifest from obsidian in PluginHost interface.
Remove `as any` cast in ParallelReaderSettingTab by accepting
Plugin & PluginHost intersection type. Add typed params to vault.ts
and modal.ts constructors.

Change-Id: I94487d2654fd829c69364dabe9fbd5dc009097b6
2026-04-26 08:48:23 +08:00
wujunchen
22f0781334 chore: add .editorconfig for consistent formatting
Change-Id: I087941201d8ce1b801b4663c4897f005f275ed5a
2026-04-25 23:48:27 +08:00
wujunchen
83f35f8ccb feat: add Biome for lint and format
Install @biomejs/biome with lint and format config.
Add npm lint/lint:fix scripts. Auto-fix formatting across all source
files. Update tsconfig lib to ES2022 for Object.hasOwn support.

Change-Id: I13e3ba2f106f7e3d03349080b7ed515d427d24a1
2026-04-25 23:47:49 +08:00
wujunchen
3a776691e6 refactor: enable strictNullChecks and strictFunctionTypes
Turn on strictNullChecks, strictFunctionTypes, strictBindCallApply,
and noImplicitThis in tsconfig.json. Fix 13 resulting type errors
across main.ts, anchor.ts, providers.ts, schema.ts, prompt.ts.

Change-Id: Ib747b9c0cb809d99a7b3d3d7b177ee5918a74dfd
2026-04-25 23:44:28 +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
f3afc4fbe0 refactor: add TypeScript interfaces for core types
Create src/types.ts with RawCard, ResolvedCard, CardPatch, CacheEntry,
PluginSettings, ApiProviderPreset, ApiFormat, GenerationPhase, ErrorKind,
and PromptPair. Update all source modules to use typed signatures,
replacing `any` with concrete interfaces.

Change-Id: I87b7dd6f3a240c95597d7a796b4d1885386aa632
2026-04-25 23:34:45 +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
wujunchen
ff856f719b init: Obsidian Parallel Reader v0.1.0
Split-view reading plugin for long-form notes:
- LLM self-adaptive segmentation (no heading dependency)
- Anchor-based line resolution with fallbacks
- Scroll-sync highlight + click-to-jump
- Right-click context menu for copy actions
- MarkdownRenderer for native table/bold/code rendering
- SHA-1 content-hash cache with stale-detection banner
- Three backends: Claude Code CLI / Codex CLI / Anthropic API

Change-Id: I105c57e3df0b2d8d1570c31e3e3a689ecf52ff71
2026-04-24 19:31:23 +08:00