Skip to content

armgit / cra

Public Imported from GitHub
0

The open-source Arc replacement for macOS. Spaces, pinned tabs, split view, Little Windows and Arc's shortcuts on Chromium, with your Arc sidebar imported in one go.

A click opens a closed folder even while it keeps the open tab in sight (#213)

Victor5cc90c3f6466
diff --git a/Packages/CraCore/Sources/CraCore/FolderPeek.swift b/Packages/CraCore/Sources/CraCore/FolderPeek.swift
index 934cb91..8c52909 100644
--- a/Packages/CraCore/Sources/CraCore/FolderPeek.swift
+++ b/Packages/CraCore/Sources/CraCore/FolderPeek.swift
@@ -28,11 +28,12 @@ public enum FolderPeek {
return out
}
- /// Whether a click on a folder's row opens it. A folder keeping tabs in sight closes instead,
- /// keeping only the open tab listed (`expanding(_:false:)`), so a folder showing the open tab
- /// doesn't open from a click at all (Arc 1.171, real clicks, 2 Nov 2026).
- public static func clickOpens(expanded: Bool, peeked: Bool) -> Bool {
- !expanded && !peeked
+ /// Whether a click on a folder's row opens it: a closed one always does, also while it keeps
+ /// the open tab in sight. Arc 1.171 doesn't open those (real clicks, 2 Nov 2026), which left
+ /// the rest of the folder out of reach until the tab closed (GitHub #213). Closing it again
+ /// keeps the open tab in sight, as before.
+ public static func clickOpens(expanded: Bool) -> Bool {
+ !expanded
}
/// The peeks once `tab` closes (⌘W) or leaves the sidebar.
diff --git a/Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift b/Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift
index d4186e5..685822b 100644
--- a/Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift
+++ b/Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift
@@ -39,11 +39,17 @@ struct FolderPeekTests {
#expect(FolderPeek.expanding(inner, true, openTabInside: nil, peeks: peeks) == peeks)
}
+ @Test(.bug("https://github.com/VictorKildahl/cra/issues/213"))
+ func aClickOpensAClosedFolderEvenWithItsOpenTabInSight() {
+ #expect(FolderPeek.clickOpens(expanded: false))
+ #expect(!FolderPeek.clickOpens(expanded: true))
+ // Opened, the folder shows all of it; closed again, only the open tab stays in sight.
+ #expect(FolderPeek.expanding(outer, true, openTabInside: tab, peeks: [outer: [tab]]).isEmpty)
+ #expect(FolderPeek.expanding(outer, false, openTabInside: tab, peeks: [:]) == [outer: [tab]])
+ }
+
@Test(.bug("https://github.com/VictorKildahl/cra/issues/85"))
- func aClickOnAPeekedFolderClosesIt() {
- #expect(FolderPeek.clickOpens(expanded: false, peeked: false))
- #expect(!FolderPeek.clickOpens(expanded: true, peeked: false))
- #expect(!FolderPeek.clickOpens(expanded: false, peeked: true))
+ func closingAFolderKeepsOnlyTheOpenTab() {
// Closing it keeps only the open tab: a peek of another tab goes, the open tab's stays.
#expect(FolderPeek.expanding(outer, false, openTabInside: nil, peeks: [outer: [other]]).isEmpty)
#expect(FolderPeek.expanding(outer, false, openTabInside: tab, peeks: [outer: [tab, other]]) == [outer: [tab]])
diff --git a/Sources/Cra/UI/Sidebar/List/SidebarRowViews.swift b/Sources/Cra/UI/Sidebar/List/SidebarRowViews.swift
index ebcd177..6b10ea6 100644
--- a/Sources/Cra/UI/Sidebar/List/SidebarRowViews.swift
+++ b/Sources/Cra/UI/Sidebar/List/SidebarRowViews.swift
@@ -1687,7 +1687,7 @@ final class FolderRowView: SidebarRowView, NSTextFieldDelegate {
override func click(_ event: NSEvent, at point: NSPoint) {
guard let m = model, let list else { return }
if m.editing { commitRename() }
- list.store.setExpanded(m.id, FolderPeek.clickOpens(expanded: m.expanded, peeked: m.peeked))
+ list.store.setExpanded(m.id, FolderPeek.clickOpens(expanded: m.expanded))
}
override func contextMenu(at point: NSPoint) -> NSMenu? {
diff --git a/Tests/promises.lock b/Tests/promises.lock
index 165fd43..834c746 100644
--- a/Tests/promises.lock
+++ b/Tests/promises.lock
@@ -66,7 +66,7 @@
#83 Packages/CraCore/Tests/CraCoreTests/SidebarBackdropTests.swift::logLineNamesTheState 16b128ce2bbf
#84 Packages/CraCore/Tests/CraCoreTests/ToolbarColorTests.swift::reportedThenRememberedThenWhite ab391410bce9
#84 Tests/BrowserManagerLifecycleTests.swift::pageColoursCase ac9d2aee01ca
-#85 Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift::aClickOnAPeekedFolderClosesIt 24a4f57dacd5
+#85 Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift::closingAFolderKeepsOnlyTheOpenTab d8fed1fd838b
#85 Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift::closingATabDropsItFromEveryPeek ec91340a5580
#85 Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift::listedRowsFollowTheSidebarAndSkipTabsThatLeft 225937730d3a
#85 Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift::openingATabInClosedFoldersPeeksItUnderTheOutermost 1350dd0a01f0
@@ -328,5 +328,6 @@
#209 Packages/CraCore/Tests/CraCoreTests/BrowserLanguagesTests.swift::readsThePrefAsChromiumListsIt d7fa1a3f36a4
#209 Tests/Scenarios/accept-languages.scenario 6ca3402ebe15
#211 Packages/CraCore/Tests/CraCoreTests/FaviconKeyTests.swift::tabsOnOneHostKeepTheirOwnIcons 21d360f30e94
+#213 Packages/CraCore/Tests/CraCoreTests/FolderPeekTests.swift::aClickOpensAClosedFolderEvenWithItsOpenTabInSight 70f9e64eb96b
#215 Tests/StoreTests.swift::arcLiveFolderImportsLive a5c462b3a9c7
#218 Tests/Scenarios/extension-popup-download.scenario ffb6285b0eee
diff --git a/docs/arc-reverse-engineering.md b/docs/arc-reverse-engineering.md
index 2d3180d..5a2390e 100644
--- a/docs/arc-reverse-engineering.md
+++ b/docs/arc-reverse-engineering.md
@@ -2667,7 +2667,9 @@ was frontmost, 1x region captures and 100 fps recordings; test tabs archived aft
closed with the tab listed (two clicks), with another tab open it closes for good and drops the peek and the
dots. A folder without a peek opens as usual. Arc's window state then has no entry for it. So a click on a
closed folder that keeps tabs in sight means "close", keeping only the open tab (as the 29 Oct folder-peek
- notes found). Cra: FolderPeek.clickOpens.
+ notes found). Cra copied this until GitHub #213 (6 Nov 2026): a click on a closed folder now always opens it,
+ peek or not (FolderPeek.clickOpens), since Arc's way left the rest of the folder out of reach while one of its
+ tabs was open. Closing it still keeps the open tab in sight.
## Secure DNS (Arc 1.171, 2 Nov 2026, issue #110, live net log)
- [O] Arc leaves Chromium's default. Victor's Arc `Local State` has no `dns_over_https` key, and a net log of Arc