Skip to content

🌐 中文 | English


🎉 Notion Files Management v1.5.2-Status

这是 Notion Files Management 的正式版更新,基于 v1.5.0-Status,包含 2 项功能增强、5 项性能与体验优化,以及 6 项 Bug 修复。


功能增强

📁 上传页面支持选择文件夹

  • 上传页面新增「选择文件夹」按钮,支持递归上传整个文件夹结构。
  • 子文件夹在 Notion 中自动创建对应子页面,文件分别上传至各自层级,保持目录结构完整。

🔄 自动推送背景:启动时检测服务端默认变更

  • 程序启动时静默比对服务端当前默认背景与上次已知默认,若检测到变更则自动切换,无需手动操作。
  • 上次已知默认记录于本地 background_cache/last_known_default.txt

性能与体验优化

🔍 工具箱「查询单个页面」全面提升

  • 扫描与探测并行:扫描阶段边发现文件边立即启动大小探测(8 线程),无需等待全部扫描完成,大幅缩短总耗时,同时避免 Notion 签名 URL 在漫长扫描中过期。
  • 文件列表实时渲染:文件发现后立即渲染到列表,大小探测中显示"正在查询中",探测完成后即时更新,无需等待全部完成。
  • 自适应大小单位:文件大小和统计栏总大小从固定 GB 改为自动选择 B / KB / MB / GB,小文件不再显示"0.001 GB"。
  • 实时计时器:查询过程显示已用时(mm:ss),完成后显示总用时。
  • 取消按钮:Step 2 新增「取消」按钮(红色危险样式),可随时中止当前查询。

📐 下载/上传页面任务列表自适应高度

  • 移除任务列表的固定 MaxHeight="520" 限制,窗口放大时列表自动填满可用空间,不再留有大片空白。

🧹 代码清理

  • 工具箱相关代码净减少约 75 行:提取 SyncDownloadListToUI、泛化计时器辅助方法、统一 HideAllModalSteps() 模态管理,精简高频轮询路径上的调试日志,删除空文件 toolkit.py

🐛 Bug 修复

🔗 公告页面超链接点不开(彻底修复)

  • v1.5.1-Status.1 通过隧道事件主修复 + 反射注入 HyperlinkCommand 辅助修复解决了链接无响应问题。
  • v1.5.1-Status.3 进一步修复两层修复互斥导致链接再次失效的问题:辅助修复使 MdXaml 改用 CommandParameter 存储 URL,而主修复只检查了 NavigateUri,兼容两种模式后彻底解决。

📊 工具箱「查询单个页面」总大小始终为 0

  • 根因_probe_one 使用 requests 库探测 Notion S3 URL,该库在 HEAD 响应中无法获取 Content-Length(S3 返回 Transfer-Encoding: chunked)。
  • 修复:改为复用 download.py 中已验证的 urllib 双策略(HEAD → Range GET 回退)。

📊 工具箱「查询单个页面」总大小不实时更新

  • 根因:Phase 4 轮询仅在传统探测进度变化时才读取列表,而文件大小已由流式探测线程直接写入,两者进度不同步。
  • 修复:改为每次轮询(约 350ms)均读取列表并更新统计。

工具箱「查询单个页面」UI 一直显示"准备开始"

  • 根因get_download_list 同步阻塞(子页面多时可达数分钟),期间 Progress 回调从未触发。
  • 修复:阻塞前立即更新状态文本,列表获取完成后主动触发一次初始进度回调。

🖼️ 自动推送背景预设选择保存后丢失

  • 根因SaveBasicConfig() / SaveAppearanceSettings() 调用 ConfigManager.Load() 从磁盘重载配置,覆盖了内存中已选择的预设。
  • 修复:新增类级别字段持久化选择,SaveBackgroundMaterial() 显式回写后再保存。

⬇️ 下载页「取消」按钮未中止后端探测

  • 修复:新增 download.py:cancel_probe() 取消后端探测线程池,main.py:cancel_download_list_probe() 暴露给 C#,点击取消时同步通知后端停止。

🔧 技术变更

新增文件

文件说明
Utils/OpenBrowserCommand.csICommand 实现,在默认浏览器中打开 HTTP/HTTPS 链接;单例模式

修改文件

