Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,5 @@ jobs:
echo "| SHA-256 DMG | \`${DMG_SHA256}\` |"
echo "| SHA-256 ZIP | \`${ZIP_SHA256}\` |"
echo "| Архитектуры | arm64 + x86_64 |"
echo "| Тесты | 156 XCTest |"
echo "| Тесты | 158 XCTest |"
} >> "$GITHUB_STEP_SUMMARY"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ Headless-сканер для бенчмарков:

## Тесты

156 тестов: сравнение суммы скана с `du`, агрегация мелких файлов, пакеты,
158 тестов: сравнение суммы скана с `du`, агрегация мелких файлов, пакеты,
симлинки, Unicode-имена, отказ доступа, отмена, copy-on-write удаление,
свойства squarified-раскладки, вложенные ячейки, полный цикл `AppModel`
(скан → навигация → фильтры), даты создания и изменения, правила очистки,
Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
| 2.0 — Платформа | 6/6: локализация, notarization/Sparkle/Homebrew, CLI, App Intents, доступность, меню-бар |
| Backlog | 5/5: кэш, параллельный скан, бюджеты, старые файлы, APFS-клоны |

Текущая база: **156 XCTest**, 17,9 тыс. строк исходников, 398 ключей
Текущая база: **158 XCTest**, 17,9 тыс. строк исходников, 398 ключей
локализации, `main` зелёный.

## Принципы
Expand Down
8 changes: 4 additions & 4 deletions Sources/DiskScope/DiskScopeApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ struct DiskScopeApp: App {
CommandGroup(replacing: .newItem) {}

CommandGroup(replacing: .undoRedo) {
Button("Отменить удаление") { model.undoLastTrash() }
Button("Отменить удаление") { model.trashOperations.undoLast() }
.keyboardShortcut("z", modifiers: .command)
.disabled(!model.canUndoTrash)
.disabled(!model.trash.canUndo)
}

CommandGroup(after: .appInfo) {
Expand Down Expand Up @@ -126,9 +126,9 @@ struct DiskScopeApp: App {
}
.keyboardShortcut("r", modifiers: [.command, .shift])
.disabled(model.tree == nil)
Button("Переместить в Корзину…") { model.requestTrashSelection() }
Button("Переместить в Корзину…") { model.trashOperations.requestSelection() }
.keyboardShortcut(.delete, modifiers: .command)
.disabled(!model.canTrashSelection)
.disabled(!model.trashOperations.canTrashSelection)
}
}

Expand Down
15 changes: 1 addition & 14 deletions Sources/DiskScopeKit/App/AppModel+Collection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ extension AppModel {
.sorted { $0.size > $1.size }
}

public var canTrashCollection: Bool {
!collection.isEmpty && !fileOperationInFlight
}

public func isInCollection(_ index: Int32) -> Bool {
collection.contains(index)
}
Expand Down Expand Up @@ -73,15 +69,6 @@ extension AppModel {
collection = []
}

public func requestTrashCollection() {
guard canTrashCollection else { return }
if UserDefaults.standard.bool(forKey: AppSettingsKeys.confirmTrash) {
showCollectionTrashConfirmation = true
} else {
confirmCollectionTrash()
}
}

private func isAncestor(_ ancestor: Int32, of node: Int32, in tree: ScanTree) -> Bool {
var cursor = tree.node(node).parent
while cursor >= 0 {
Expand All @@ -94,6 +81,6 @@ extension AppModel {
func resetCollection() {
collection = []
showCollection = false
showCollectionTrashConfirmation = false
trash.showCollectionConfirmation = false
}
}
2 changes: 1 addition & 1 deletion Sources/DiskScopeKit/App/AppModel+Duplicates.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extension AppModel {
public func trashDuplicateFiles(_ indices: Set<Int32>) {
guard !indices.isEmpty else { return }
selection = indices
requestTrashSelection()
trashOperations.requestSelection()
}

public func collectDuplicateFiles(_ indices: Set<Int32>) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/DiskScopeKit/App/AppModel+SearchActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extension AppModel {
search.show = false
selection = [hit.index]
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { [weak self] in
self?.requestTrashSelection()
self?.trashOperations.requestSelection()
}
}
}
2 changes: 1 addition & 1 deletion Sources/DiskScopeKit/App/AppModel+Similar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ extension AppModel {
public func trashSimilarImages(_ indices: Set<Int32>) {
guard !indices.isEmpty else { return }
selection = indices
requestTrashSelection()
trashOperations.requestSelection()
}

public func collectSimilarImages(_ indices: Set<Int32>) {
Expand Down
Loading
Loading