feat(adult): ✨ add Select all / None buttons to the clip checklist
The goon collection clip list is a multi-select checklist but only had "Queue all fresh" — no way to tick or clear the whole set in one tap. Add "All" and "None" buttons that operate on the currently-shown clips, so with a filter active they select/deselect just the matches. Each disables when it would be a no-op (everything already queued / nothing queued). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ee3da4e101
commit
d06a25da2c
1 changed files with 29 additions and 0 deletions
|
|
@ -98,6 +98,20 @@ struct GoonCollectionView: View {
|
|||
.background(.quaternary.opacity(0.4), in: RoundedRectangle(cornerRadius: 8))
|
||||
|
||||
HStack(spacing: 10) {
|
||||
Button { selectAllShown() } label: {
|
||||
Label("All", systemImage: "checkmark.circle")
|
||||
}
|
||||
.controlSize(.small)
|
||||
.disabled(shown.isEmpty || shown.allSatisfy { playlist.isQueued(path: $0.path) })
|
||||
.help(filter.isEmpty ? "Select every clip" : "Select every clip matching the filter")
|
||||
|
||||
Button { selectNoneShown() } label: {
|
||||
Label("None", systemImage: "circle")
|
||||
}
|
||||
.controlSize(.small)
|
||||
.disabled(shown.allSatisfy { !playlist.isQueued(path: $0.path) })
|
||||
.help(filter.isEmpty ? "Deselect every clip" : "Deselect every clip matching the filter")
|
||||
|
||||
Button { queueAllFresh() } label: {
|
||||
Label("Queue all fresh", systemImage: "plus.rectangle.on.rectangle")
|
||||
}
|
||||
|
|
@ -270,6 +284,21 @@ struct GoonCollectionView: View {
|
|||
}
|
||||
}
|
||||
|
||||
/// Queue every currently-shown clip (respects the active filter, so "All" while
|
||||
/// filtered selects just the matches).
|
||||
private func selectAllShown() {
|
||||
for c in shown where !playlist.isQueued(path: c.path) {
|
||||
playlist.addToQueue(id: c.path, title: c.title, path: c.path)
|
||||
}
|
||||
}
|
||||
|
||||
/// Deselect every currently-shown clip (respects the active filter).
|
||||
private func selectNoneShown() {
|
||||
for c in shown where playlist.isQueued(path: c.path) {
|
||||
playlist.removeFromQueue(path: c.path)
|
||||
}
|
||||
}
|
||||
|
||||
private func clearQueued() {
|
||||
for c in queued { playlist.removeFromQueue(path: c.path) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue