logancyang_obsidian-copilot/src/core
Michael Ryan 87ee9d0d56
fix(rename): Add automatic file renaming to match generated topic titles (#2240)
* fix(rename): Add automatic file renaming to match generated topic titles

Adds automatic file renaming so that notes reflect the finalized AI-generated
topic in their filename. I believe this restores previously expected behavior.

Refs #2005

* Fix chat file renaming to respect original project and hidden directories

- Pass captured project context to generateFileName for async rename,
  ensuring the filename uses the project active at save time rather than global current-project state.
- Add fallback for hidden-directory files when reading epoch for rename,
  using the vault adapter if metadataCache is missing, so AI-generated topic renaming works for hidden folders.

Fix #2240

* fix: honor explicit null project context in async chat renaming

Refactor ChatPersistenceManager to distinguish between 'undefined' project (fallback to global) and 'null' project (explicitly no project). This prevents a race condition where non-project chats were incorrectly moved into project directories upon async file renaming.

Key changes:
- Updated 'generateFileName' to use strict undefined checking for project fallback.
- Reordered method signatures for 'generateFileName', 'generateTopicAsyncIfNeeded', and 'renameFileToMatchTopic' to prioritize the project context.
- Verified all internal call sites have been updated to match the new signatures.
- Confirmed fix via unit tests and local compilation.
2026-03-16 04:34:14 -07:00
..
ChatManager.test.ts Audit context envelope, tag alignment, artifact dedup, and logging (#2164) 2026-02-07 21:18:25 -08:00
ChatManager.ts chore: rename docs to designdocs and nest todo folder (#2252) 2026-03-03 16:26:03 -08:00
ChatPersistenceManager.test.ts Add webTabs support to ChatPersistenceManager test "should preserve context information through save and load cycle" (#2239) 2026-03-02 18:19:44 -08:00
ChatPersistenceManager.ts fix(rename): Add automatic file renaming to match generated topic titles (#2240) 2026-03-16 04:34:14 -07:00
ContextCompactor.ts feat: implement auto-compact context with map-reduce summarization (#2106) 2026-01-13 22:15:24 -08:00
ContextManager.l2Promotion.test.ts fix: prevent stale selected text from leaking into L2 context (#2222) 2026-02-28 14:15:40 -08:00
ContextManager.parseSegments.test.ts Audit context envelope, tag alignment, artifact dedup, and logging (#2164) 2026-02-07 21:18:25 -08:00
ContextManager.ts fix: prevent stale selected text from leaking into L2 context (#2222) 2026-02-28 14:15:40 -08:00
MessageLifecycle.test.ts Context revamp (#1971) 2025-10-27 23:28:36 -07:00
MessageLifecycle.xmltags.test.ts feat: Add Web Viewer bridge for referencing open web tabs in chat (#2096) 2026-01-12 17:54:54 -08:00
MessageRepository.test.ts Context revamp (#1971) 2025-10-27 23:28:36 -07:00
MessageRepository.ts Context revamp (#1971) 2025-10-27 23:28:36 -07:00