Repository navigation
Keep selected workspace visible after sidebar reorders #4083
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
Changes from all commits
8853f05
4997db5
e30f3c7
4582e91
0ad6f29
ca4a73c
c775c45
423cefa
2ac8cee
8d07f15
6705ff2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -143,6 +143,68 @@ final class SidebarWorkspaceSnapshotRefreshPolicyTests: XCTestCase { | |
| } | ||
| } | ||
|
|
||
| final class SidebarSelectedWorkspaceScrollPolicyTests: XCTestCase { | ||
| func testSkipsScrollWhenSelectedWorkspaceIdIsNil() { | ||
| XCTAssertFalse( | ||
| SidebarSelectedWorkspaceScrollPolicy.shouldScrollSelectedWorkspace( | ||
| selectedWorkspaceId: nil as String?, | ||
| oldWorkspaceIds: ["a"], | ||
| newWorkspaceIds: ["a"] | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| func testRequestsScrollWhenSelectedWorkspaceFirstAppears() { | ||
| XCTAssertTrue( | ||
| SidebarSelectedWorkspaceScrollPolicy.shouldScrollSelectedWorkspace( | ||
| selectedWorkspaceId: "b", | ||
| oldWorkspaceIds: ["a"], | ||
| newWorkspaceIds: ["a", "b"] | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| func testRequestsScrollWhenSelectedWorkspaceMovesToTop() { | ||
| XCTAssertTrue( | ||
| SidebarSelectedWorkspaceScrollPolicy.shouldScrollSelectedWorkspace( | ||
| selectedWorkspaceId: "c", | ||
| oldWorkspaceIds: ["a", "b", "c"], | ||
| newWorkspaceIds: ["c", "a", "b"] | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| func testRequestsScrollWhenAnotherReorderShiftsSelectedWorkspaceIndex() { | ||
| XCTAssertTrue( | ||
| SidebarSelectedWorkspaceScrollPolicy.shouldScrollSelectedWorkspace( | ||
| selectedWorkspaceId: "b", | ||
| oldWorkspaceIds: ["a", "b", "c"], | ||
| newWorkspaceIds: ["c", "a", "b"] | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| func testSkipsScrollWhenReorderLeavesSelectedWorkspaceIndexUnchanged() { | ||
| XCTAssertFalse( | ||
| SidebarSelectedWorkspaceScrollPolicy.shouldScrollSelectedWorkspace( | ||
| selectedWorkspaceId: "a", | ||
| oldWorkspaceIds: ["a", "b", "c"], | ||
| newWorkspaceIds: ["a", "c", "b"] | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| func testSkipsScrollWhenSelectedWorkspaceIsMissing() { | ||
| XCTAssertFalse( | ||
| SidebarSelectedWorkspaceScrollPolicy.shouldScrollSelectedWorkspace( | ||
| selectedWorkspaceId: "b", | ||
| oldWorkspaceIds: ["a", "b"], | ||
| newWorkspaceIds: ["a", "c"] | ||
| ) | ||
| ) | ||
| } | ||
| } | ||
|
Comment on lines
+146
to
+206
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The new
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed by adding explicit nil-selection coverage for SidebarSelectedWorkspaceScrollPolicy. — Claude Code |
||
|
|
||
| final class SidebarTabItemPresentationResolutionPolicyTests: XCTestCase { | ||
| func testFrozenContextMenuPresentationDoesNotSuppressLiveNotificationState() { | ||
| let tabId = UUID() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.