Skip to content

Conversation

Pleasurecruise
Copy link
Collaborator

@Pleasurecruise Pleasurecruise commented Sep 26, 2025

Fix #10285 Fix #10388

  • Replace UUID-based IDs with SHA1 hash of file paths for better consistency
  • Remove database storage for notes tree, use local state management instead
  • Add localStorage persistence for starred and expanded states
  • Improve cross-platform path normalization (replace backslashes with forward slashes)
  • Refactor tree operations to use optimized in-memory operations
  • Enhance file watcher integration for better sync performance
  • Simplify notes service with direct file system operations
  • Remove database dependencies from notes tree management

…andling

- Replace UUID-based IDs with SHA1 hash of file paths for better consistency
- Remove database storage for notes tree, use local state management instead
- Add localStorage persistence for starred and expanded states
- Improve cross-platform path normalization (replace backslashes with forward slashes)
- Refactor tree operations to use optimized in-memory operations
- Enhance file watcher integration for better sync performance
- Simplify notes service with direct file system operations
- Remove database dependencies from notes tree management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Pleasurecruise Pleasurecruise marked this pull request as draft September 26, 2025 11:03
@Pleasurecruise Pleasurecruise marked this pull request as ready for review September 26, 2025 11:12
@kangfenmao
Copy link
Collaborator

kangfenmao commented Sep 26, 2025

Note

This comment was translated by Claude.

Several issues

  1. Switching notes causes the file watcher to restart [FileStorage] File watcher started successfully
  2. When renaming a note from note -> note1, both note and note1 appear in the list simultaneously
  3. The note selection speed can be improved by prioritizing the selection of list elements first, then loading the content, which will make it appear faster

Original Content

几个问题

  1. 切换笔记会导致文件监听重启 [FileStorage] File watcher started successfully
  2. 重命名笔记 note -> note1, 列表会同时出现 note,note1 两个文件
  3. 可以加快笔记选中速度,优先选中列表元素,然后再加载内容,这样看起来会快一些

@kangfenmao
Copy link
Collaborator

kangfenmao commented Sep 26, 2025

Note

This comment was translated by Claude.

A few points that need optimization

  1. Data stored in localStorage won't be backed up. Continue using redux storage for now, and migrate in version 2.0
  2. The note title can use a plain input without styles by default, making it easier for users to edit note titles

Original Content

有几个需要优化的点

  1. localStorage 里面存储的数据不会被备份,继续放 redux 存储吧,等 2.0 版本迁移
  2. 笔记的标题可以默认使用没有样式的 input,方便用户编辑笔记标题

- 将starred和expanded路径状态从localStorage迁移到Redux store
- 添加版本159迁移逻辑,自动从localStorage迁移现有数据到Redux
- 优化NotesPage组件,使用Redux状态管理替代本地localStorage操作
- 改进SaveToKnowledgePopup的错误处理和验证逻辑
- 删除NotesTreeService中已废弃的localStorage写入函数
- 增强组件性能,使用ref避免不必要的依赖更新

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Pleasurecruise
Copy link
Collaborator Author

Pleasurecruise commented Sep 26, 2025

Note

This comment was translated by Claude.

We can unify the style-related changes later.
Currently, the notes tree structure is loaded through loadTree, and redux only stores the star and expand states of nodes.


Original Content

样式相关的之后再统一改吧
现在笔记树结构是通过loadTree读取的 redux仅储存node的star和expand状态

@kangfenmao
Copy link
Collaborator

kangfenmao commented Sep 26, 2025

Note

This comment was translated by Claude.

When there's time, two points can be further optimized to significantly improve the notes experience:

  1. When there are 300+ notes, switching between notes becomes laggy (optimization methods like virtual lists)
  2. Note titles can be directly changed to inputs that can be edited on click

Original Content

有时间可以继续优化两个点,可以让笔记使用体验大幅提高:

  1. 当笔记数量多达 300+ 的时候,切换笔记会比较卡(虚拟列表等优化方式)
  2. 笔记标题可以直接修改成 input 点击就能编辑

kangfenmao and others added 2 commits September 26, 2025 23:20
- Implemented an input field for renaming the current note directly in the HeaderNavbar.
- Added handlers for title change, blur, and key events to manage renaming logic.
- Updated the breadcrumb display to accommodate the new title input.
- Enhanced styling for the title input to ensure seamless integration with the existing UI.

This feature improves user experience by allowing quick edits without navigating away from the notes list.
@0xfullex
Copy link
Collaborator

0xfullex commented Sep 26, 2025

Note

This comment was translated by Claude.

Since it involves data changes, let's make these modifications in v2.


Original Content

涉及到数据,在v2中改吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants