-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Vault: add History section — unified timeline with group-by-anything (date/last-24h first) #9131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
austinywang
wants to merge
121
commits into
main
Choose a base branch
from
issue-9127-vault-history
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
121 commits
Select commit
Hold shift + click to select a range
1e8cb84
Vault: add History section — unified timeline with group-by-anything
austinywang bdf0a43
Fix warning-budget drift inherited from main in AgentSessionRetryCoor…
austinywang ae2d08f
Address review: serialize history appends before publishing revision;…
austinywang 5553029
Address review: single sort per refresh; drop redundant init
austinywang ad4c59d
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang fa8c666
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang a3520c9
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang adf9478
Extract Vault History domain and harden lifecycle recording
austinywang b70ed9e
Flush Vault History before app termination
austinywang 18b3ca8
Defer termination only for pending History writes
austinywang 3a87737
Merge origin/main and complete Vault History audit
austinywang 8192fb9
Merge latest origin/main
austinywang 170519a
Fix inherited Freestyle SDK test drift
austinywang 5c92ff9
Address current-main CI and Vault History review
austinywang 5d73550
Repair current-main macOS CI drift
austinywang 259406d
Clear inherited Swift warning drift
austinywang d926667
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang cb4ef35
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 314254e
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 3eb0c55
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 503a9d9
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang f84f565
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 2534130
Merge origin/main into issue-9127-vault-history
austinywang 30155a0
test: cover narrow Vault History row layout
austinywang fa4ecaf
fix: restore compact Vault styling in History
austinywang b696e06
fix: merge main and record window workspace closures
austinywang 0dbd3f8
Merge origin/main into issue-9127-vault-history
austinywang 778affc
test: align cloud state coverage with current catalog API
austinywang 8094a9d
Merge origin/main into issue-9127-vault-history
austinywang d9b9b8d
fix: return available sidebar modes
austinywang 3c89765
fix: call cloud policy error from instance context
austinywang b5f37df
fix: silence inherited browser payload warning
austinywang 47a27ff
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang c5eea69
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang dbc0b81
Merge branch 'main' into issue-9127-vault-history
austinywang 4bb3a92
Merge branch 'main' into issue-9127-vault-history
austinywang 4c4f1a4
Merge branch 'main' into issue-9127-vault-history
austinywang a115213
fix: compile local tmux helpers in the CLI regression target
austinywang c2ff759
test: expose temporary new-window workspaces in Vault History
austinywang 8062307
fix: exclude temporary new-window workspaces from Vault History
austinywang c0e45ba
test: cover suppressed temporary-window History cleanup
austinywang d772acc
fix: honor History suppression when finalizing window workspaces
austinywang 8f23af2
fix: align Bonsplit with the current main integration
austinywang 7235c7a
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang a5c309e
test: measure the 1000-session History projection
austinywang f81b849
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 084659d
refactor: inject configured window action dependencies
austinywang fd75bb0
test: expose uncommitted window and Cloud VM History events
austinywang d41d75c
fix: commit only retained window and configured workspace History
austinywang e13a115
fix: isolate configured window dependencies to the main actor
austinywang f34b28d
test: exercise Vault tabs grouping and standalone pane in the UI
austinywang 421e53f
test: use the built Vault accessibility labels for UI interaction
austinywang 9239406
refactor: inject the startup restore readiness boundary
austinywang f561736
test: cover History while startup restore waits and year-crossing weeks
austinywang ca16052
fix: enable History when the first window is registered
austinywang 9c41ffe
test: select Vault tabs without pinning their preference
austinywang 4aa8ae5
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 0f80176
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang c97b482
test: query Vault grouping by its macOS accessibility title
austinywang fe4ab61
test: expose discarded reopen events and retained History reload loss
austinywang f5b3d2c
fix: commit usable reopened windows and reload the full retained History
austinywang c4eb017
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang ac5c520
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 34278fd
Merge main and adopt its canonical CLI test-bundle repair
austinywang 07308b4
Merge origin/main and preserve Vault History wiring
austinywang b6ca712
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang c8d1e14
fix: reject unreadable History stores before rewriting
austinywang b78763d
fix: persist session snapshot on normal quit
austinywang a36233d
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 062be7c
fix: pass explicit tint to Vault symbols
austinywang d1a2d01
fix: clear new Swift warning budget entries
austinywang e084fb1
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 0d620e5
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 2b41a57
chore: normalize Xcode project ordering
austinywang 4ee9c7e
test: target Vault history picker by accessibility id
austinywang 1cf854c
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 6146857
fix: preserve pending Vault history action outcomes
austinywang a42f58f
fix: discard startup restore history transaction
austinywang b5a5cfa
fix: keep deferred startup history interactive
austinywang 85c0423
fix: retry startup restore after window close
austinywang 1fe7f54
test: cover deferred restore ownership and action completion
austinywang 68d4351
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang cc6e70d
fix: own deferred restore and finalize History on completion
austinywang d76996f
test: cover completion of suppressed configured splits
austinywang 966b1c4
test: require a stable accessible History grouping control
austinywang c9ff2a4
fix: complete suppressed actions and stabilize verification contracts
austinywang 164f02c
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 2abf952
fix: restore History translations lost during main integration
austinywang c6ecd0c
fix: retain all reviewed History locales
austinywang 753d7c2
test: require stable Vault control identifiers in both mounts
austinywang cb75df3
fix: preserve Vault accessibility boundaries and isolate blocking tes…
austinywang 4b96dd8
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 885592a
ci: allow opt-in crash symbolication for focused E2E diagnostics
austinywang 3022583
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 71a311c
fix: retain committed history events during launch
austinywang 1286544
test: cover discarding a committed launch-window transaction
austinywang 557ee67
fix: retract discarded launch events and await the relay scheduling s…
austinywang 41c9875
test: reproduce background destruction of the agent chat service
austinywang 3633cc6
fix: transfer agent chat teardown to the main actor
austinywang 28184f3
test: require sidebar text accessibility leaves to stay acyclic
austinywang bdbd7ea
fix: keep sidebar text accessibility children free of cell aliases
austinywang 517ef00
test: retain ownership of the accessibility fixture window
austinywang 7f823ca
test: query Vault grouping by its cross-version identifier
austinywang 616759f
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 273cf17
test: match visible Vault menus and row-owned theme semantics
austinywang 62d408a
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang dd84412
ci: provision Node before app-host hook tests
austinywang 99174ef
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang cb12081
ci: forward installed runtimes into XCTest app hosts
austinywang e514a4c
test: reproduce losing committed launch History on quit
austinywang 1c254dd
fix: drain accepted History on quit and bound hook test socket paths
austinywang 0b44f24
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 1198ba6
ci: share the selected-test execution guard with Depot
austinywang 1364eaa
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang 52ab6f3
test: preserve OpenCode execution after the Bun runtime merge
austinywang 5ccec50
ci: move the pinned Bun version with its setup step
austinywang d5e60bc
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang e8fda62
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang f7fa345
Merge remote-tracking branch 'origin/main' into issue-9127-vault-history
austinywang df065ab
test: reproduce History commits crossing lifecycle phases
austinywang 66a0ff3
fix: preserve accepted History across lifecycle phase changes
austinywang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // swift-tools-version: 6.0 | ||
|
|
||
| import PackageDescription | ||
|
|
||
| let package = Package( | ||
| name: "CmuxVaultHistory", | ||
| platforms: [ | ||
| .macOS(.v14), | ||
| ], | ||
| products: [ | ||
| .library( | ||
| name: "CmuxVaultHistory", | ||
| targets: ["CmuxVaultHistory"] | ||
| ), | ||
| ], | ||
| targets: [ | ||
| .target( | ||
| name: "CmuxVaultHistory", | ||
| swiftSettings: [ | ||
| .swiftLanguageMode(.v6), | ||
| .enableUpcomingFeature("ExistentialAny"), | ||
| .enableUpcomingFeature("InternalImportsByDefault"), | ||
| ] | ||
| ), | ||
| .testTarget( | ||
| name: "CmuxVaultHistoryTests", | ||
| dependencies: ["CmuxVaultHistory"], | ||
| swiftSettings: [ | ||
| .swiftLanguageMode(.v6), | ||
| .enableUpcomingFeature("ExistentialAny"), | ||
| .enableUpcomingFeature("InternalImportsByDefault"), | ||
| ] | ||
| ), | ||
| ] | ||
| ) |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # CmuxVaultHistory | ||
|
|
||
| `CmuxVaultHistory` owns the locale-independent values, bounded JSONL | ||
| persistence, and deterministic grouping used by the macOS History timeline. | ||
| The app target owns lifecycle coordination and localized presentation. | ||
|
|
||
| Construct a repository with an explicit file URL. Passing `nil` gives tests an | ||
| in-memory repository with the same retention behavior: | ||
|
|
||
| ```swift | ||
| let store = VaultHistoryEventStore(fileURL: nil) | ||
| let accepted = await store.append(event) | ||
| let events = await store.recentEvents() | ||
| ``` | ||
|
|
||
| Grouping is a pure operation. Inject `now` at the call site and inspect group | ||
| identities without loading AppKit or SwiftUI: | ||
|
|
||
| ```swift | ||
| let groups = VaultHistoryGrouper(calendar: calendar).groups( | ||
| events: events, | ||
| by: .date, | ||
| now: now | ||
| ) | ||
| ``` |
53 changes: 53 additions & 0 deletions
53
Packages/macOS/CmuxVaultHistory/Sources/CmuxVaultHistory/VaultHistoryDateBucket.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| public import Foundation | ||
|
|
||
| /// Browser-history-style date buckets ordered from newest to oldest. | ||
| public enum VaultHistoryDateBucket: Int, CaseIterable, Identifiable, Sendable { | ||
| /// Events in the rolling 24-hour window or on the current calendar day. | ||
| case last24Hours | ||
| /// Events on the previous calendar day that are outside the rolling window. | ||
| case yesterday | ||
| /// Older events in the current calendar week. | ||
| case thisWeek | ||
| /// Older events in the current calendar month. | ||
| case thisMonth | ||
| /// Events preceding the current calendar month. | ||
| case older | ||
|
|
||
| /// Stable ordinal identity used by grouped views. | ||
| public var id: Int { rawValue } | ||
|
|
||
| /// Classifies a timestamp relative to an injected clock and calendar. | ||
| /// | ||
| /// - Parameters: | ||
| /// - date: Event timestamp to classify. | ||
| /// - now: Reference time used for the rolling 24-hour window. | ||
| /// - calendar: Calendar used for day, week, and month boundaries. | ||
| /// - Returns: The single date bucket containing `date`. | ||
| public static func bucket( | ||
| for date: Date, | ||
| now: Date, | ||
| calendar: Calendar | ||
| ) -> VaultHistoryDateBucket { | ||
| if date >= now.addingTimeInterval(-24 * 60 * 60) | ||
| || calendar.isDate(date, inSameDayAs: now) { | ||
| return .last24Hours | ||
| } | ||
| if isYesterday(date, now: now, calendar: calendar) { | ||
| return .yesterday | ||
| } | ||
| if calendar.isDate(date, equalTo: now, toGranularity: .weekOfYear) { | ||
| return .thisWeek | ||
|
austinywang marked this conversation as resolved.
|
||
| } | ||
| if calendar.isDate(date, equalTo: now, toGranularity: .month) { | ||
| return .thisMonth | ||
| } | ||
| return .older | ||
| } | ||
|
|
||
| private static func isYesterday(_ date: Date, now: Date, calendar: Calendar) -> Bool { | ||
| guard let yesterday = calendar.date(byAdding: .day, value: -1, to: now) else { | ||
| return false | ||
| } | ||
| return calendar.isDate(date, inSameDayAs: yesterday) | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.