Skip to content

v4.0.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 03 Oct 08:23
· 126 commits to main since this release

OhGithubLost 4.0.0 · 预发布 / Pre-release

主题 · Theme — 可靠性重构版:自底向上逐层修复,并把多个自研模块替换为成熟库。
A reliability-focused rebuild: layer-by-layer fixes from the bottom up, replacing several home-grown modules with established packages.

变更 · Changed

  • 权限 · Permissions
    权限申请由纯 Dart 网关改为 permission_handler:Android / iOS / macOS 会真正调起系统权限弹窗。此前实现只做「写入探针 + 打开设置」,且用的是 iOS 专用的 app-settings: URI(在 Android 上无效)。Android 11+ 的「所有文件访问」走 manageExternalStorage;Android 13+ 运行时请求 POST_NOTIFICATIONS。
    Permission requests moved to permission_handler, so Android/iOS/macOS now show real system dialogs; the old implementation only probed by writing and then opened settings via an iOS-only URI that does nothing on Android. Android 11+ uses manageExternalStorage for all-files access, and Android 13+ requests POST_NOTIFICATIONS at runtime.
  • 下载 · Downloads
    自研分块下载器换成 background_downloader(断点续传 / 队列 / 暂停 / 继续 / 取消),IxDownloadManager 等对外契约保持不变、相关页面零改动;落盘位置随库能力调整为「应用文档目录 / ogl / download / <分类>」(该库只支持其 BaseDirectory 枚举,不接受任意绝对路径)。
    The in-house chunked downloader was replaced by background_downloader (resume, queue, pause, resume, cancel) while keeping the public contracts unchanged, so no page needed edits. Download destinations follow the library’s BaseDirectory enum (app documents / ogl / download / category) rather than arbitrary absolute paths.
  • 编辑器 · Editor
    编辑区改为「高亮图层 + 透明输入层」叠加(复用既有词法器),撤销 / 重做改用 Flutter 内建 UndoHistoryController,替换自研防抖快照栈。
    The editor now stacks a highlight layer over a transparent input layer using the existing lexer, and undo/redo moved to Flutter’s built-in UndoHistoryController instead of a custom debounced snapshot stack.
  • 认证 · Auth
    GhAuthService 改为 ChangeNotifier 并引入 GhAuthState(unknown / signedOut / signingIn / signedIn / expired / guest);HTTP 401 是唯一失效出口,外壳订阅状态,令牌失效后自动回到登录门;切号 / 登出会通知订阅方。
    GhAuthService became a ChangeNotifier backed by GhAuthState (unknown / signedOut / signingIn / signedIn / expired / guest). HTTP 401 is the single invalidation trigger; the shell subscribes and returns to the sign-in gate automatically, and account switches/logouts notify subscribers.
  • 通知 · Notifications
    统一通知入口:内核诊断的 error 与引导层信任告警经 sink 转发至 OgLNoticeCenter,无 BuildContext 的底座 / 中枢也能把告警送达界面;通知中心新增历史记录列表。
    Unified notification entry: kernel errors and boot-layer trust warnings funnel through a sink into OgLNoticeCenter, so base/hub code without a BuildContext can still reach the UI; the notification centre gained a history list.
  • 草稿 · Drafts
    DraftStore 改为 ChangeNotifier 并经 GhApi.draftsChanged 暴露,草稿箱与「我的」页订阅后实时刷新(此前是一次性查询)。
    DraftStore became a ChangeNotifier exposed through GhApi.draftsChanged; the drafts box and profile page now refresh live instead of querying once.
  • 依赖 · Dependencies
    新增 permission_handler ^13.0.2、background_downloader ^9.6.3、archive ^3.6.1;新增 dependency_overrides: connectivity_plus: 6.1.4(其 7.x 的 macOS/iOS Swift 用到构建环境尚未提供的 NWPath.isUltraConstrained,会把这两个目标构建打挂)。未引入 highlight / flutter_highlight / flutter_code_editor:它们的 SDK 约束为 Dart < 3,与当前 Dart 3.13 不兼容。
    Added permission_handler, background_downloader and archive, plus a connectivity_plus: 6.1.4 override because 7.x used an SDK symbol missing in the build environment and broke macOS/iOS builds. highlight/flutter_highlight/flutter_code_editor were deliberately not adopted — they constrain Dart < 3 and conflict with Dart 3.13.

新增 · Added

  • Actions 运行日志 · Actions run logs
    带令牌下载日志 zip、经 archive 解压,按 job 展示与搜索(ix_action_logs.dart + action_log_page.dart);新增产物(artifacts)列表与下载地址端点。
    Logs are downloaded as a token-authenticated zip, unpacked with archive, then shown and searched per job (ix_action_logs.dart + action_log_page.dart); artifact listing and download endpoints were added too.
  • 构建期脚本:tool/inject_android_gradle.py(幂等提升宿主 compileSdk)、tool/inject_windows_cmake.py(为 permission_handler_windows 注入 MSVC 兼容宏)。
    Build-time scripts: inject_android_gradle.py raises the host compileSdk idempotently, and inject_windows_cmake.py injects an MSVC compatibility macro for permission_handler_windows.
  • 列表入场动效统一走 OgLReveal 与动效档位(本次覆盖搜索等页面)。
    List entrance animations now consistently use OgLReveal and the motion level (this round covered search and others).

修复 · Fixed

  • Windows 上的构建期 Python 脚本改为 ASCII 输出并设置 PYTHONIOENCODING=utf-8:此前在 Windows 默认码页下打印非 ASCII 会抛 UnicodeEncodeError,直接打挂该构建目标。
    Build-time Python scripts now print ASCII and set PYTHONIOENCODING=utf-8; previously, printing non-ASCII under the Windows default code page raised UnicodeEncodeError and failed that build target.
  • Android 发布护栏新增 POST_NOTIFICATIONS 断言;关于页依赖许可清单补齐新增依赖。
    The Android release guard now asserts POST_NOTIFICATIONS, and the about page’s licence list includes the new dependencies.

已知限制 · Known limitations

  • 本版本为预发布(pre-release):随后进入 4.1 → 4.2 → 4.3 正式线。
    This is a pre-release; the stable line continues with 4.1 → 4.2 → 4.3.
  • background_downloader 9.6.3 的 flutter.plugin.platforms 只声明 android / ios:桌面端不注册该插件,桌面端下载不可用。
    background_downloader 9.6.3 only declares android/ios, so the plugin is not registered on desktop and desktop downloads are unavailable.
  • 编辑器高亮为图层叠加实现,长文件的滚动同步与自动换行场景尚未逐一验证。
    Editor highlighting is layer-based; scroll sync and soft-wrap behaviour for very long files were not exhaustively verified.
  • 动效为逐页补齐,尚未覆盖全部页面。
    Motion was added page by page and does not yet cover every screen.

产物 · Artifacts

Android(arm64-v8a / armeabi-v7a / x86_64 / universal APK / AAB)、Windows、Linux、macOS、iOS —— 13 个构建目标、共 19 个文件。
Android (arm64-v8a / armeabi-v7a / x86_64 / universal APK / AAB), Windows, Linux, macOS, iOS — 13 build targets, 19 files in total.