Skip to content

Register .pwlworkflow as a document package - #845

Merged
onevcat merged 2 commits into
mainfrom
feature/pwlworkflow-document-package
Oct 2, 2026
Merged

onevcat merged 2 commits into
mainfrom
feature/pwlworkflow-document-package

Conversation

@onevcat

@onevcat onevcat commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Closes #787.

What

  • Export com.onevcat.prowl.workflow (conforms to com.apple.package, extension pwlworkflow).
  • Add the matching CFBundleDocumentTypes entry.
  • Icon: system-generated document icon (CFBundleTypeIconSystemGenerated + UTTypeIconText). Finder composes the page, the Prowl app icon, and the label "WORKFLOW". No icon asset is added, so the icon follows the app icon and the system icon style.
  • The bundle layout does not change.

Decision: role None

Prowl has no handler for an opened workflow bundle. The document type has the role None, so Launch Services does not bind Prowl as the opener. A double-click in Finder reports that no application is set to open the item. With Viewer or Editor, a double-click brings Prowl forward and does nothing.

Change the role together with the preview/import entry point when that work is done. A test guards the role.

Audit of Open/Reveal actions

No code change is necessary.

  • Open Workflow (Settings detail, after New Workflow) opens <bundle>/workflow.yaml, not the bundle.
  • Reveal (list row, detail, bundle review) uses activateFileViewerSelecting, which selects the package in Finder.
  • Discovery, snapshots, and the watcher use plain FileManager calls with no package-aware options.

Verification

  • Registered the Debug build with lsregister -f. A .pwlworkflow directory reports isPackage: true, content type com.onevcat.prowl.workflow, description "Prowl Workflow", and no default application.
  • Rendered the Finder icon through QLThumbnailGenerator (.icon): page + Prowl icon + "WORKFLOW".
  • open <bundle> fails with kLSApplicationNotFoundErr; Prowl does not start.
  • prowl workflow validate reads a bundle as before.
  • WorkflowDocumentTypeTests, WorkflowsSettingsFeatureTests, WorkflowSettingsDetailFeatureTests: 23 passed. make check and make build-app pass.

Not done: the full make test suite, and a visual check in a Finder window.

Notes

  • Icon Services caches the composed icon by type. After a change to UTTypeIcons, a registered machine can show the old icon until the cache expires. NSWorkspace.icon(forFile:) returns a blank page for this type; Finder and QuickLook show the composed icon.
  • Debug and Release export the same type. The app that Launch Services registered last supplies the icon badge.

Export com.onevcat.prowl.workflow, conforming to com.apple.package, so
Finder shows a workflow bundle as one item with a system-generated
document icon. The document type has the role None: Prowl has no
handler for an opened bundle, so it must not claim to open one.
@onevcat

onevcat commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Review round 1 summary:

  • Dedicated icon is not bundled — deferred to a product decision. The system-generated icon (page + app icon + "WORKFLOW") is the current implementation. A bundled icon needs approved artwork.
  • Double-click now reports "no application" — deferred to a product decision. This is the result of the role None, which was selected so that Prowl is not brought forward with nothing to show. The issue defers the open/import behavior.
  • No guard for the icon declaration — fixed. WorkflowDocumentTypeTests now also checks CFBundleTypeIconSystemGenerated and UTTypeIconText.
  • Finder check — partial. On a registered Debug build, Finder reports a new external .pwlworkflow directory as document file with the kind "Prowl Workflow". A screenshot of the Finder window was not possible (locked screen), so the icon in a Finder window is still not confirmed visually.

@onevcat

onevcat commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Review round 2: no new findings. No change after 08839870. Still open: the bundled-icon decision, the interim double-click decision, and the visual Finder check (icon in a Finder window, Show Package Contents, double-click dialog), which needs an unlocked screen.

@onevcat

onevcat commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Review loop ended at the round cap (4 rounds), not clean. No new findings after round 1 and no change after 08839870. Open before merge: (1) decision on a bundled dedicated icon or the system-generated icon; (2) decision on the interim double-click behavior with the role None; (3) manual Finder check in an unlocked session — icon in list/column/icon views, Show Package Contents, double-click dialog.

@onevcat
onevcat merged commit 03b36b4 into main Oct 2, 2026
1 check passed
@onevcat
onevcat deleted the feature/pwlworkflow-document-package branch October 2, 2026 12:19
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.

Register .pwlworkflow as a macOS document package with a dedicated icon

1 participant