Repository navigation
feat: document tabs and recent documents welcome window - #10
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeFJc3unfjgUNUjZa6LYUH
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeFJc3unfjgUNUjZa6LYUH
Two fresh-context reviews; the plan's code was built and its tests run. Behavioral fixes: define which tab group a new document joins, re-read the recents list whenever the welcome window is shown, open documents before closing that window, spare autosave-restored untitled documents, and skip the launch handling during hosted test runs. Also handles Dock reopen with no windows, and records the macOS 14 verification gap. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeFJc3unfjgUNUjZa6LYUH
Verified on macOS 26.6.2 (debug build, ad-hoc signed): - Launch with no documents: only the welcome window appears; no blank untitled document, no Open panel (the registered NSShowAppCentricOpenPanelInsteadOfUntitledFile default suppressed it). - Launch with two files: both join one tabbed document window; no welcome. - Recents persist across quit/relaunch in Application Support. Not verifiable in this session (the sandbox lacks Accessibility and Screen Recording permission, so rows could not be clicked and menus could not be inspected): the NSDocumentController.openDocument(withContentsOf:) row-click path, the focusedSceneValue behavior with the welcome window key, drag-out / ⌘⇧[ / ⌘N interactions, and dimmed missing-file rows.
Two fresh-context reviews of the implementation surfaced five issues: - applicationShouldHandleReopen returned false after showing the welcome window, letting AppKit also run its default reopen handling (a new untitled document on top of the welcome window). Now returns true. - WindowTabbingAccessor rescanned for a tab host on every SwiftUI re-render (i.e. every keystroke) and could re-merge a tab the user had deliberately dragged out into its own window. A coordinator flag now joins at most once per window. Measured on macOS 26.6.2: a fresh window can already carry a non-nil tabGroup, so 'has joined' cannot be inferred from tabGroup — gating on tabGroup == nil broke initial joining and was replaced by the flag. - The test-host guard only checked XCTestConfigurationFilePath, which Swift Testing runs do not reliably set; now also probes for the XCTestCase class and XCTestBundlePath. - Reopening an already-open document from the welcome window did not refresh its openedAt (the spec requires it); the openDocument completion now records it. - decode() now deduplicates and re-caps a hand-edited recents.json at read time; duplicate paths would have broken ForEach(id: \.path). Covered by a new unit test (146 total). Regression-verified by launch: two files open as one tabbed window (3/3 runs), no-document launch shows only the welcome window.
Owner
Author
|
Two fresh-context reviews (one REQUEST CHANGES, one APPROVE-with-fixes) led to 4d81405, which addresses their consolidated findings:
Still requiring manual verification before merge (no Accessibility/Screen Recording in the dev sandbox): recents row click ( |
- applicationShouldHandleReopen returns false again after showing the welcome window. AppKit documents false as 'the app handled the reopen'; returning true would run the default handling, which for a document app with no visible windows is opening a new untitled document. The prior commit had inverted this based on a misreading. The reopen path also skips the test-host guard now, like the launch path. - Welcome rows format timestamps with a Gregorian calendar and en_US_POSIX locale regardless of system locale, matching the app's English-only copy (a non-Gregorian or non-Latin locale previously produced localized or wrong-script output from the fixed formats). - Two misleading comments in WindowTabbing reworded: the tabHost fallback is a deliberate last resort, and tabbingMode = .preferred overrides the system 'prefer tabs' setting on purpose. Regression-verified by launch: two files open as one tabbed window (2/2 runs), no-document launch shows only the welcome window. 146 tests green.
Owner
Author
|
Second dual fresh-context review round (of 896d447's parent state) — one APPROVE, one REQUEST CHANGES with a single P2, fixed in 896d447:
Regression: 146 tests green; two-file launch → one tabbed window (2/2), no-document launch → only the welcome window. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the tabs-and-recents spec/plan (docs/superpowers, 2026-09-10).
What
tech.ankey.Markout.documentand joins an existing tab group viaaddTabbedWindow(settingtabbingModealone is too late — see spike findings in the spec).DocumentGroupcreates and shows an AppKit-hosted welcome window listing recent documents; also available fromWindow ▸ Welcome to Markoutand on Dock-icon reopen.~/Library/Application Support/Markout/recents.json(capped at 10, newest first, missing files dimmed and unclickable).Verification
NSDocumentController.openDocument(withContentsOf:)path — fallbacks in the plan's Fallback Notes),focusedSceneValuebehavior with the welcome window key, drag-out / ⌘⇧[ / ⌘N interactions, dimmed missing-file rows, and the Prefer tabs: Always setting. Also not re-verified on the macOS 14 deployment floor.