What problem are you trying to solve?
When OK Desktop is fully closed and I open a standalone Markdown file from Finder, OK opens two windows:
- the requested temporary single-file window; and
- the project window(s) that were open when OK last exited.
My intent is explicit: I opened one external Markdown file and only want to view that file. Restoring an unrelated knowledge-base project at the same time is distracting, consumes extra resources by starting its project server, and makes the standalone-file workflow feel less isolated than expected.
This is reproducible on the current beta shown below:
- OpenKnowledge Desktop
0.52.0-beta.7
- macOS, Apple Silicon
- Desktop app installed from DMG
Steps to reproduce
- Open an OK project.
- Quit OK cleanly while that project window is still open.
- Confirm OK is no longer running.
- In Finder, choose Open With → OpenKnowledge for a Markdown file outside that project.
- Observe that both the standalone-file window and the previous project window open.
Proposed solution
On a cold launch with an explicit single-file target, let that launch own the initial window set:
- Open only the requested Markdown file.
- Do not restore unrelated windows from the previous OK session.
- If the file now belongs to an existing OK project, open that project focused on the requested file, but still do not restore unrelated previous projects.
Keep the existing behavior in other situations:
- A normal launch from the app icon may continue restoring the previous window set.
- If OK is already running and the user opens a standalone file, add/focus the file window without closing any existing project windows.
If maintainers want to preserve the current policy for some users, please add a persistent Desktop preference such as:
When opening a file while OK is closed:
- Open only the requested file (suggested default)
- Also restore windows from the previous session
Implementation observation
The current boot decision appears to explain the behavior:
packages/desktop/src/main/boot-restore-decision.ts evaluates a restorable pendingWindowRestore snapshot before urlLaunch.
- Its test explicitly pins that a URL/single-file launch does not override a non-empty snapshot.
So this request is a deliberate precedence/policy change: an explicit cold single-file launch should outrank previous-window restoration, or users should be able to configure that precedence.
Expected behavior
Only the requested standalone Markdown file is visible after the cold launch.
Actual behavior
The requested standalone file opens, but OK also restores the previously open project window(s).
Area
Desktop app
Alternatives considered
- Manually closing the restored project window after every external-file launch.
- Launching OK normally and then opening the file. This restores the project first and does not solve the problem.
- Using a special launch argument. This is not discoverable, persistent, or practical for Finder's Open With workflow.
What problem are you trying to solve?
When OK Desktop is fully closed and I open a standalone Markdown file from Finder, OK opens two windows:
My intent is explicit: I opened one external Markdown file and only want to view that file. Restoring an unrelated knowledge-base project at the same time is distracting, consumes extra resources by starting its project server, and makes the standalone-file workflow feel less isolated than expected.
This is reproducible on the current beta shown below:
0.52.0-beta.7Steps to reproduce
Proposed solution
On a cold launch with an explicit single-file target, let that launch own the initial window set:
Keep the existing behavior in other situations:
If maintainers want to preserve the current policy for some users, please add a persistent Desktop preference such as:
Implementation observation
The current boot decision appears to explain the behavior:
packages/desktop/src/main/boot-restore-decision.tsevaluates a restorablependingWindowRestoresnapshot beforeurlLaunch.So this request is a deliberate precedence/policy change: an explicit cold single-file launch should outrank previous-window restoration, or users should be able to configure that precedence.
Expected behavior
Only the requested standalone Markdown file is visible after the cold launch.
Actual behavior
The requested standalone file opens, but OK also restores the previously open project window(s).
Area
Desktop app
Alternatives considered