Skip to content

Commit 5096db5

Browse files
committed
Improving Utility Area Terminal
1 parent b7827d7 commit 5096db5

2 files changed

Lines changed: 24 additions & 19 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// UtilityAreaTerminalGroup.swift
3+
// CodeEdit
4+
//
5+
// Created by Gustavo Soré on 30/06/25.
6+
//
7+
8+
import Foundation
9+
10+
struct UtilityAreaTerminalGroup: Identifiable, Hashable {
11+
var id = UUID()
12+
var name: String = "Grupo"
13+
var terminals: [UtilityAreaTerminal] = []
14+
var isCollapsed: Bool = false
15+
var userName: Bool = false
16+
17+
static func == (lhs: UtilityAreaTerminalGroup, rhs: UtilityAreaTerminalGroup) -> Bool {
18+
lhs.id == rhs.id
19+
}
20+
21+
func hash(into hasher: inout Hasher) {
22+
hasher.combine(id)
23+
}
24+
}

CodeEdit/Features/UtilityArea/ViewModels/UtilityAreaViewModel.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,6 @@
44
import SwiftUI
55
import UniformTypeIdentifiers
66

7-
struct UtilityAreaTerminalGroup: Identifiable, Hashable {
8-
var id = UUID()
9-
var name: String = "Grupo"
10-
var terminals: [UtilityAreaTerminal] = []
11-
var isCollapsed: Bool = false
12-
var userName: Bool = false
13-
14-
static func == (lhs: UtilityAreaTerminalGroup, rhs: UtilityAreaTerminalGroup) -> Bool {
15-
lhs.id == rhs.id
16-
}
17-
18-
func hash(into hasher: inout Hasher) {
19-
hasher.combine(id)
20-
}
21-
}
22-
237
/// # UtilityAreaViewModel
248
/// A model class to host and manage data for the Utility area.
259
class UtilityAreaViewModel: ObservableObject {
@@ -80,8 +64,6 @@ class UtilityAreaViewModel: ObservableObject {
8064

8165
func finalizeMoveTerminal(_ terminal: UtilityAreaTerminal, toGroup groupID: UUID, before destinationID: UUID?) {
8266

83-
print("finalizeMoveTerminal")
84-
8567
let alreadyInGroup = terminalGroups.contains { group in
8668
group.id == groupID &&
8769
group.terminals.count == 1 &&
@@ -99,7 +81,6 @@ class UtilityAreaViewModel: ObservableObject {
9981

10082
// Adiciona ao grupo destino
10183
guard let groupIndex = terminalGroups.firstIndex(where: { $0.id == groupID }) else {
102-
print("⚠️ Grupo não encontrado para o drop.")
10384
return
10485
}
10586

0 commit comments

Comments
 (0)