Add clear warning when deleting books that files will be permanently removed (#2438)

Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
ACX
2026-01-23 12:48:44 -07:00
committed by GitHub
co-authored by acx10
parent e03cca1d8c
commit 28adb75a1a
5 changed files with 41 additions and 5 deletions
@@ -454,9 +454,15 @@ export class BookBrowserComponent implements OnInit, AfterViewInit {
confirmDeleteBooks(): void {
this.confirmationService.confirm({
message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?`,
message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?\n\nThis will permanently remove the book files from your filesystem.\n\nThis action cannot be undone.`,
header: 'Confirm Deletion',
icon: 'pi pi-exclamation-triangle',
acceptIcon: 'pi pi-trash',
rejectIcon: 'pi pi-times',
acceptLabel: 'Delete',
rejectLabel: 'Cancel',
acceptButtonStyleClass: 'p-button-danger',
rejectButtonStyleClass: 'p-button-outlined',
accept: () => {
const count = this.selectedBooks.size;
const loader = this.loadingService.show(`Deleting ${count} book(s)...`);
@@ -303,12 +303,15 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
icon: 'pi pi-trash',
command: () => {
this.confirmationService.confirm({
message: `Are you sure you want to delete "${this.book.metadata?.title}"?`,
message: `Are you sure you want to delete "${this.book.metadata?.title}"?\n\nThis will permanently remove the book file from your filesystem.\n\nThis action cannot be undone.`,
header: 'Confirm Deletion',
icon: 'pi pi-exclamation-triangle',
acceptIcon: 'pi pi-trash',
rejectIcon: 'pi pi-times',
acceptLabel: 'Delete',
rejectLabel: 'Cancel',
acceptButtonStyleClass: 'p-button-danger',
rejectButtonStyleClass: 'p-button-outlined',
accept: () => {
this.bookService.deleteBooks(new Set([this.book.id])).subscribe();
}
@@ -622,12 +625,15 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
icon: 'pi pi-book',
command: () => {
this.confirmationService.confirm({
message: `Are you sure you want to delete "${this.book.metadata?.title}"?`,
message: `Are you sure you want to delete "${this.book.metadata?.title}"?\n\nThis will permanently remove the book file from your filesystem.\n\nThis action cannot be undone.`,
header: 'Confirm Deletion',
icon: 'pi pi-exclamation-triangle',
acceptIcon: 'pi pi-trash',
rejectIcon: 'pi pi-times',
acceptLabel: 'Delete',
rejectLabel: 'Cancel',
acceptButtonStyleClass: 'p-button-danger',
rejectButtonStyleClass: 'p-button-outlined',
accept: () => {
this.bookService.deleteBooks(new Set([this.book.id])).subscribe();
}
@@ -370,9 +370,15 @@ export class SeriesPageComponent implements OnDestroy {
confirmDeleteBooks(): void {
this.confirmationService.confirm({
message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?`,
message: `Are you sure you want to delete ${this.selectedBooks.size} book(s)?\n\nThis will permanently remove the book files from your filesystem.\n\nThis action cannot be undone.`,
header: 'Confirm Deletion',
icon: 'pi pi-exclamation-triangle',
acceptIcon: 'pi pi-trash',
rejectIcon: 'pi pi-times',
acceptLabel: 'Delete',
rejectLabel: 'Cancel',
acceptButtonStyleClass: 'p-button-danger',
rejectButtonStyleClass: 'p-button-outlined',
accept: () => {
const count = this.selectedBooks.size;
const loader = this.loadingService.show(`Deleting ${count} book(s)...`);
@@ -235,12 +235,15 @@ export class MetadataViewerComponent implements OnInit, OnChanges {
icon: 'pi pi-trash',
command: () => {
this.confirmationService.confirm({
message: `Are you sure you want to delete "${book.metadata?.title}"?`,
message: `Are you sure you want to delete "${book.metadata?.title}"?\n\nThis will permanently remove the book file from your filesystem.\n\nThis action cannot be undone.`,
header: 'Confirm Deletion',
icon: 'pi pi-exclamation-triangle',
acceptIcon: 'pi pi-trash',
rejectIcon: 'pi pi-times',
acceptLabel: 'Delete',
rejectLabel: 'Cancel',
acceptButtonStyleClass: 'p-button-danger',
rejectButtonStyleClass: 'p-button-outlined',
accept: () => {
this.bookService.deleteBooks(new Set([book.id])).subscribe({
next: () => {
@@ -115,3 +115,18 @@
margin: 0.25rem 0;
flex-shrink: 0;
}
// =============================================================================
// Confirmation Dialog Styles
// =============================================================================
.p-confirmdialog {
max-width: 500px;
width: 90vw;
.p-confirmdialog-message {
white-space: pre-line;
word-wrap: break-word;
overflow-wrap: break-word;
}
}