- First-install Welcome Modal with i18n across all 22 locales
- Sponsor support: Give a Star on GitHub + Buy Me a Coffee (ko-fi)
- Cline-aligned output token resolution for unknown models
- Diagram edge field normalization for LLM JSON output compatibility
- Hard constraints documented for MermaidProcessor decomposition and legacy prompt retirement
- notebook-navigator cross-reference analysis with 5 improvement angles identified
### New Features
- **Welcome Modal**: Shown on first install with plugin capabilities overview, LLM setup hint, closing poetic message, and sponsor buttons. Fully i18n-backed (22 locales).
- **Sponsor Support**: Settings tab sponsor section with GitHub Star + ko-fi Coffee buttons. manifest.json fundingUrl for native Obsidian community browser display.
### Fixes
- **Cline-aligned token resolution**: Unknown models with default maxTokens now defer to the API provider instead of being capped at 8192.
- **Diagram edge normalization**: LLM outputs using `source`/`target` edge fields are now normalized to `from`/`to`, fixing validation failures with real API responses.
### Chores
- Hard constraints codified for MermaidProcessor decomposition: each sub-task requires real Obsidian verification with saved image validation.
- Legacy prompt retirement gated: original scenario usability must be fully preserved.
- notebook-navigator design reference analysis added to audit docs and roadmap.
***Model-Aware Output Token Caps**: Added Cline-aligned known-model max-output-token metadata and now resolve the effective output cap from the actual selected model instead of hardcoded provider defaults. When the global max-token setting is still at the stock default, supported models automatically use their true known ceiling; when users set a custom global or provider-specific cap, requests are clamped to the model’s known maximum. This now applies across OpenAI-compatible providers plus Anthropic, Google, Azure OpenAI, and Ollama runtimes.
***Developer-Mode Diagnostics Panel**: Added a dedicated Settings developer panel gated by a new Developer mode switch, so normal users do not see developer-only controls.
***Selectable Diagnostic Call Modes + Stability Runs**: Developer diagnostics can now run with selectable call modes (including OpenAI-compatible forced transport modes) and can execute repeated stability runs with aggregated reporting.
***OpenAI-Compatible Non-Stream Stage In Stable Mode**: After a primary direct streaming failure, stable-mode OpenAI-compatible calls now attempt direct non-stream transport before falling back to `requestUrl`. This captures providers that return valid buffered responses but are unstable on streaming sockets.
***Protocol-Aware Streaming Fallback Across All LLM Paths**: Extended long-request fallback parsing beyond OpenAI-compatible providers so Anthropic Messages, Google Gemini, Azure OpenAI, and Ollama now also use protocol-aware streamed fallback handling on desktop `http/https` and non-desktop `fetch`. Legacy exported OpenAI-style provider wrappers now delegate to the same shared streamed fallback path instead of keeping buffered-only logic.
***Cross-Transport Partial Stream Debugging**: Shared debug output now preserves parsed partial stream text for Anthropic, Google/Azure-style SSE flows, and Ollama NDJSON fallbacks, not just OpenAI-compatible calls.
***Stable-Mode Primary Transport Preference (OpenAI-Compatible)**: In stable mode, OpenAI-compatible runtime calls now prefer direct desktop/web streaming transport as the primary long-request path before trying `requestUrl`. This reduces false-fail chains where `requestUrl` disconnects even though upstream providers eventually return successful non-stream responses.
***Regression Coverage**: Added focused runtime tests for Anthropic, Google, Azure OpenAI, Ollama, and the remaining direct OpenAI-style provider wrappers on streamed fallback success and interruption scenarios.
***Real Endpoint Diagnostic CLI**: Added `scripts/diagnose-llm-provider.js` (and `npm run diagnose:llm`) to run reproducible buffered/streaming long-request diagnostics against real provider endpoints with sanitized per-attempt timing, headers, partial bodies, and parsed stream fragments.
***Settings Developer Diagnostic Button**: Added `Developer provider diagnostic (long request)` in settings to run an in-plugin runtime probe for the active provider and persist a full report (`Notemd_Provider_Diagnostic_*.txt`) in vault root.
***Diagnostic Runtime Helper + Tests**: Added `src/providerDiagnostics.ts` and trigger-chain coverage in `src/tests/providerDiagnostics.test.ts` to lock report generation behavior for both success and provider-failure debug paths.
***Docs and Agent Guide Alignment**: Updated both READMEs and `AGENTS.md` so in-plugin diagnostics and CLI diagnostics are documented and required to stay semantically aligned.
***Complete Supported UI Locale Coverage**: Finished localizing the remaining visible settings, workflow builder, sidebar tooltip, extracted-text settings, advanced settings, and output-path surfaces for every advertised UI locale.
***Stricter Regression Coverage**: Added focused tests so supported locales no longer silently fall back to English on those visible UI surfaces.
***Documentation Reality Check**: Updated the root READMEs and Language Hub to distinguish maintainer source docs, published README translations, and the exact in-app UI locale catalog.
***Version Alignment**: Synchronized release metadata and packaged documentation for `1.8.1`.
***Policy Unification Across Task Paths**: Consolidated task-language decisions in one policy layer and wired it into prompt, processing, research, and translation flows.
***Regression Harness**: Added reproducible baseline/compare scripts and preserved phase evidence for before/after robustness checks.
***Build Stability with Reference Repo**: Excluded `ref/**` from TypeScript/Jest/ESLint scopes so reference projects can coexist without breaking plugin build/test gates.
***Single-File CTA Visual Mapping**: Sidebar colorful CTA styling is now strictly mapped to single-file actions. Batch/folder-level actions no longer use CTA color treatment, reducing scope confusion and accidental batch triggers.
***Workflow CTA Rule Alignment**: Custom workflow buttons now inherit CTA styling only when every step is single-file. Mixed workflows that include batch steps are rendered as non-CTA to keep visual semantics consistent.
***Regression Coverage**: Added a sidebar DOM test to lock CTA mapping behavior for single-file actions vs batch/folder actions and default mixed workflow buttons.
***Sidebar Interaction Polish**: Refined sidebar button interactions with clearer hover, pressed, and focus-visible states so action feedback is obvious during rapid workflows.
***CTA Readability Fix**: Improved text contrast on colorful CTA buttons (including `One-Click Extract` and `Batch generate from titles`) to avoid low-contrast white-on-light combinations across different Obsidian themes.
***Docked Footer Visibility Tuning**: Increased persistent footer sizing constraints and log minimum height so progress + log telemetry stays visible when multiple panels are expanded.
***OpenAI-Compatible Streaming Fallback**: Long-running OpenAI-compatible task calls now upgrade their desktop `http/https` and non-desktop `fetch` fallback attempts to streaming response parsing after an initial transient `requestUrl` disconnect. This helps slow gateways and reverse proxies return body chunks earlier instead of failing the whole request while waiting for one large buffered response.
***Parsed Partial Stream Debugging**: Shared deep-debug output now records both raw partial bodies and parsed partial stream text when a streamed fallback attempt is interrupted. This gives developers enough evidence to distinguish between transport resets and upstream provider-side error payloads.
***Regression Coverage**: Added focused tests for desktop and web streaming fallback assembly, plus interrupted streaming fallback diagnostics.
***Cross-Provider Deep Debugging**: The shared LLM transport/error path now records per-attempt debug metadata for every provider, including transport name, sanitized request URL and headers, elapsed duration, response headers, partial response bodies, and stack traces. This makes slow upstream gateway resets and proxy disconnects visible without relying on provider-specific logging.
***Connection Test Debug Consistency**: Provider connection probes now use the same instrumented request path as runtime calls, so debug mode exposes the same transport-level evidence during "Test Connection" failures.
***Non-Desktop Runtime Fallback**: When desktop Node transport is unavailable, transient `requestUrl` disconnects now retry the same attempt through browser `fetch`, extending runtime resilience and provider connection testing to mobile/non-desktop environments.
***Chinese Preset Refresh**: Synced selected China-focused preset defaults with current `cline` model baselines, including `Qwen` -> `qwen3-235b-a22b`, `Moonshot` -> `kimi-k2-0905-preview`, and `MiniMax` -> `MiniMax-M2.7`.
***Regression Coverage**: Added focused tests for shared debug metadata rendering and interrupted desktop fallback responses with partial-body capture.
***Runtime Transport Robustness**: Long-running LLM task calls now switch from Obsidian `requestUrl` to desktop `http/https` transport after transient disconnects such as `ERR_CONNECTION_CLOSED`, then continue into the existing stable retry sequence only if the fallback also fails. This hardens slow translation and generation jobs against proxy or gateway drops.
***China Provider Expansion Round 2**: Added first-class presets for `Qwen Code`, `Z AI`, and `Huawei Cloud MaaS`, with routing coverage, connection-test coverage, and synchronized English/Chinese provider documentation.
***Sidebar Footer Stability**: Refined the sidebar footer into a docked status/log area with a clearer standby progress state so the log panel remains visible and the ready-state progress area is readable even when every section is expanded.
***Regression Coverage**: Added focused runtime fallback tests for every active transport path plus sidebar DOM tests for the docked footer and standby progress state.
***Provider Connection Test Robustness**: Connection tests now fall back to the stable retry sequence after the first transient network disconnect instead of failing immediately, aligning the "Test Connection" button with the runtime resilience already used by task execution.
***Full Transport Coverage**: The transient-failure fallback now covers every transport used by built-in provider presets, including OpenAI-compatible providers, Anthropic, Google, Azure OpenAI, and Ollama.
***Regression Coverage**: Added focused provider-support tests for both runtime API calls and connection-test probes so transient disconnect handling stays locked in across transports.
***Documentation**: Updated the English and Chinese READMEs plus version metadata to document the new provider-connection retry behavior for `1.7.5`.
***Sidebar Layout Stability**: Reworked the sidebar into a scrollable action area plus a persistent footer so the progress card and log output remain visible even when all action groups are expanded.
***Clearer Progress Feedback**: Moved the percentage text into a dedicated status pill, kept the progress bar visible in the ready state, and improved visual contrast for the sidebar progress area.
***Regression Coverage**: Added focused sidebar DOM tests to lock in the persistent footer layout and the new progress summary behavior.
***Documentation**: Updated the English and Chinese READMEs to reflect the pinned sidebar telemetry layout.
***Search Engine Support**: Resolved issues with DuckDuckGo search by implementing a robust, modular architecture. The new `DuckDuckGoProvider` now uses DOMParser for reliable HTML parsing with a regex fallback, ensuring consistent search results even if the layout changes.
***Modular Architecture**: Refactored the search logic into a modular `SearchProvider` system, making it easier to add new search engines and maintain existing ones.
***Code Quality**: Integrated comprehensive unit tests for search providers to prevent regression.
***API Error Debugging**: Fixed an issue where the "API Error Debugging Mode" would not show the full error response body for certain providers (like LMStudio 429 errors). Now, detailed JSON responses and status codes are correctly captured and logged when this mode is enabled, aiding significantly in troubleshooting connectivity and rate-limit issues.
***Enhanced Debugging**: The "API Error Debugging Mode" now fully supports "Translate", "Search", and "Connection Test" tasks, providing detailed logs (HTTP status codes, raw responses) for deeper troubleshooting.
***Fix Mermaid Table Corruption**: Resolved a critical issue where the "Batch Mermaid Fix" and "Deep Debug" features would incorrectly apply syntax fixes to Markdown tables (e.g., changing `| : --- |` to `| : -- "- |`), ensuring that modifications are strictly limited to code blocks within ```mermaid``` tags.
***Modularized API Error Handling**: Refactored `llmUtils.ts` to introduce a centralized `handleProviderError` function. This function supports both concise error reporting (default) and verbose, "DeepSeek-style" debugging logs (status codes, raw responses), ensuring consistent error handling across all 10+ supported LLM providers.
***Automatic Error Logging**: Implemented a `saveErrorLog` utility in `fileUtils.ts`. This function captures the error message, stack trace, and the full session log from the reporter, saving it to a timestamped file (e.g., `Notemd_Error_Log_2023-10-27_10-00-00.txt`) in the vault root whenever a process fails. It also intelligently prompts users to enable debug mode if it's currently disabled.
***API Error Debugging Mode**: Added a new setting in the "Stable API calls" section.
***Enabled**: Activates detailed logging for all API calls, including HTTP status codes and raw response text, aiding in troubleshooting connection issues.
***Disabled**: Maintains the standard, clean user experience with concise error messages.
***Automatic Log File Generation**:
* When an error occurs during any major operation (processing files, generating content, research, etc.), a detailed log file is now automatically created in the vault root.
* This file includes the error context and session history, making it easier for users to report bugs and for developers to diagnose issues.
***Note Conversion**: Added functionality to automatically convert `note right/left of` comments in Mermaid graphs to edge labels, ensuring better rendering and adherence to standard graph syntax.
***Malformed Arrow Fix**: Implemented deep debugging logic to correct malformed arrow labels where the arrow syntax is incorrectly embedded within quotes (e.g., `-->"` becomes `" -->`), ensuring valid Mermaid syntax.
***Merge Double Labels**: Introduced a fix for conflicting double edge labels (e.g., `-- "A" -->|"B"|`), merging them into a single descriptive label (`-- "A<br>(B)" -->`) to resolve rendering ambiguities.
***Robust Regex for Mermaid**: Implemented a sophisticated regex pattern in `mermaidProcessor.ts` to correctly identify and quote complex node labels without breaking existing valid syntax.
***Documentation Synchronization**: Fully synchronized `README.md` and `README_zh.md` to ensure all new features (Extract Text, Mermaid Fixes) are documented in both languages.
***Improved Progress Bar Logic**: Enhanced the logic for progress bar updates to ensure it accurately reflects the completion status of operations, preventing it from getting stuck at intermediate percentages.
***Accurate UI Feedback for Wiki-Link Command**: The "Create Wiki-Link & Generate Note from Selection" command now provides accurate progress updates, reaching 100% completion and automatically closing the progress modal upon successful execution.
***Refined Concurrent Processing**: Implemented a staggered launch mechanism in the `createConcurrentProcessor` utility. This ensures that API calls within a parallel batch are spaced out by the configured `apiCallIntervalMs`, preventing request bursts and resolving potential 429 rate-limit errors from LLM providers.
***Modularized Syntax Fixing**: Refactored the `batchFixMermaidSyntaxInFolder` function by extracting the core logic into a new, reusable `fixMermaidSyntaxInFile` function. This improves code modularity and maintainability.
***Enabled "Auto Mermaid Fix" Feature**: Implemented the core logic for the "Auto Mermaid Fix" feature by adding the `fixMermaidSyntaxInFile` function. This feature, when enabled in settings, automatically corrects Mermaid and LaTeX syntax in notes generated by various commands, ensuring diagram validity.
***Updated Documentation**: Updated `README.md` and `README_zh.md` to reflect the improved reliability of batch processing.
***Parallel Processing Framework**: Introduced a parallel processing framework for batch operations. This was achieved by implementing a custom `Semaphore` for concurrency control and a `createConcurrentProcessor` factory function in `utils.ts`.
***Refactored Batch Commands**: Refactored all major batch processing commands (`processFolderWithNotemdCommand`, `batchGenerateContentForTitles`, `batchExtractConceptsForFolderCommand`) in `main.ts` and `fileUtils.ts`. These commands now utilize the new concurrent processor, allowing for serial I/O operations while executing LLM API calls in parallel. This significantly improves performance for large folders.
***Enhanced Progress Reporting**: Updated the `ProgressReporter` interface and its UI implementations (`ProgressModal`, `NotemdSidebarView`) to display the number of active parallel tasks, providing users with more detailed feedback during batch operations.
***Robustness and Error Handling**:
* Resolved various TypeScript build errors, including incorrect import paths for `normalizeNameForFilePath` and type mismatches for `view.file?.basename`.
* Added safeguards to prevent runtime errors, such as ensuring a note is successfully created before attempting to generate content for it.
***New Batch Processing Settings**: Added new user settings in the UI to control the parallel processing behavior:
*`Enable Batch Parallelism`
*`Batch Concurrency`
*`Batch Size`
*`Delay Between Batches (ms)`
*`API Call Interval (ms)`
***New Command: "Create Wiki-Link & Generate Note from Selection"**:
* This new command streamlines the knowledge creation workflow.
* It allows a user to select text, which is then automatically converted to a `[[wiki-link]]`.
* A corresponding concept note is created in the designated "Concept Note Folder". If the note already exists, a backlink is added instead.
* Finally, its content is automatically generated by the LLM using the "Generate Content from Title" functionality.
***New Setting: "Auto-run Mermaid Syntax Fix"**: Added a setting to automatically run a syntax-fixing pass on notes after content generation tasks to ensure generated Mermaid diagrams are valid.
***Updated Documentation**: Updated `README.md` and `README_zh.md` to comprehensively document all new settings and the new "Create Wiki-Link & Generate Note" command.
Problem: `resolveProviderTokenLimit` passed the global `maxTokens` setting (default 8192) for completely unknown models not in `KNOWN_MODEL_MAX_OUTPUT_TOKENS`. This was incorrect — forcing a fixed cap on models the system doesn't understand risks silently limiting output on high-capability models, or requesting unsupported `max_tokens` values on constrained models.
Fix: When a model is not known (no entry in `KNOWN_MODEL_MAX_OUTPUT_TOKENS`) AND the global `maxTokens` setting equals the default (untouched), the system now returns `undefined` — letting the API provider decide. This matches Cline's behavior exactly. User-set custom `maxTokens` values for unknown models are preserved (backward compatibility).
Scope: `resolveProviderTokenLimit` in `src/llmUtils.ts`. Affects all transports (OpenAI-compatible, Anthropic, Google, Azure OpenAI, Ollama).
Tests: Added 2 tests in `src/tests/llmUtilsProviderSupport.test.ts`:
- Unknown model + default → `max_tokens` not sent (API decides)
- Unknown model + custom value → user's value passed through
### Diagram Edge Field Normalization
Problem: Live LLM testing against DeepSeek revealed that LLM outputs use `source`/`target` edge field names, but `DiagramEdge` expects `from`/`to`. This caused validation failures when LLMs returned valid specs with the "wrong" field names.
Fix:
-`normalizeSpec` in `src/diagram/diagramSpecResponseParser.ts` now normalizes multiple edge field conventions: `from`/`source`/`sourceId`/`start` → `from`, `to`/`target`/`targetId`/`end` → `to`
-`buildDiagramSpecPrompt` in `src/diagram/prompts/diagramSpecPrompt.ts` now explicitly instructs LLMs to use `from`/`to` field names
### Live LLM Chain Tests
New test file `src/tests/liveChainTest.test.ts` (untracked, for manual execution):
- Tests real DeepSeek API calls from the test vault configuration
- Verifies chat completion, diagram spec generation, and full diagram pipeline