Skip to content

Commit 799c0fb

Browse files
committed
chore(clients): delete dead pin helper and worktree memberwise init
1 parent 7dba609 commit 799c0fb

3 files changed

Lines changed: 3 additions & 32 deletions

File tree

apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatSessions.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,6 @@ public struct OpenClawChatSessionWorktree: Codable, Sendable, Hashable {
172172
public let id: String?
173173
public let branch: String?
174174
public let repoRoot: String?
175-
176-
public init(id: String? = nil, branch: String? = nil, repoRoot: String? = nil) {
177-
self.id = id
178-
self.branch = branch
179-
self.repoRoot = repoRoot
180-
}
181175
}
182176

183177
public struct OpenClawChatSessionEntry: Codable, Identifiable, Sendable, Hashable {

apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel+SessionActions.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,6 @@ extension OpenClawChatViewModel {
2323
Task { await self.performCompact() }
2424
}
2525

26-
public func setSessionPinned(_ sessionKey: String, pinned: Bool) {
27-
Task {
28-
do {
29-
try await self.transport.patchSession(
30-
key: sessionKey,
31-
label: nil,
32-
category: nil,
33-
pinned: pinned,
34-
archived: nil,
35-
unread: nil)
36-
} catch {
37-
self.errorText = error.localizedDescription
38-
return
39-
}
40-
await self.fetchSessions(limit: nil, sessionSnapshot: self.currentSessionSnapshot())
41-
}
42-
}
43-
44-
/// One-shot session list fetch for search and archived browsing. Falls back
45-
/// to locally filtering the cached active list when the gateway is
46-
/// unreachable; archived rows exist only server-side, so archived mode
47-
/// returns empty offline.
4826
public func fetchSessionList(search: String?, archived: Bool) async -> [OpenClawChatSessionEntry] {
4927
let normalizedSearch = search?.trimmingCharacters(in: .whitespacesAndNewlines)
5028
let query = normalizedSearch?.isEmpty == false ? normalizedSearch : nil

apps/shared/OpenClawKit/Tests/OpenClawKitTests/ChatSessionSidebarModelTests.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,9 @@ struct ChatSessionSidebarModelTests {
210210
#expect(entry.hasActiveRun == true)
211211
#expect(entry.hasActiveSubagentRun == true)
212212
#expect(entry.lastInteractionAt == 1_700_000_000_000)
213-
#expect(entry.worktree == OpenClawChatSessionWorktree(
214-
id: "wt-1",
215-
branch: "feature/chat",
216-
repoRoot: "/repo"))
213+
#expect(entry.worktree?.id == "wt-1")
214+
#expect(entry.worktree?.branch == "feature/chat")
215+
#expect(entry.worktree?.repoRoot == "/repo")
217216
}
218217

219218
@Test func `tree nests children and bubbles run failure and unread badges`() {

0 commit comments

Comments
 (0)