Skip to content

Enhance Finder service workflows and add HTTP/SOCKS5 proxy settings#77

Open
fdreamsu wants to merge 3 commits into
kyleduo:masterfrom
fdreamsu:codex/finder-service-and-proxy-support
Open

Enhance Finder service workflows and add HTTP/SOCKS5 proxy settings#77
fdreamsu wants to merge 3 commits into
kyleduo:masterfrom
fdreamsu:codex/finder-service-and-proxy-support

Conversation

@fdreamsu
Copy link
Copy Markdown
Contributor

Summary / 概要

  • split the Finder integration into two service entries: one for in-place compression and one for Save As compression
    将 Finder 集成拆分为两个服务入口:一个用于就地压缩,另一个用于另存压缩

  • make Compress with Tiny Image always overwrite the selected files in place, regardless of the global Save Mode setting
    Compress with Tiny Image 始终就地覆盖所选文件,不受全局“保存模式”设置影响

  • add Compress with Tiny Image and Save As, which prompts for a destination folder before compressing and saves output there regardless of the global Save Mode setting
    新增 Compress with Tiny Image and Save As,压缩前先选择目标目录,并始终输出到该目录,不受全局“保存模式”设置影响

  • store save mode and output directory on each compression task, while falling back to the global settings when no task-specific value is provided
    将保存模式和输出目录下沉为每个压缩任务的独立属性;当任务未设置时,再回退到全局设置

  • keep the final resolved output path on the task so converted files and Finder actions continue to open the correct location
    在任务上保留最终解析后的输出路径,确保格式转换后的文件和 Finder 操作仍能定位到正确位置

  • reliably foreground the app and main window when Finder service actions are triggered, including activation retries and reopen handling
    在通过 Finder 服务触发操作时,可靠地将应用及主窗口前置,包括激活重试和重新打开窗口处理

  • add HTTP and SOCKS5 proxy settings in the app, including server, port, and optional authentication fields
    在应用设置中新增 HTTP 和 SOCKS5 代理配置,支持服务器、端口和可选认证信息

  • persist proxy configuration, validate proxy input, and route TinyPNG requests through the configured proxy
    持久化代理配置,校验代理输入,并让 TinyPNG 请求通过配置的代理发送

Why / 背景

  • makes the two Finder workflows explicit and predictable without requiring users to switch global settings back and forth
    让 Finder 中两种常见工作流都更明确、可预期,不需要用户反复切换全局设置

  • improves the reliability of Finder service invocations by making sure the app is actually brought to the foreground when user interaction is needed
    提升 Finder 服务调用的可靠性,确保在需要用户交互时应用能够真正前置显示

  • enables one-off Save As operations from Finder without affecting the default drag-and-drop behavior in the main app
    支持在 Finder 中执行一次性的“另存压缩”,同时不影响主应用原有的拖拽默认行为

  • allows users in restricted or proxied network environments to use TinyPNG without relying on system-wide proxy configuration
    让处于受限网络或代理网络环境下的用户无需修改系统级代理,也能使用 TinyPNG

  • establishes task-level save configuration so service-triggered jobs can override global output behavior safely
    建立任务级保存配置能力,使 Finder 服务触发的任务可以安全覆盖全局输出行为

Testing / 验证

  • xcodebuild -project TinyPNG4Mac/TinyPNG4Mac.xcodeproj -scheme "Tiny Image" -configuration Debug -sdk macosx CODE_SIGNING_ALLOWED=NO build

  • manually verified Compress with Tiny Image overwrites selected images in place even when the global Save Mode is set to Save As
    手动验证 Compress with Tiny Image 在全局为“另存为模式”时仍会就地覆盖所选图片

  • manually verified Compress with Tiny Image and Save As prompts for a destination folder and writes output there without using the global output directory
    手动验证 Compress with Tiny Image and Save As 会先弹出目标目录选择框,并输出到所选目录,而不是使用全局输出目录

  • manually verified Finder service invocations reliably bring the app window to the foreground before presenting interactive UI
    手动验证 Finder 服务触发时会可靠地将应用窗口前置,再展示需要交互的 UI

  • manually verified regular drag-and-drop imports still follow the global Save Mode and output directory settings
    手动验证常规拖拽导入仍继续遵循全局“保存模式”和“输出目录”设置

Split the Finder service into in-place and save-as entries.
Store save mode and output directory on each task so service actions can
override global settings without affecting normal drag-and-drop tasks.
Update task resolution and download output handling to persist the final
per-task target path.
- register the main window opener at the App scene level instead of waiting for the first view onAppear
- retry activation until the app becomes active and the main window becomes key
- handle reopen and window ordering so Finder service invocations reliably foreground the app
- Add proxy type, server, port, and optional auth fields in settings
- Persist proxy settings and validate proxy input in app config
- Route TinyPNG requests through HTTP and SOCKS5 proxies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant