mirror of
https://github.com/codexu/note-gen.git
synced 2026-04-25 12:55:57 +03:00
Labels
No labels
bug
duplicate
feature
platform: Android
platform: Linux
platform: Windows
platform: iOS
platform: macOS
priority: high
priority: low
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/note-gen#721
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/codexu/note-gen/pull/317
Author: @Ayuyyae
Created: 6/30/2025
Status: ❌ Closed
Base:
dev← Head:dev📝 Commits (4)
73e9515feat: Implement extensible file format support93c23acMerge branch 'codexu:dev' into deve0da571chore: Update version to 0.20.0dbc9df1docs: Update guide documentation for file format support📊 Changes
16 files changed (+837 additions, -482 deletions)
View changed files
📝
.eslintrc.json(+5 -1)➕
.git_commit_message.txt(+4 -0)➕
guide/feature_299_txt_toolbar_support.md(+37 -0)➕
guide/file_format_support.md(+234 -0)📝
package.json(+1 -1)📝
src-tauri/tauri.conf.json(+1 -1)📝
src/app/core/article/custom-footer/index.tsx(+4 -4)📝
src/app/core/article/custom-toolbar/index.tsx(+8 -8)📝
src/app/core/article/md-editor.tsx(+17 -458)➕
src/components/VditorEditorWrapper.tsx(+431 -0)➕
src/lib/fileHandlers/index.ts(+13 -0)➕
src/lib/fileHandlers/markdown.tsx(+17 -0)➕
src/lib/fileHandlers/text.tsx(+26 -0)➕
src/lib/fileHandlers/types.ts(+16 -0)📝
src/stores/article.ts(+22 -9)📝
tsconfig.json(+1 -0)📄 Description
Feature #299: Centralized File Handling and Enhanced .txt Support
This pull request introduces a new centralized file handling mechanism and significantly enhances support for plain text (
.txt) files, addressing feature request #299.Description of Change
This update refactors how different file types are handled within the editor. A new centralized file handler system has been implemented, allowing the application to dynamically select the appropriate editor component based on the file's extension.
Specifically for
.txtfiles, dedicated support has been added:src/lib/fileHandlers/text.tsx) is introduced to specifically manage.txtfiles..txtfiles now utilizes the sameVditorEditorWrappercomponent used for Markdown files. Crucially, the previous filtering logic that removed certain toolbar options for.txtfiles has been eliminated. This ensures that.txtfiles now display the full set of editor toolbar options, identical to those available for.mdfiles, providing a consistent and rich editing experience.Implementation Details
src/app/core/article/md-editor.tsx: Modified to use agetFileHandlerfunction to dynamically load the correct editor component based on theactiveFilePath. This establishes the centralized file handling.src/lib/fileHandlers/text.tsx: New file handler specifically for.txtfiles, defining how they are loaded, saved, and which editor component (VditorEditorWrapperintextmode) should be used.src/lib/fileHandlers/markdown.tsx: Updated to align with the new file handler structure.src/components/VditorEditorWrapper.tsx: The conditional logic that previously filtered toolbar items formode='text'was removed, ensuring a unified toolbar for both.mdand.txtfiles.src/stores/article.ts: Minor adjustments to support the new file handling flow.No new UI visuals or styles were altered. The modifications are primarily functional, enhancing the application's architecture and user experience.
Impact
.txtfiles, including a full-featured toolbar.Testing Notes
This feature has been verified by testing both
.mdand.txtfiles in the application. The following was confirmed:.txtfiles, applying the correct formatting..txtfiles persists changes correctly.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.