文件变更说明
Scripts/main.py流式扫描+并行探测架构;_probe_one 改用 urllib 双策略;新增 cancel_download_list_probe();精简调试日志
Scripts/download.py新增 cancel_probe() 取消探测线程池
Scripts/notion.py新增 create_child_page() 在父页面下创建子页面
Scripts/page_size_update.py流式架构重写:新增 _PageAccumulator + _scan_blocks_streaming;新增 files_discovered / files_probed 进度字段
Services/NotionBackendService.csScanStatus record 新增 FilesProbedPageSizeUpdateProgress 新增 FilesDiscovered / FilesProbed;新增 CancelDownloadListProbeAsync()UploadFolderAsync()
Services/UploadSession.cs新增 SelectedFolderPath 状态字段
Models/PageInfoItem.cs实现 INotifyPropertyChanged;新增 IsProbing;大小单位自适应
Views/DownloadPage.xaml布局重构(Grid * 行,移除 MaxHeight
Views/UploadPage.xaml同上;新增「选择文件夹」按钮
Views/UploadPage.xaml.cs文件夹选择、递归上传逻辑
Views/ToolsPage.xaml新增文件级统计行、计时器文本、取消按钮;总大小标签改为自适应
Views/ToolsPage.xaml.cs流式查询 5 阶段重构;代码清理;计时器
Views/NoticePage.xaml.csOnPreviewMouseLeftButtonDown 兼容 NavigateUri + CommandParameter 两种模式
Views/SettingsPage.xaml.cs预设选择类级别字段持久化;SaveBackgroundMaterial() 显式回写
MainWindow.xaml.cs重构 ApplyAutoPushBackgroundAsync();新增 FetchAutoPushConfigAsync()ReadLastKnownServerDefaultAsync()SaveLastKnownServerDefaultAsync()
Notion-Files-Management.csproj版本从 1.5.0-Status 升级至 1.5.2-Status

版本号

  • Version: 1.5.0-Status → 1.5.2-Status
  • InformationalVersion: 1.5.0-Status → 1.5.2-Status

📦 下载

Notion-Files-Management.exe

内嵌 Python 3.11,无需单独安装 Python


💻 系统要求

  • Windows 10 (1809+) · x64
  • 最低 2 GB RAM

🚀 快速开始

  1. 在 Notion 的 Notion Integrations 创建 Integration,复制 Token(ntn_ 开头)。
  2. 在 Notion 页面 → Add connections → 选择你的 Integration。
  3. 打开应用 → 设置 → 粘贴 Token → 保存 → 开始使用。

⚠️ 已知问题

  • 仅支持 Windows x64。
  • 程序重启后任务不会持久化(仅内存保存)。
  • 暂不支持断点续传。
  • 数据源迁移基于标题匹配,同名页面可能导致映射不精确。

🐛 反馈

提交问题 · 参与讨论(GitHub)

如果觉得有用,欢迎给项目点个 ⭐ Star! · 赞助支持 ❤️


发布于 2026年2月23日 · 版本:1.5.2-Status


🎉 Notion Files Management v1.5.2-Status

This is a stable release of Notion Files Management, building on v1.5.0-Status with 2 feature enhancements, 5 performance and UX improvements, and 6 bug fixes.


Feature Enhancements

📁 Folder Upload Support

  • Upload page now includes a "Select Folder" button for recursively uploading an entire folder structure.
  • Sub-folders are automatically created as child pages in Notion, with files uploaded to their respective levels, preserving the original directory structure.

🔄 Auto-Push Background: Detect Server Default Changes on Startup

  • On startup, the app silently compares the current server default background against the last known default. If a change is detected, the background switches automatically.
  • The last known default is stored locally in background_cache/last_known_default.txt.

Performance & UX Improvements

🔍 Toolbox "Query Single Page" — Major Upgrade

  • Parallel scan and probe: File size probing (8 threads) starts immediately as files are discovered during scanning, without waiting for the full scan to complete. This significantly reduces total time and prevents Notion signed URLs from expiring during long scans.
  • Real-time file list rendering: Files appear in the list as soon as they are discovered, showing "Querying..." while probing and updating instantly upon completion.
  • Adaptive size units: File sizes and total size statistics automatically select B / KB / MB / GB — no more "0.001 GB" for small files.
  • Live elapsed timer: Shows time elapsed during the query (mm:ss); displays total time upon completion.
  • Cancel button: New "Cancel" button (red danger style) in Step 2 to abort the current query at any time.

📐 Adaptive Task List Height on Download/Upload Pages

  • Removed the fixed MaxHeight="520" constraint on task lists. The list now fills available space when the window is enlarged, eliminating the large blank area below.

🧹 Code Cleanup

  • ~75 lines of redundant code removed from the Toolbox: extracted SyncDownloadListToUI, generalized timer helpers, unified HideAllModalSteps() modal management, reduced debug logging on hot polling paths, deleted empty toolkit.py.

🐛 Bug Fixes

  • v1.5.1-Status.1: Fixed unresponsive links via tunneling event main fix + reflection-injected HyperlinkCommand auxiliary fix.
  • v1.5.1-Status.3: Fixed a mutual exclusion between the two fixes — the auxiliary fix caused MdXaml to store URLs in CommandParameter instead of NavigateUri, which the main fix didn't check. Both modes are now handled.

📊 Toolbox "Query Single Page" Total Size Always Shows 0

  • Root cause: _probe_one used the requests library to probe Notion S3 URLs, which don't return Content-Length in HEAD responses (Transfer-Encoding: chunked).
  • Fix: Replaced with the already-validated urllib dual-strategy from download.py (HEAD → Range GET fallback).

📊 Toolbox "Query Single Page" Total Size Not Updating in Real Time

  • Root cause: Phase 4 polling only read the file list when the legacy probe progress changed, while sizes were already being written by the streaming probe thread independently.
  • Fix: Now reads the list and updates statistics on every poll cycle (~350ms).

Toolbox "Query Single Page" UI Stuck on "Preparing to Start"

  • Root cause: get_download_list blocks synchronously (can take minutes for pages with many sub-pages), during which no Progress callbacks are fired.
  • Fix: Status text updated immediately before the blocking call; an initial progress callback is fired as soon as the file list is retrieved.

🖼️ Auto-Push Background Preset Selection Lost After Saving

  • Root cause: SaveBasicConfig() / SaveAppearanceSettings() called ConfigManager.Load(), reloading config from disk and overwriting the in-memory selected preset.
  • Fix: Added class-level fields to persist the selection; SaveBackgroundMaterial() now explicitly writes them back before saving.

⬇️ Download Page "Cancel" Button Did Not Stop Backend Probe

  • Fix: Added download.py:cancel_probe() to cancel the backend probe thread pool; exposed via main.py:cancel_download_list_probe() to C#. Clicking cancel now properly stops the backend.

🔧 Technical Changes

New Files

FileDescription
Utils/OpenBrowserCommand.csICommand implementation for opening HTTP/HTTPS URLs in the default browser; singleton pattern

Modified Files

FileChanges
Scripts/main.pyStreaming scan + parallel probe architecture; _probe_one replaced with urllib dual-strategy; added cancel_download_list_probe(); reduced debug logging
Scripts/download.pyAdded cancel_probe() to cancel probe thread pool
Scripts/notion.pyAdded create_child_page() to create child pages under a parent
Scripts/page_size_update.pyRewritten with streaming architecture: added _PageAccumulator + _scan_blocks_streaming; added files_discovered / files_probed progress fields
Services/NotionBackendService.csScanStatus record added FilesProbed; PageSizeUpdateProgress added FilesDiscovered / FilesProbed; added CancelDownloadListProbeAsync(), UploadFolderAsync()
Services/UploadSession.csAdded SelectedFolderPath state field
Models/PageInfoItem.csImplemented INotifyPropertyChanged; added IsProbing; adaptive size units
Views/DownloadPage.xamlLayout refactored (Grid * row, removed MaxHeight)
Views/UploadPage.xamlSame as above; added "Select Folder" button
Views/UploadPage.xaml.csFolder selection and recursive upload logic
Views/ToolsPage.xamlAdded file-level stats row, timer text, cancel button; total size label now adaptive
Views/ToolsPage.xaml.csStreaming query refactored into 5 phases; code cleanup; timers
Views/NoticePage.xaml.csOnPreviewMouseLeftButtonDown now handles both NavigateUri and CommandParameter modes
Views/SettingsPage.xaml.csClass-level fields persist preset selection; SaveBackgroundMaterial() explicitly writes back
MainWindow.xaml.csRefactored ApplyAutoPushBackgroundAsync(); added FetchAutoPushConfigAsync(), ReadLastKnownServerDefaultAsync(), SaveLastKnownServerDefaultAsync()
Notion-Files-Management.csprojVersion upgraded from 1.5.0-Status to 1.5.2-Status

Version

  • Version: 1.5.0-Status → 1.5.2-Status
  • InformationalVersion: 1.5.0-Status → 1.5.2-Status

📦 Download

Notion-Files-Management.exe

Built-in Python 3.11, no separate Python installation required.


💻 System Requirements

  • Windows 10 (1809+) · x64
  • Minimum 2 GB RAM

🚀 Quick Start

  1. Create an Integration in Notion via Notion Integrations and copy the Token (starts with ntn_).
  2. In your Notion page → Add connections → Select your Integration.
  3. Open the application → Settings → Paste the Token → Save → Start using.

⚠️ Known Issues

  • Only supports Windows x64.
  • Tasks are not persistent after restarting the program (memory-only storage).
  • Breakpoint resume is not supported yet.
  • Data source migration uses title-based matching; pages with identical titles may cause imprecise mapping.

🐛 Feedback

Submit Issues · Join Discussions

If you find this project helpful, feel free to give it a ⭐ Star! · Sponsor ❤️


Released on February 23, 2026 · Version: 1.5.2-Status

Released under the MIT License.